Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-05-27 23:44:25

fixit
Member
Registered: 2015-01-19
Posts: 52

Custom action to convert webm to mp4

This is the command to convert a .webm to a mp4.

ffmpeg -i 2018-07-28-222352.webm -qscale 0 sample.mp4

This is the thunar custom action I came up with, but it is not working.

ffmpeg -i %f.webm -qscale 0 %f.mp4

Can someone please help me?

Thanks.

Last edited by fixit (2020-05-27 23:44:49)

Offline

#2 2020-05-28 00:47:04

eriefisher
Member
From: ON, Canada
Registered: 2008-10-25
Posts: 218

Re: Custom action to convert webm to mp4

Are you using that line in the action? You may want to create a script and call it with the action.


Siduction
Debian Sid
Xfce 4.14

Offline

#3 2020-05-28 00:57:19

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,708

Re: Custom action to convert webm to mp4

fixit wrote:

ffmpeg -i %f.webm -qscale 0 %f.mp4

%f is the full path and filename - meaning you don't add the extension. So:

ffmpeg -i %f -qscale 0 %f.mp4

Offline

#4 2020-05-28 07:10:05

alcornoqui
Member
Registered: 2014-07-28
Posts: 663

Re: Custom action to convert webm to mp4

I have some of those Custom Actions, but I prefer to see the output in a terminal, so the commands are of the type:

xfce4-terminal -x ffmpeg -i %f [options] %f.ext

Offline

#5 2020-05-28 15:09:16

fixit
Member
Registered: 2015-01-19
Posts: 52

Re: Custom action to convert webm to mp4

ToZ wrote:
fixit wrote:

ffmpeg -i %f.webm -qscale 0 %f.mp4

%f is the full path and filename - meaning you don't add the extension. So:

ffmpeg -i %f -qscale 0 %f.mp4

Thanks.

It worked and produced this.

test.webm.mp4

Is there a way to get it to omit the webm in the filename?

Offline

#6 2020-05-28 15:16:54

fixit
Member
Registered: 2015-01-19
Posts: 52

Re: Custom action to convert webm to mp4

eriefisher wrote:

Are you using that line in the action? You may want to create a script and call it with the action.

I used it in the command.

Offline

#7 2020-05-28 15:18:11

fixit
Member
Registered: 2015-01-19
Posts: 52

Re: Custom action to convert webm to mp4

alcornoqui wrote:

I have some of those Custom Actions, but I prefer to see the output in a terminal, so the commands are of the type:

xfce4-terminal -x ffmpeg -i %f [options] %f.ext

I used the Mate Terminal.

Offline

#8 2020-05-28 18:06:24

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,708

Re: Custom action to convert webm to mp4

fixit wrote:
ToZ wrote:
fixit wrote:

ffmpeg -i %f.webm -qscale 0 %f.mp4

%f is the full path and filename - meaning you don't add the extension. So:

ffmpeg -i %f -qscale 0 %f.mp4

Thanks.

It worked and produced this.

test.webm.mp4

Is there a way to get it to omit the webm in the filename?

Using @eriefischer's suggestion, it is best to create a script for this with the following content (Xfce's built-in interpreter can't handle special characters):

#!/bin/bash
ffmpeg -i "$1" -qscale 0 "${1%.*}.mp4"

...and make the script executable.

Then in the custom action command:

xfce4-terminal -x /path/to/script %f

Feel free to use mate-terminal but make sure the "-x" parameter is the same.

Offline

#9 2020-05-29 05:46:51

fixit
Member
Registered: 2015-01-19
Posts: 52

Re: Custom action to convert webm to mp4

Thanks ToZ, it worked like a champ. :-)

It's neat that I can see what the terminal is doing while it is converting the file.

Offline

Board footer

Powered by FluxBB