DVB H264 chunk transcoding => merging in MP4 => out of sync
Viewing on VLC works great. Audio/Video perfectly in sync. Viewing in Quicktime (Version 10.4 MacOS sierra, Quicktime 7) the video get's out of sync after 3/4 minutes. Scrubbing in the timeline will fix the problem, then after 3/4 minutes I see the synchronization problem again. Using current FFmpeg version to transcode into H.264 and AAC TS chunks. ffmpeg -i "udp://224.5.2.5:10001?overrun_nonfatal=1&fifo_size=50000000" -map 0:3 -map 0:4 -s 1280x720 -acodec aac -b:a 192k -ac 2 -ar 48000 -vcodec libx264 -preset:v medium -r 50 -g 100 -vb 3200000 -y -fflags +genpts -f segment -segment_time 60 -segment_atclocktime 1 -strftime 1 "/videofiles/TV_HD_%Y-%m-%d_%H-%M-%S.ts Everything works fine... chunks are created. No errors in output. Audio/video TS pieces in sync. #### Details of a chunk file: ffprobe /videofiles/TV_HD_2017-03-13_14-25-00.ts ffprobe version 3.2.4-tessus Copyright (c) 2007-2017 the FFmpeg developers built with Apple LLVM version 8.0.0 (clang-800.0.42.1) configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 Input #0, mpegts, from '/Users/Andreas/Desktop/TEST/ARD_HD_2017-03-13_14-25-00.ts': Duration: 00:01:00.04, start: 115.402667, bitrate: 3720 kb/s Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc Stream #0:1[0x101](deu): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 204 kb/s #### Merging together: ffmpeg -f concat -safe 0 -i files.txt -y -metadata creation_time=now -c:v copy -c:a copy -fflags +genpts -movflags faststart -use_editlist 0 -f mp4 tvexport.mp4 #### and output: ffmpeg version 3.2.4-tessus Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.0.0 (clang-800.0.42.1) configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 Input #0, concat, from 'files.txt': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc Stream #0:1(deu): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 169 kb/s Output #0, mp4, to 'work_tmp0.mp4': Metadata: creation_time : now encoder : Lavf57.56.101 Stream #0:0: Video: h264 (High) ([33][0][0][0] / 0x0021), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 50 fps, 50 tbr, 90k tbn, 90k tbc Stream #0:1(deu): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 169 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [mp4 @ 0x7fff37800600] Starting second pass: moving the moov atom to the beginning of the filex frame=24000 fps=9825 q=-1.0 Lsize= 199633kB time=00:08:00.20 bitrate=3405.6kbits/s speed= 197x video:187817kB audio:11755kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.030912% What could be the problem?
2017-03-15 13:03 GMT+01:00 <ffmpeg@me.com>:
ffmpeg version 3.2.4-tessus Copyright (c) 2000-2017 the FFmpeg developers
Please test current FFmpeg git head (and tell us if anything is unclear on tessus's homepage) and if the issue is reproducible, please provide input file(s). Carl Eugen
Dear Carl, many thanks for your feedback. Hope you can help! We used the current dev version (ffmpeg-84005-g3ba7b47 from today morning) - same result. Example-Files could be taken from here: https://www.wetransfer.com/downloads/ba29067a28723c12373dbfdd25c4bfae2017031... Command we used to concat and create MP4: ffmpeg -f concat -safe 0 -i files.txt -y -metadata creation_time=now -c:v copy -vsync 1 -c:a copy -fflags +genpts -movflags faststart -use_editlist 0 -f mp4 work_tmp0.mp4 ffmpeg version N-84005-g3ba7b47-tessus Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.0.0 (clang-800.0.42.1) configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-libzvbi --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb libavutil 55. 48.100 / 55. 48.100 libavcodec 57. 83.100 / 57. 83.100 libavformat 57. 66.104 / 57. 66.104 libavdevice 57. 3.100 / 57. 3.100 libavfilter 6. 76.100 / 6. 76.100 libswscale 4. 3.101 / 4. 3.101 libswresample 2. 4.100 / 2. 4.100 libpostproc 54. 2.100 / 54. 2.100 Input #0, concat, from 'files.txt': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc Stream #0:1(deu): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 235 kb/s Output #0, mp4, to 'work_tmp0.mp4': Metadata: creation_time : now encoder : Lavf57.66.104 Stream #0:0: Video: h264 (High) ([33][0][0][0] / 0x0021), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 50 fps, 50 tbr, 90k tbn, 90k tbc Stream #0:1(deu): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 235 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [mp4 @ 0x7fbc4e0b6000] Starting second pass: moving the moov atom to the beginning of the file frame=27000 fps=8929 q=-1.0 Lsize= 224240kB time=00:09:00.18 bitrate=3400.7kbits/s speed= 179x video:210889kB audio:12843kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.227265% The delay is visible at minute 2~3. At minute 4 it's very visible in Quicktime. Remember: do not scrub in the timeline during playback. Scrubbing does an alignment and everything is back in sync. No problems in VLC. Any help is very, very appreciated. Best, Andreas
Am 16.03.2017 um 20:50 schrieb Carl Eugen Hoyos <ceffmpeg@gmail.com>:
2017-03-15 13:03 GMT+01:00 <ffmpeg@me.com>:
ffmpeg version 3.2.4-tessus Copyright (c) 2000-2017 the FFmpeg developers
Please test current FFmpeg git head (and tell us if anything is unclear on tessus's homepage) and if the issue is reproducible, please provide input file(s).
Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
Dear Carl, example files on wetransfer are going to be removed soon. Was a download successful? Best, Andreas
Am 17.03.2017 um 10:51 schrieb ffmpeg@me.com:
Dear Carl,
many thanks for your feedback. Hope you can help! We used the current dev version (ffmpeg-84005-g3ba7b47 from today morning) - same result.
Example-Files could be taken from here: https://www.wetransfer.com/downloads/ba29067a28723c12373dbfdd25c4bfae2017031... Command we used to concat and create MP4:
ffmpeg -f concat -safe 0 -i files.txt -y -metadata creation_time=now -c:v copy -vsync 1 -c:a copy -fflags +genpts -movflags faststart -use_editlist 0 -f mp4 work_tmp0.mp4 ffmpeg version N-84005-g3ba7b47-tessus Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.0.0 (clang-800.0.42.1) configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-libzvbi --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb libavutil 55. 48.100 / 55. 48.100 libavcodec 57. 83.100 / 57. 83.100 libavformat 57. 66.104 / 57. 66.104 libavdevice 57. 3.100 / 57. 3.100 libavfilter 6. 76.100 / 6. 76.100 libswscale 4. 3.101 / 4. 3.101 libswresample 2. 4.100 / 2. 4.100 libpostproc 54. 2.100 / 54. 2.100 Input #0, concat, from 'files.txt': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc Stream #0:1(deu): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 235 kb/s Output #0, mp4, to 'work_tmp0.mp4': Metadata: creation_time : now encoder : Lavf57.66.104 Stream #0:0: Video: h264 (High) ([33][0][0][0] / 0x0021), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 50 fps, 50 tbr, 90k tbn, 90k tbc Stream #0:1(deu): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 235 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [mp4 @ 0x7fbc4e0b6000] Starting second pass: moving the moov atom to the beginning of the file frame=27000 fps=8929 q=-1.0 Lsize= 224240kB time=00:09:00.18 bitrate=3400.7kbits/s speed= 179x video:210889kB audio:12843kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.227265%
The delay is visible at minute 2~3. At minute 4 it's very visible in Quicktime. Remember: do not scrub in the timeline during playback. Scrubbing does an alignment and everything is back in sync. No problems in VLC.
Any help is very, very appreciated. Best, Andreas
Am 16.03.2017 um 20:50 schrieb Carl Eugen Hoyos <ceffmpeg@gmail.com>:
2017-03-15 13:03 GMT+01:00 <ffmpeg@me.com>:
ffmpeg version 3.2.4-tessus Copyright (c) 2000-2017 the FFmpeg developers
Please test current FFmpeg git head (and tell us if anything is unclear on tessus's homepage) and if the issue is reproducible, please provide input file(s).
Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
2017-03-15 13:03 GMT+01:00 <ffmpeg@me.com>:
ffmpeg -f concat -safe 0 -i files.txt -y -metadata creation_time=now -c:v copy -c:a copy -fflags +genpts -movflags faststart -use_editlist 0 -f mp4 tvexport.mp4
I have removed the absolute paths from files.txt (you do agree they make testing impossible?) and have tested the following command line: $ ffmpeg -f concat -i files.txt -c copy out.mp4 (The other options you use seem superfluous or make little sense) The output file plays fine with MPlayer, vlc and ffplay (three different demuxers). Are you able to test with WMP? Can you confirm that this file still fails with QT? Carl Eugen
Confirmed: video still fails in Quicktime. WMP under Win 8.1 looks after quick test fine. Test under Win 10 will be done soon. Tested on iOS (current 10.2, iPhone 6s) the same video. Also here the same delay is visible (playback on iOS is based generally on Quicktime). Demo is attached (screen-record, audio source speakers of the system - not perfect but does the trick for test): www.keepinmind.info/download/error.mov <http://www.keepinmind.info/download/error.mov> Andreas
Am 24.03.2017 um 20:48 schrieb Carl Eugen Hoyos <ceffmpeg@gmail.com>:
2017-03-15 13:03 GMT+01:00 <ffmpeg@me.com>:
ffmpeg -f concat -safe 0 -i files.txt -y -metadata creation_time=now -c:v copy -c:a copy -fflags +genpts -movflags faststart -use_editlist 0 -f mp4 tvexport.mp4
I have removed the absolute paths from files.txt (you do agree they make testing impossible?) and have tested the following command line: $ ffmpeg -f concat -i files.txt -c copy out.mp4 (The other options you use seem superfluous or make little sense) The output file plays fine with MPlayer, vlc and ffplay (three different demuxers). Are you able to test with WMP? Can you confirm that this file still fails with QT?
Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
Eugen, we tested also under Chrome (v57, MacOS), Chrome Android (current Version) and Windows 10 with the new media player. We did not recognize the sync problems with the test-movie. Conclusion: problems just under iOS and Quicktime (MacOS, Windows version of Quicktime probably too). Best, Andreas
Am 25.03.2017 um 14:39 schrieb ffmpeg@me.com:
Confirmed: video still fails in Quicktime. WMP under Win 8.1 looks after quick test fine. Test under Win 10 will be done soon. Tested on iOS (current 10.2, iPhone 6s) the same video. Also here the same delay is visible (playback on iOS is based generally on Quicktime).
Demo is attached (screen-record, audio source speakers of the system - not perfect but does the trick for test): www.keepinmind.info/download/error.mov <http://www.keepinmind.info/download/error.mov>
Andreas
Am 24.03.2017 um 20:48 schrieb Carl Eugen Hoyos <ceffmpeg@gmail.com>:
2017-03-15 13:03 GMT+01:00 <ffmpeg@me.com>:
ffmpeg -f concat -safe 0 -i files.txt -y -metadata creation_time=now -c:v copy -c:a copy -fflags +genpts -movflags faststart -use_editlist 0 -f mp4 tvexport.mp4
I have removed the absolute paths from files.txt (you do agree they make testing impossible?) and have tested the following command line: $ ffmpeg -f concat -i files.txt -c copy out.mp4 (The other options you use seem superfluous or make little sense) The output file plays fine with MPlayer, vlc and ffplay (three different demuxers). Are you able to test with WMP? Can you confirm that this file still fails with QT?
Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
Eugen, you have any idea how to solve the Quicktime issue? Best, Andreas
Am 29.03.2017 um 12:30 schrieb ffmpeg@me.com:
Eugen, we tested also under Chrome (v57, MacOS), Chrome Android (current Version) and Windows 10 with the new media player. We did not recognize the sync problems with the test-movie.
Conclusion: problems just under iOS and Quicktime (MacOS, Windows version of Quicktime probably too).
Best, Andreas
Am 25.03.2017 um 14:39 schrieb ffmpeg@me.com <mailto:ffmpeg@me.com>:
Confirmed: video still fails in Quicktime. WMP under Win 8.1 looks after quick test fine. Test under Win 10 will be done soon. Tested on iOS (current 10.2, iPhone 6s) the same video. Also here the same delay is visible (playback on iOS is based generally on Quicktime).
Demo is attached (screen-record, audio source speakers of the system - not perfect but does the trick for test): www.keepinmind.info/download/error.mov <http://www.keepinmind.info/download/error.mov> <http://www.keepinmind.info/download/error.mov <http://www.keepinmind.info/download/error.mov>>
Andreas
Am 24.03.2017 um 20:48 schrieb Carl Eugen Hoyos <ceffmpeg@gmail.com>:
2017-03-15 13:03 GMT+01:00 <ffmpeg@me.com>:
ffmpeg -f concat -safe 0 -i files.txt -y -metadata creation_time=now -c:v copy -c:a copy -fflags +genpts -movflags faststart -use_editlist 0 -f mp4 tvexport.mp4
I have removed the absolute paths from files.txt (you do agree they make testing impossible?) and have tested the following command line: $ ffmpeg -f concat -i files.txt -c copy out.mp4 (The other options you use seem superfluous or make little sense) The output file plays fine with MPlayer, vlc and ffplay (three different demuxers). Are you able to test with WMP? Can you confirm that this file still fails with QT?
Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org <mailto:ffmpeg-user@ffmpeg.org> http://ffmpeg.org/mailman/listinfo/ffmpeg-user <http://ffmpeg.org/mailman/listinfo/ffmpeg-user>
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org <mailto:ffmpeg-user-request@ffmpeg.org> with subject "unsubscribe".
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org <mailto:ffmpeg-user@ffmpeg.org> http://ffmpeg.org/mailman/listinfo/ffmpeg-user <http://ffmpeg.org/mailman/listinfo/ffmpeg-user>
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org <mailto:ffmpeg-user-request@ffmpeg.org> with subject "unsubscribe".
participants (2)
-
Carl Eugen Hoyos -
ffmpeg@me.com