Opened 13 months ago

Last modified 13 months ago

#8925 new defect

Concat demuxer shifts video stream start time

Reported by: Yuanjing Zhao Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: concat
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

After a single mp4 video containing video and audio streams both with start_time=0 and start_pts=0 is processed by concat demuxer with -c copy option, video stream start_time and start_pts are no longer zero.

This causes the processed video, when opened with QuickTime player on Mac, to initially display a blank frame, although the rest of the video plays normally.

Ffmpeg version used:

ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 11.0.3 (clang-1103.0.32.62)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100

Ffprobe version used:

ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
built with Apple clang version 11.0.3 (clang-1103.0.32.62)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100

How to reproduce:

Given video before.mp4 containing video and audio streams both with start_time=0 and start_pts=0.

Given concat demuxer input file concat.txt with contents:

file before.mp4

Run command ffmpeg -f concat -i concat.txt -c copy concat.mp4

Run command ffprobe concat.mp4 -show_streams and observe that video stream start_time and start_pts are no longer zero.

Attachments (6)

before.mp4 (792.5 KB ) - added by Yuanjing Zhao 13 months ago.
mp4 file prior to being processed by concat demuxer
concat.mp4 (792.6 KB ) - added by Yuanjing Zhao 13 months ago.
mp4 file after being processed by concat demuxer
concat.txt (16 bytes ) - added by Yuanjing Zhao 13 months ago.
input file to concat demuxer
before.info (1.9 KB ) - added by Yuanjing Zhao 13 months ago.
ffprobe -show_streams output for before.mp4
concat.info (1.9 KB ) - added by Yuanjing Zhao 13 months ago.
ffprobe -show_streams output for concat.mp4
screenshot.png (867.3 KB ) - added by Yuanjing Zhao 13 months ago.
what's seen upon opening before.mp4 (left) and concat.mp4 (right) in QuickTime player on Mac

Change History (7)

by Yuanjing Zhao, 13 months ago

Attachment: before.mp4 added

mp4 file prior to being processed by concat demuxer

by Yuanjing Zhao, 13 months ago

Attachment: concat.mp4 added

mp4 file after being processed by concat demuxer

by Yuanjing Zhao, 13 months ago

Attachment: concat.txt added

input file to concat demuxer

by Yuanjing Zhao, 13 months ago

Attachment: before.info added

ffprobe -show_streams output for before.mp4

by Yuanjing Zhao, 13 months ago

Attachment: concat.info added

ffprobe -show_streams output for concat.mp4

by Yuanjing Zhao, 13 months ago

Attachment: screenshot.png added

what's seen upon opening before.mp4 (left) and concat.mp4 (right) in QuickTime player on Mac

comment:1 by Carl Eugen Hoyos, 13 months ago

Component: ffmpegundetermined
Keywords: demuxer start_pts start_time shift removed

Please test current FFmpeg git head to make this a valid ticket.

Note: See TracTickets for help on using tickets.