diff options
author | Limin Wang <lance.lmwang@gmail.com> | 2022-03-14 10:05:42 +0800 |
---|---|---|
committer | Limin Wang <lance.lmwang@gmail.com> | 2022-03-22 23:00:53 +0800 |
commit | fc8a6a6f4cc3d9b5ca278d181bba97297dd8ee6a (patch) | |
tree | 59ab3d9009b618811a133469d66eb5c797667a24 | |
parent | e78173557da898f18a78241cc3525b76694164b5 (diff) | |
download | ffmpeg-fc8a6a6f4cc3d9b5ca278d181bba97297dd8ee6a.tar.gz |
avformat/movenc: initialize pts/dts of timecode packet
Fix below error message when timecode packet is written.
"Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format"
try to reproduce by:
ffmpeg -y -f lavfi -i color -metadata "timecode=00:00:00:00" -t 1 test.mov
Note although error message is printed, the timecode packet will be written anyway. So
the patch 2/2 will try to change the log level to warning.
Fixes ticket #9488
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
-rw-r--r-- | libavformat/movenc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 2d521cb362..4e9ce1b952 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6359,6 +6359,7 @@ static int mov_create_timecode_track(AVFormatContext *s, int index, int src_inde pkt->data = data; pkt->stream_index = index; pkt->flags = AV_PKT_FLAG_KEY; + pkt->pts = pkt->dts = av_rescale_q(tc.start, av_inv_q(rate), (AVRational){1,mov->movie_timescale}); pkt->size = 4; AV_WB32(pkt->data, tc.start); ret = ff_mov_write_packet(s, pkt); |