Advertisement
dericed

Untitled

Dec 13th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. #!/bin/sh
  2. file="$1"
  3. filename=`basename "$file"`
  4. dirname=`dirname "$file"`
  5.  
  6. is2yuv=`ffprobe 2>/dev/null -i "$file" -show_streams | grep 2vuy | wc -l | sed 's/ //g'`
  7. echo is "$is2yuv"
  8. if [[ "$is2yuv" -eq 0 ]] ; then
  9. echo "$filename is not 2vuy, quitting"
  10. exit 1
  11. else
  12. echo "$filename is 2vuy, starting encode"
  13. export FFREPORT="file=${dirname}/%p_%t_convert-to-ffv1.log"
  14. ffmpeg -report -vsync 0 -i "$file" -map 0:v -map 0:a -c:v ffv1 -g 1 -c:a copy "${file%.*}_ffv1.mov" -f framemd5 -an "${file%.*}.framemd5"
  15. ffmpeg_ffv1_err="$?"
  16. [ "$ffmpeg_ffv1_err" -gt 0 ] && echo ffmpeg ended with error && exit 1
  17. ffmpeg -i "${file%.*}_ffv1.mov" -f framemd5 -pix_fmt uyvy422 -an "${file%.*}_ffv1.framemd5"
  18. ffmpeg_md5_err="$?"
  19. [ "$ffmpeg_md5_err" -gt 0 ] && echo ffmpeg md5 ended with error && exit 1
  20. muxmovie "$file" -track "Timecode Track" -track "Closed Caption Track" -self-contained -o "${file%.*}_tc_e608.mov"
  21. muxmovie_err="$?"
  22. [ "$muxmovie_err" -gt 0 ] && echo muxmovie ended with error && exit 1
  23. if [ `md5 -q /Volumes/Data/archive_projects/analog_capture/City\ Talk/CTTLK043/objects/trimmed_materials/SXS00198_pre_ffv1.framemd5` = `md5 -q /Volumes/Data/archive_projects/analog_capture/City\ Talk/CTTLK043/objects/trimmed_materials/SXS00198_pre.framemd5` ] ; then
  24. echo Everything looks safe. Going to delete the original.
  25. mediainfo -f --language=raw --output=XML "$file" > "${file%.*}_mediainfo.xml"
  26. rm -f -v "$file"
  27. else
  28. echo Not looking safe. Going to keep the original.
  29. fi
  30. echo done with "$file"
  31. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement