I used to create a Thunar custom action as presented here in order to extract audio without transcoding from selected (multiple) video files .

The command to be added in Thunar custom actions list was:

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

now I get only this:

parallel: Warning: Input is read from the terminal. Only experts do this on purpose. Press CTRL-D to exit.

Why is that and how to adapt such commands so that they would work in Thunar custom actions?

  • As i understand, it's just a warning not an error, does it work as it's should?
    – kirill-a
    Jan 21 '15 at 8:43
  • @kirill-a : no, it does not; nothing happens, and the only option seems the CTRL-D to exit terminal
    – user32012
    Jan 21 '15 at 9:09

I am not sure to understand that command. Why do you put -- before the %F?

Try this:

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

Explanation: As I understand the %F is what Thunar replaces by the files, and parallel uses ::: for the input.

One example in the manpage is, precisely

parallel gzip {} ::: file1 file2

To add to Thunar custom action a command like the one from here

for i in *.mp4; do avconv -i "${i}" -map 0:1 -c:a copy "${i%.mp4}.aac"; done

first add that into an executable script, like

#! /bin/sh -e
for i in *.mp4; do avconv -i "${i}" -map 0:1 -c:a copy "${i%.mp4}.m4a"; done

Make it executable and save it.

In Thunar custom actions add a new entry with the command bash /path/to/the/script %F and the following conditions:

enter image description here

This needs separate custom actions for each file type (because it is limited to mp4 to m4a: make changes accordingly for flv to m4a, webm to ogg, avi to mp3 etc) but has the advantage that the output keeps the exact input name (file.mp4 becomes file.m4a), while with the first command does not (file.mp4 becomes file.mp4.m4a).

  • 1
    It is too odd. Try this: in a console, go to a folder with at least two mp4 files and do xfce4-terminal -e "parallel avconv -i '{}' -map 0:1 -c:a copy '{}.m4a' ::: file1.mp4 file2.mp4" (replacing file1 and file2 for the actual files). Does it work? Jan 22 '15 at 15:00
  • my error. i will re-edit everything, your answer is correct
    – user32012
    Jan 23 '15 at 14:07
  • another advantage of the last solution is that it doesn't need parallel to be installed
    – user32012
    Jan 23 '15 at 15:37
  • Great! And thanks for completing my answer ;-) Jan 23 '15 at 17:28

What I use now is this:

bash -c 'ffmpeg -i "$0" -map 0:1 -c:a copy "${0%%.*}".m4a' %f

with setting *.flv;*.mp4 for appearance conditions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy