Skip to content

Tip of the day: ffmpeg and bashrc

January 4, 2010

Travelling back to Geneva tomorrow, so I wanted to put some videos on my psp or mp3-player (Sony as well, I have to stop buying so many products from the same brand!). I do not know if I am just stupid, but every time I get back to ffmpeg it is equally confusing. I mean, I understand you should sort of specify the codecs, bitrate and so forth, but why some things work while other almost identical doesn’t, is beyond me.

Anyway, after some digging I came up with the following command which worked with my install:

ffmpeg -y -i inputfilename.avi -b 576k -s 320x240 -vcodec mpeg4 -ab 192k -ar 44100 -ac 2 -acodec libfaac outputfilename.mp4

Now in order to remember this for next time I can write it in a file (or blog about it 😉 ). However, I wanted to point you to a sort of “tip of the day”, namely to put the following line into ~/.bashrc:

avi2psp () { ffmpeg -y -i $1 -b 576k -s 320x240 -vcodec mpeg4 -ab 192k -ar 44100 -ac 2 -acodec libfaac $2; }

Now I can just write `avi2psp inputfilename.avi outputfilename.mp4` in the terminal and ffmpeg will run with the said settings. Almost like making your own program in 5 seconds, cute right? 🙂

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: