FFMPEG - Convert WebM (or other) to X264



Published: 2018-07-29 08:23:24 +0000
Categories: BASH,

Language

BASH

Description

There are a lot of video codecs out there, and some of them are far, far more efficient than H.264. But, as efficient as HEVC or WebM might be, they're frustrating to stumble across if your playback device is a Raspberry pi which has neither the hardware support, nor the processing capabilities required to deal with those codecs without stuttering

It is, however, incredibly simple to convert to X264 with ffmpeg, the below snippet creates a utility script to do so by just passing in the input filename and the destination file to create

Snippet

#!/bin/bash
#
# Swap something to X264 with AAC audio

IN=$1
OUT=$2

if [ "$1" == "" ] || [ "$2" == "" ]
then
    echo "$0 [in file] [out file]"
    exit 1
fi

ffmpeg -i "$IN" -c:v libx264 -codec:a aac -strict -2 "$OUT"

Usage Example

to_x264.sh foo_bar.webm foo_bar.mp4

Requires

Keywords

ffmpeg, x264, transcode, webm, ogg, vorbis, hevc, mkv, mp4,

Latest Posts


Copyright © 2022 Ben Tasker | Sitemap | Privacy Policy
Available at snippets.bentasker.co.uk, http://phecoopwm6x7azx26ctuqcp6673bbqkrqfeoiz2wwk36sady5tqbdpqd.onion and http://snippets.bentasker.i2p
hit counter