Skip to content

Instantly share code, notes, and snippets.

@strezh
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save strezh/c8e2ea486e50e7eb49ac to your computer and use it in GitHub Desktop.

Select an option

Save strezh/c8e2ea486e50e7eb49ac to your computer and use it in GitHub Desktop.
convert input y4m file to 3 different YUV formats - YUV420, YUV422, YUV444
#!/bin/bash
if [[ $#>0 ]]
then
INPUT_FILE_NAME=$1
else
exit
fi
FILE_NAME=`sed 's/\.y4m$//' <<< ${INPUT_FILE_NAME}`
YUV420FILE=${FILE_NAME}_420.yuv
YUV422FILE=${FILE_NAME}_422.yuv
YUV444FILE=${FILE_NAME}_444.yuv
avconv -i ${INPUT_FILE_NAME} -pix_fmt yuv420p ${YUV420FILE}
avconv -i ${INPUT_FILE_NAME} -pix_fmt yuv422p ${YUV422FILE}
avconv -i ${INPUT_FILE_NAME} -pix_fmt yuv444p ${YUV444FILE}
# play results
#SIZE="1920x1080"
#avplay -video_size ${SIZE} -pixel_format yuv420p ${YUV420FILE}
#avplay -video_size ${SIZE} -pixel_format yuv422p ${YUV422FILE}
#avplay -video_size ${SIZE} -pixel_format yuv444p ${YUV444FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment