ffmpeg conversion for Chromecast

From Wikistix
Jump to navigation Jump to search

On an old Google Chromecast 1, I've found the following to produce playable content:

ffmpeg4 -i input.mp4 -preset fast -c:a aac -b:a 192k -ac 2 -c:v libx264 -b:v 1024k -profile:v high -level 4.1 -crf 17 -pix_fmt yuv420p output.mp4

More complex transcoding is possible. Eg. With an input where the video is fine, but the audio stream is aac 5.1 and refuses to play, we can copy the video stream, and map the audio stream twice, keeping the aac 5.1 stream and adding a second 192kb/s aac stereo stream. Eg.

ffmpeg4 -i input.mp4 -map 0:v:0 -c:v copy -map 0:a:0 -map 0:a:0 -c:a:0 aac -ac:a:0 2 -b:a:0 192k -c:a:1 copy output.mp4

Notes[edit]

  • aac 5.1 audio doesn't seem to work.

See also[edit]


Misinformation found herein copyright Paul Ripke (aka “stix”) stixpjr@gmail.com.