Saturday, October 5, 2013

Use Nautilus actions to extract audio from video and more

Better than trying to add context menu commands to the minimalist Pantheon-Files of Elementary OS or to use other media applications to extract sound from video, I guess the most simple is just to install Nautilus (it is not at all problematic in eOS, contrary to Thunar, which comes with the whole Xfce environment).

 sudo apt-get install nautilus
also

 sudo apt-get install parallel


Then install Nautilus-Actions Configuration Tool and open it..

I will provide an example for extracting audio (aac in m4a container) from flv and mp4 video files.

Define a new action, give it a name, maybe an icon too. Check - 'Display action in selection context menu'.

 Use Context label: Extract as m4a






Under the command tab, add the command (the one that I use in Thunar - see the links in the question):

Path:
gnome-terminal
Parameeters:
 -e "parallel avconv -i '{}' -map 0:1 -c:a copy '{}.m4a' ::: %F"



Under Execution tab there are options to select depending on what you wan to see during and after the action (open terminal, report).

Under Basenames tab, enter the filters for the type of files in the context menu of which you want to see the command - in this case: *.flv and *.mp4.




There are other options, but these look sufficient for the purpose of my question.



Similar actions can be added to extract sound from other types of video and, of course for other very different purposes.

NOTE:
In fact the use of parallel is not necessary to select multiple files and process them:

avconv -i '{}' -map 0:1 -c:a copy '{}.m4a


will have the same result

Parallel has the theoretical advantage of processing one-by-one the selected file or to set the number of parallel processes.

No comments:

Post a Comment