[FFmpeg-user] Converting numerous files to h264

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Nov 10 11:32:01 CET 2012

neoculture23 <neoculture23 <at> gmail.com> writes:

> ffmpeg -i old_file.<ext> -c:a copy -c:s copy -c:d copy 
> -c:t copy -c:v libx264 -preset slower old_file.mkv

Completely apart from the fact that this is missing a bitrate 
and -map 0 (or similar to ensure all tracks are copied and 
not just one of each kind):
I fear that what you want will not work in the general case 
because not all codecs are supported in all containers.
(I mean specification-wise, additionally FFmpeg is not bug- 
free and you will find that for example stream copy from 
h264-in-mpegts to matroska will sometimes not work.)

Not knowing your exact use case I would recommend that you 
keep the files as they are, if you have a particular "broken" 
one (one that is in a container you typically cannot play or 
don't like) remux it manually to make sure it works as 

Carl Eugen

More information about the ffmpeg-user mailing list