FFMPEG - Convert WebM (or other) to X264

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




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


# Swap something to X264 with AAC audio


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

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

Usage Example

to_x264.sh foo_bar.webm foo_bar.mp4



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

Latest Posts

Urldecode string (LUA)
FFMPEG Convert YUV444p to YUV420p (BASH)
Forcing FFMPEG to honour segment length in HLS Stream Creator (BASH)
Force CURL to place request to a specific IP (BASH)
Set a variable only if it is undefined (Javascript)
Ignore query string with Nginx caching proxy (NGinx)
Get breakdown of UK and non-UK votes for a Parliamentary Petition (Python)
Decompress Mozilla Firefox jsonlz4 bookmark backup files (Python)
Setting Git author details for a single repo (Git)
Checking Virtual Machine Resource Allocations with Libvirt (BASH)

Copyright © 2019 Ben Tasker | Sitemap | Privacy Policy
Available at snippets.bentasker.co.uk and snippets.6zdgh5a5e6zpchdz.onion