Tuesday, April 30, 2013

Saturday, April 27, 2013

Add convert media command to Thunar Custom actions

To add convert commands to Thunar's custom actions or similar:

sudo apt-get install ffmpeg libavcodec-extra-53

Then, use such commands to add to Thunar custom actions:

ffmpeg -i %f %f.mp3


avconv -i %f %f.mp3 

To see it in a Terminal it should look like:

gnome-terminal --window-with-profile=new1 -e "avconv -i %f %f.mp3" 

(In Gnome Terminal, create a new profile called "new1" and edit it ('Edit/Profiles/Title and Command') to 'When command exits: Hold the Terminal open'.)

But in fact the new profile is not important, only that the terminal would close after the task is finished. Xfce-terminal can also be used in this case.

To convert multiple media files in Thunar, add this:

xfce4-terminal -e "parallel avconv -i '{}' '{}.mp3' ::: %F"

Can be used for converting video or audio files to different formats.

To just extract audio from video, without converting, first find the type of audio. Then use something like this - for flv and mp4, which contain aac audio which is to be contained as m4a:

xfce4-terminal -e "parallel avconv -i '{}' -map 0:1 -c:a copy '{}.m4a' ::: %F"
For webm video (ogg audio):

xfce4-terminal -e "parallel avconv -i '{}' -map 0:1 -c:a copy '{}.ogg' ::: %F".