[FFmpeg-user] ffmpeg mux cause quality loss

Peter B. pb at das-werkstatt.com
Fri Mar 29 06:58:53 CET 2013

On 03/29/2013 12:22 AM, Wu, Mandy wrote:
> Yeah, that is I confused with. Mux should be lossless. I am thinking maybe I am wrong in the way of calculating PSNR. 
> Is there any good PSNR calculation tool and reference? I am using the tool downloaded from http://www2.tkn.tu-berlin.de/research/evalvid/fw.html 
Regardless of how you're calculating the PSNR, you could verify that the
A/V bitstreams were indeed remuxed without any change, by using the
"framemd5" functionality.

# Checksum the source:
$ ffmpeg.exe -i video.h264 -an -f framemd5 video.h264.video.framemd5
$ ffmpeg.exe -i video.h264 -filter_complex "asetnsamples=n=96000" -vn -f framemd5 video.h264.audio.framemd5

# Checksum the output:
$ ffmpeg.exe -i output.mp4 -vcodec copy -an -f framemd5 output.mp4.framemd5
$ ffmpeg.exe -i output.mp4 -filter_complex "asetnsamples=n=96000" -vn -f framemd5 output.mp4.audio.framemd5

You will receive 4 textfiles (*.framemd5) and can then use any diff-tool
of your choice to quickly compare the source-checksums with its
output-checksums to verify if the remux went without changes or loss.


More information about the ffmpeg-user mailing list