diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-09 23:07:48 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-09 23:08:33 +0100 |
commit | a379813ceed6b24c149aa8e50a7bd2b09639208a (patch) | |
tree | 2282139849530947c3dabb6b430291cf071fc83c /libavformat/movenc.c | |
parent | cb403b2570385cbf48a11f9f48441de5cd01171e (diff) | |
parent | b6c61fb83e876d404ac3b0b3657ebfcafdcd1926 (diff) | |
download | ffmpeg-a379813ceed6b24c149aa8e50a7bd2b09639208a.tar.gz |
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.c | 9 |
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); } |