How do I transcode/compress mp4 source files on the Linux command line?

1

I have some rather large mp4s produced by my phone. They aren't very long, so they're probably not very compressed. What's an example of using a command line Linux tool to transcode one of these to either h.264 or vp8 or vp9, and how can I play with the quality/compression trade-off?

I know it can be done with vlc. I get lost in the documentation though, and I haven't found clear examples in my web searches.

Travis Well

Posted 2016-01-25T09:21:09.023

Reputation: 145

Answers

2

For example with avconv

avconv -i inputfile.avi -c:v libx264 outputfile.mp4  # to change video coding

avconv -i InFile.avi  -ss 00:12:34 -t 00:02:45.6 -c:v copy -c:a mp3  Out.avi  

With the 1st you change only the video encoding, with the second you change only the audio encoding (and you extract a piece of 2m45.6s starting from 12m34s...).

You need to have installed the encoders library that you want to use.

Hastur

Posted 2016-01-25T09:21:09.023

Reputation: 15 043