Skip to content

Instantly share code, notes, and snippets.

@willnode
Created April 22, 2018 21:55
Show Gist options
  • Select an option

  • Save willnode/79d9e1eede2a43cce9544e4e37874c21 to your computer and use it in GitHub Desktop.

Select an option

Save willnode/79d9e1eede2a43cce9544e4e37874c21 to your computer and use it in GitHub Desktop.
Useful FFMPEG converters in batch
:: for mp4 the recommended video and audio codec is h264 and aac. You may opt out that though.
:: if you really want to save this as batch, replace % with %%.
:: convert *.avi to *.mp4
ffmpeg -i "%f" "%~nf.mp4" -acodec aac -vcodec h264
:: convert all *.avi to *.mp4
for %f in (*.avi) do (ffmpeg -i "%f" "%~nf.mp4" -acodec aac -vcodec h264)
:: merge all *.avi to single *.mp4
echo nul > list.txt
for %f in (*.avi) do (echo file '%f' >> list.txt)
ffmpeg -safe 0 -f concat -i list.txt -c copy "result.mp4" -acodec aac -vcodec h264
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment