Posts Tagged ‘video’

Remux .m4v (and probably others) to .mkv

January 19, 2012 2 comments


ffmpeg|avconv -i input.m4v -vcodec copy -acodec copy out.mkv

So easy this post is actually done here.

Categories: linux Tags: ,

Use ffmpeg to merge multiple avi files

October 25, 2011 Leave a comment
cat avi1.avi avi2.avi avix.avi > avi_all.avi
ffmpeg -i avi_all.avi -acodec copy -vcodec copy avi_all_reindexed.avi
Categories: unix Tags: ,

Split a video file on the command line

October 13, 2011 Leave a comment

Since it’s so insanely useful and installing/using the common graphical video editors is pretty much a pita:

ffmpeg -ss 00:15:00.0 -t 00:10:0.0 -i <source>.foo -vcodec copy -acodec copy <destination>.foo

Above command clips everything to the 15 minute mark, puts the following 10 minutes into the destination file and then clips everything after that.
If you leave out the -t parameter, everything from the -ss mark to the end gets copied to the destination file. Useful and fast.

Categories: unix Tags: , ,

Merge subtitles into a Matroska container on the command line

October 11, 2011 2 comments

Actually pretty darn easy – surely faster than using the GUI.

mkvmerge -o <output>.mkv --default-track 0 --language 0:<language> <subtitles>.srt <input>

You can list the language codes by invoking mkvmerge with the --list-languages (e.g. eng for English, ger for German) parameter. The --default-track parameter just sets the newly muxed subtitles as default for the player to use. If you are muxing multiple subtitles, you of course have to change the language code preceding number.

Categories: unix Tags: , ,

Fullscreen Flash Videos not playing in Ubuntu/Fedora/Debian/Chrome/Firefox/insert-whatever-here when Compiz Fusion Effects are enabled

November 1, 2010 6 comments

If the headline seems familiar to you… try this:

sudo mkdir -p /etc/adobe
sudo echo "OverrideGPUValidation=1" > /etc/adobe/mms.cfg

and restart any open browsers for it to take effect.

Adobe blacklists anything with SGI as GLX vendor string for GPU acceleration. Intel cards/drivers report this though. In combination with Compiz desktop effects = bad. So using above snippet fixed any fullscreen issues on my Lenovo Thinkpad T500 with Mobile 4 Series Chipset.

Categories: fedora, gentoo, linux, rants, ubuntu, unix Tags: , ,

DeMuxing and ReMuxing M2TS/MP4/FLV to MKV under –insert-your-preferred-unixoid-os-here–

March 17, 2010 8 comments

Sometimes I get some video files in mp4, flv or even m2ts containers. Since I am a big, big fan of the mkv container format, I usually remux those files. When I first tried to find a solution for this using Linux, Google spit out everything and the kitchen sink, but not the most obvious choices: use ffmpeg or mplayer.

To demux with ffmpeg:

ffmpeg -i input.{mp4,flv,m2ts} -vcodec copy out.{h264,m2v} -acodec copy out.{aac,mp3}

AFAIK mplayer involves two steps to demux video and audio separately:

mplayer -dumpvideo -dumpfile out.{h264,m2v} input.{mp4,flv,m2ts}
mplayer -dumpaudio -dumpfile out.{aac,mp3} input.{mp4,flv,m2ts}

There are probably a gazillion ways more (mencoder comes to mind) to achieve the demuxed material and if the input files contain more than one video and one audio stream, you might have to – personally I never was in such a scenario – dig up ffmpeg’s manual about stream selection. Which actually is pretty easy to do.

Once you got your streams demuxed, use the most excellent mkvtoolnix suite to remux them into a mkv container (note: mmg is your friend here). As you will be most likely adding elementary streams, mkvmerge won’t be able to automatically determine the correct fps. Just manually enter them, ffmpeg or mplayer should have spit them out in the demuxing process. Here you can also add subtitles and w/e your heart desires into the container.

out.{h264,m2v} input.{mp4,flv,m2ts}
Categories: linux, unix Tags: , , ,
%d bloggers like this: