So I noticed that after using mkvtoolnix on the .m2ts file, the .mkv output was a bit smaller. I took a closer look at them with mediainfo and saw that the video streaming size got smaller.
[Attachment 54598 - Click to enlarge]
[Attachment 54599 - Click to enlarge]
From what I read on another thread, this could be because of MKVToolNix removing empty filler NALUs. But I also read that by demuxing the video stream from both the .m2ts and .mkv file with something like tsMuxeR, I could compare the two and see that it's the same data/size, but it wasn't the case.
.m2ts tsMuxeR demux output:
[Attachment 54600 - Click to enlarge]
.mkv tsMuxeR demux output:
[Attachment 54601 - Click to enlarge]
Size comparison:
[Attachment 54602 - Click to enlarge]
I also tried to check the video integrity of the .mkv file with ffmpeg: ffmpeg -v error -i 00005.mkv -f null - 2>00005mkv.log
but what I got was this:
[Attachment 54603 - Click to enlarge]
even tho while doing the same integrity check on the .m2ts file: ffmpeg -v error -i 00005.m2ts -f null - 2>00005m2ts.log
did not result in ffmpeg giving me any kind of error.
I would love to hear some opinions on what might be going on here since I'm kinda lost and did not find anything on other threads that could enlighten me, either.
+ Reply to Thread
Results 1 to 5 of 5
-
Last edited by RaresCelTare; 23rd Aug 2020 at 16:37.
-
Not sure about the audio warning that ffmpeg gives - but a change in container and elementary stream size is "normal" and expected when using MKV
mkvmerge removes filler packets, sync bytes, AUD NALs, and strips repeated headers(uses global header instead) and sequence headers. The stripped sequence headers from the elementary bitstream is the main explanation for the small difference when demuxed. This is well documented for AVC, because this causes compatibility problems with AVC BD authoring in strict/professional programs such as Scenarist BD (thus people avoid MKV container when authoring, and always use elementary streams)
The actual video data - the decoded bitstream - will be identical. eg. You can check with PSNR. (If it's not infinity/lossless, then there is a problem.)
Sometimes there are audio "gaps" in the source file, and using eac3to to mux into MKV can fix them. Or sometimes ffmpeg is wrong -
VMAF is no good for this, because it does not necessarily register "lossless" or 100 . There is subjective "fudge factor" in the calculation
PSNR is mathematically ideal and perfect for determining lossless vs. not
You need to "force" the frame rate and time base when using ffmpeg - because ffmpeg uses timestamps to control everything (not frames), and container timebase differences can cause you to measure different frames causing inaccurate results
If you just want to check it to see the total (faster), without printing a per frame log file
Code:ffmpeg -r 24000/1001 -i 1.0005.mkv -r 24000/1001 -i 0005.m2ts -lavfi "[0:v]settb=1/AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=1/AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr" -f null -
-
The PSNR did result in infinity.
[Attachment 54605 - Click to enlarge]
Thank you very much for your help and for being so smart because I would have never been able to make such a command to find what I needed.
Similar Threads
-
Reduced video size after muxing with mkvmerge
By Kontrarian in forum Newbie / General discussionsReplies: 4Last Post: 10th Aug 2019, 15:39 -
Muxing MKVs in MKVToolNix 31.0.0 loses video quality
By safarian24 in forum Newbie / General discussionsReplies: 6Last Post: 3rd Mar 2019, 17:54 -
Need help muxing WEBM/VP9 to MKV (MKVToolNix GUI)
By bitrape in forum Video ConversionReplies: 8Last Post: 11th Aug 2016, 23:38 -
MKVToolNix GUI muxing - problem with chapter
By anhlinhp4 in forum Authoring (Blu-ray)Replies: 3Last Post: 27th Jun 2016, 22:18 -
Reduced video size after muxing with mkvmerge
By sazolis in forum Newbie / General discussionsReplies: 11Last Post: 31st Dec 2015, 14:33