Skip to content

Instantly share code, notes, and snippets.

@dericed
Created August 8, 2012 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dericed/3291131 to your computer and use it in GitHub Desktop.
Save dericed/3291131 to your computer and use it in GitHub Desktop.
test ffv1 version 1 and 3 against test files (available at http://media.xiph.org/video/derf/y4m/)
#!/bin/bash
for test_file in bridge_far_cif.y4m bridge_close_cif.y4m foreman_cif.y4m bowing_cif.y4m akiyo_cif.y4m stefan_sif.y4m stefan_sif_mono.y4m foreman_qcif.y4m foreman_qcif_mono.y4m ; do
# make framemd5 file of random data
ffmpeg -y -report -i "$test_file" -f framemd5 "${test_file}.md5" 2> /dev/null
# encode random data to ffv1 version 1
ffmpeg -y -report -i "$test_file" -c:v ffv1 "${test_file%.*}_ffv1_v1.mov" 2> /dev/null
# encode random data to ffv1 version 3
ffmpeg -y -report -i "$test_file" -c:v ffv1 -level 3 -strict experimental "${test_file%.*}_ffv1_v3.mov" 2> /dev/null
# generate framemd5 from encoded ffv1
ffmpeg -y -report -i "${test_file%.*}_ffv1_v1.mov" -f framemd5 "${test_file%.*}_ffv1_v1.md5" 2> /dev/null
ffmpeg -y -report -i "${test_file%.*}_ffv1_v3.mov" -f framemd5 "${test_file%.*}_ffv1_v3.md5" 2> /dev/null
if [ $(md5 -q "${test_file}.md5") == $(md5 -q "${test_file%.*}_ffv1_v1.md5") ] ; then
echo "$test_file" to "${test_file%.*}_ffv1_v1.mov" is lossless
else
echo "$test_file" to "${test_file%.*}_ffv1_v1.mov" is lossy
fi
if [ $(md5 -q "${test_file}.md5") == $(md5 -q "${test_file%.*}_ffv1_v3.md5") ] ; then
echo "$test_file" to "${test_file%.*}_ffv1_v3.mov" is lossless
else
echo "$test_file" to "${test_file%.*}_ffv1_v3.mov" is lossy
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment