Convert video to be Chrome playable

Today I tried to get my already h264 encoded video to play in my Chrome browser. Turns out it didn’t play (welcome to the video encoding hell).

Turns out the color space of the Canon video wasn’t much liked by Chrome. I needed to convert the color space:¬†yuvj420p to yuv420p with:

for i in *.mp4
do
test -f "$i" || continue
ffmpeg -i "$i" -pix_fmt yuv420p -sn -vsync vfr -filter:v yadif -c:a libfaac -ab 96k -ac 2 -c:v libx264 -preset slow -crf 23 -threads 4 "${i%%.*}.new.mp4"
MP4Box -inter 500 "${i%%.*}.new.mp4"
done

Thanks to stackoverflow

Leave a Reply

Your email address will not be published. Required fields are marked *