I got this video using Tubedigger from NYTimes webpage:
https://www.nytimes.com/2021/01/07/us/names-of-rioters-capitol.html?action=click&modul...gtype=Homepage
The downloaded ts file from Tubedigger plays OK, however, when I use Tubedigger lossless convert tool to convert to mp4, the resulting video has severe problems (pausing/stutter) in playback (tried vlc and MPC). I've never had this kind of problem before when converting ts to mp4. I tried various ffmpeg scripts to try to losslessly convert this ts to mp4, but was unsuccessful.
In the end, I used Vidcoder to re-encode the ts to mp4, and the resulting video plays OK.
My questions are:
1) Why does the converted mp4 (using lossless convert tool) not play correctly?
2) Is there an ffmpeg script (please give exact script if there is one) that will convert losslessly this ts to mp4?
3) If you put this problem mp4 into MediaInfo, is there some clue from MediaInfo that tells you that there is something wrong with this mp4 file?
See following attached files:
1) ts from Tubedigger that plays OK
2) converted mp4 that has severe playback problems
+ Reply to Thread
Results 1 to 6 of 6
-
Last edited by jimdagys; 8th Jan 2021 at 11:29.
-
Some kind of variable frame rate confusion. pkt_dts and pkt_dts_time values aren't increasing the way they should. The latter is increasing by about 11 microseconds per frame, not the expected ~41 milliseconds (1001/24000).
This worked for me:
Code:ffmpeg -fflags +genpts -i "854x480.ts" -vcodec copy -acodec copy -movflags faststart "854x480.mp4"
Code:ffprobe -v 32 -stats -y -hide_banner -i "854x480.mp4" -select_streams v -print_format csv -of csv -show_entries frame >> "854x480.csv"
-
When I download and play your above attached file (854x480.ffmpeg.mp4) the video plays fine. When I use your above ffmpeg script,
Code:ffmpeg -fflags +genpts -i "854x480.ts" -vcodec copy -acodec copy -movflags faststart "854x480.mp4"
I'll see if there is a newer ffmpeg and try again.
EDIT: what version of ffmpeg are you using?Last edited by jimdagys; 8th Jan 2021 at 11:57.
-
I was using 4.3.1, 64 bit, built 9/11/2020. I just checked again, pasting the command line from post #3 into a CLI window. The resulting video worked fine.
Code:C:\Users\User\Desktop>ffmpeg -fflags +genpts -i "854x480.ts" -vcodec copy -acodec copy -movflags faststart "854x480.mp4" ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 10.2.1 (GCC) 20200726 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf 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 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '854x480.ts': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 Duration: 00:02:54.89, start: 0.000000, bitrate: 1557 kb/s Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 1489 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 61 kb/s (default) Metadata: handler_name : SoundHandler Output #0, mp4, to '854x480.mp4': Metadata: major_brand : isom minor_version : 1 compatible_brands: isomavc1 encoder : Lavf58.45.100 Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1:1 DAR 427:240], q=2-31, 1489 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 90k tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 61 kb/s (default) Metadata: handler_name : SoundHandler Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help [mp4 @ 0000011353ed9040] Starting second pass: moving the moov atom to the beginning of the file frame= 4190 fps=0.0 q=-1.0 Lsize= 33234kB time=00:02:54.78 bitrate=1557.6kbits/s speed=1.86e+03x video:31788kB audio:1311kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.407524%
-
I just remuxed the ts file to mp4 with clever FFmpeg-GUI and the mp4 file works fine without any sync problems.
-
OK, I updated the ffmpeg from 4.2.1 to 4.3.1 (the latest version) and again using Jagabo code:
Code:ffmpeg -fflags +genpts -i "854x480.ts" -vcodec copy -acodec copy -movflags faststart "854x480.mp4"
I also was able to use this simple script (where input.ts is the input file) and it worked perfectly to convert to mp4:
Code:ffmpeg -i input.ts -c copy output.mp4
I'll contact Mr Tubedigger and see if he needs to update his convert tool.
Similar Threads
-
Tool to split and join AC-3 losslessly?
By orlydb in forum AudioReplies: 5Last Post: 16th May 2020, 07:31 -
Losslessly exporting frames from a .VOB - am I doing it right?
By bentley in forum Video ConversionReplies: 23Last Post: 25th Mar 2020, 10:35 -
Losslessly Convert 2.0 to 5.1
By koberulz in forum Newbie / General discussionsReplies: 3Last Post: 5th Sep 2019, 11:05 -
Cut/Copy .mp4 video losslessly to .ts container
By Rajesh Singh in forum EditingReplies: 2Last Post: 30th Aug 2017, 14:18 -
converting vbr mp4 file to cbr mp4
By brandcc in forum Video ConversionReplies: 13Last Post: 19th Jun 2017, 08:43