diff options
author | Tim Walker <tdskywalker@gmail.com> | 2014-03-03 18:53:42 +0400 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-03-09 21:09:40 +0400 |
commit | b6c61fb83e876d404ac3b0b3657ebfcafdcd1926 (patch) | |
tree | 834651d24d895171ad86398106ac3f3d51937671 /libavformat/movenc.c | |
parent | 20b40a597cdd4969cf1147d7c7efee2b6232524b (diff) |
movenc: enable Annex B to MP4 conversion for HEVC tracks.
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 641e1c7f48..6218259664 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2939,6 +2939,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); } |