aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-11-20 11:45:18 -0300
committerJames Almer <jamrial@gmail.com>2024-11-22 10:49:32 -0300
commitf0051604c7f131582e6fa97febd77069e1d87032 (patch)
tree124fcb5e9055c5f3da8e0f159a7550502509ac9b
parent46cb7b8d9dcfdea1b1df446a98ec886a4434820c (diff)
downloadffmpeg-f0051604c7f131582e6fa97febd77069e1d87032.tar.gz
avformat/movenc: don't write PS NALUs in hvcC for codec tag hvc1
array_completeness shall be 1 for those tracks. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/movenc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 4152149ec1..b6772ae548 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6655,9 +6655,10 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
} else if (par->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 */
+ int filter_ps = (trk->tag == MKTAG('h','v','c','1'));
if (trk->hint_track >= 0 && trk->hint_track < mov->nb_tracks) {
ret = ff_hevc_annexb2mp4_buf(pkt->data, &reformatted_data,
- &size, 0, NULL);
+ &size, filter_ps, NULL);
if (ret < 0)
return ret;
avio_write(pb, reformatted_data, size);
@@ -6669,7 +6670,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
goto err;
}
} else {
- size = ff_hevc_annexb2mp4(pb, pkt->data, pkt->size, 0, NULL);
+ size = ff_hevc_annexb2mp4(pb, pkt->data, pkt->size, filter_ps, NULL);
}
}
} else if (par->codec_id == AV_CODEC_ID_VVC && trk->vos_len > 6 &&