Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-10 02:07:48 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-03-10 02:08:33 +0400
commita379813ceed6b24c149aa8e50a7bd2b09639208a (patch)
tree2282139849530947c3dabb6b430291cf071fc83c /libavformat/movenc.c
parentcb403b2570385cbf48a11f9f48441de5cd01171e (diff)
parentb6c61fb83e876d404ac3b0b3657ebfcafdcd1926 (diff)
Merge commit 'b6c61fb83e876d404ac3b0b3657ebfcafdcd1926'
* commit 'b6c61fb83e876d404ac3b0b3657ebfcafdcd1926': movenc: enable Annex B to MP4 conversion for HEVC tracks. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 3798706a83..a5e6b0d8cb 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3351,6 +3351,15 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
} else {
size = ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
}
+ } else if (enc->codec_id == AV_CODEC_ID_HEVC && trk->vos_len > 6 &&
+ (AV_RB24(trk->vos_data) == 1 || AV_RB32(trk->vos_data) == 1)) {
+ /* extradata is Annex B, assume the bitstream is too and convert it */
+ if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) {
+ ff_hevc_annexb2mp4_buf(pkt->data, &reformatted_data, &size, 0, NULL);
+ avio_write(pb, reformatted_data, size);
+ } else {
+ size = ff_hevc_annexb2mp4(pb, pkt->data, pkt->size, 0, NULL);
+ }
} else {
avio_write(pb, pkt->data, size);
}