FFmpeg does not stop automatically (Solved)

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
achim
Posts: 48
Joined: Thu 13 Apr 2017, 19:36
Location: Germany

FFmpeg does not stop automatically (Solved)

#1 Post by achim »

Hello everybody,

I've built a bash script with linux YAD in which there are several ways to handle video or audio files with FFmpeg. The command

Code: Select all

ffmpeg -i "$filename" -vn -ar 44100 -ac 2 -ab 320k "$basePath".mp3
does the work, but FFmpeg does not stop. Here I always have to help with ctrl+c. Does anyone know a better solution?

achim

phat7
Posts: 179
Joined: Fri 05 Jun 2015, 08:54

#2 Post by phat7 »

No problems here. Could be a problem with your audio/video source material?

achim
Posts: 48
Joined: Thu 13 Apr 2017, 19:36
Location: Germany

#3 Post by achim »

phat7 wrote:No problems here. Could be a problem with your audio/video source material?
No, when I enter the command at the command level, everything works

phat7
Posts: 179
Joined: Fri 05 Jun 2015, 08:54

#4 Post by phat7 »

Then where is the problem? All you gave us is a command that you said doesn't work. Now it does. If you don't run it from the command line then how can you stop it with ctrl+c?

achim
Posts: 48
Joined: Thu 13 Apr 2017, 19:36
Location: Germany

#5 Post by achim »

phat7 wrote:Then where is the problem? All you gave us is a command that you said doesn't work. Now it does. If you don't run it from the command line then how can you stop it with ctrl+c?
I work with Linux Mint 18.3 Cinnamon. File Manager Nemo has a terminal window where I can watch the progress of starting the YAD script. In this window I have to quit FFmpeg with Ctrl-c. Without a script (ie via a terminal), the command works without errors. But I would like to work with the YAD script. By the way, FFmpeg gives another message: WARNING: library configuration mismatch. FFmpeg is up to date, maybe a bug?

achim

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#6 Post by Flash »

Achim, if you're using Linux Mint then you should post this in the Linux Mint forum. This forum is for Puppy Linux users.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#7 Post by fredx181 »

achim wrote:I work with Linux Mint 18.3 Cinnamon. File Manager Nemo has a terminal window where I can watch the progress of starting the YAD script. In this window I have to quit FFmpeg with Ctrl-c. Without a script (ie via a terminal), the command works without errors. But I would like to work with the YAD script.
How you start the script ? If you click on it, Nemo gives choice to run in Terminal.
Another way is to open a terminal in the directory where your script is located and (say it's named "ffsplit"):

Code: Select all

./ffsplit
I've tried both ways on Cinnamon and works OK for me (ffmpeg stops when done)
Btw, how do you mean that ffmpeg won't stop, is the converting finished but doesn't go to the terminal prompt, or... ?
Maybe best to show your script.

Fred

achim
Posts: 48
Joined: Thu 13 Apr 2017, 19:36
Location: Germany

#8 Post by achim »

Hello Fred,
The script is located in the folder / usr / local / bin and can be started from anywhere with "ffsplitt".
Your second question - it's like you're writing: the conversion is complete and the cursor blinks, but does not go to the command prompt.
achim

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Re: FFmpeg does not stop automatically

#9 Post by musher0 »

achim wrote:Hello everybody,

I've built a bash script with linux YAD in which there are several ways to handle video or audio files with FFmpeg. The command

Code: Select all

ffmpeg -i "$filename" -vn -ar 44100 -ac 2 -ab 320k "$basePath".mp3
does the work, but FFmpeg does not stop. Here I always have to help with ctrl+c. Does anyone know a better solution?

achim
Hello achim.

You have to add the -autoexit parameter at the end. Something like this:

Code: Select all

ParmS="loglevel info -window_title ${TitrE}" 
ffplay -$ParmS -hide_banner -x "$X" -y "$Y" "$B" -autoexit
Even if my example uses ffplay, which BTW you should, I think, if you are
using the ffmpeg package for playing media, and not for converting or
processing them.

IHTH.

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

achim
Posts: 48
Joined: Thu 13 Apr 2017, 19:36
Location: Germany

Re: FFmpeg does not stop automatically

#10 Post by achim »

Hi musher0,

Thank you for your suggestion. With the command "ffmpeg -i ..." I want to extract mp3 from mp4.
Unfortunately, he does not bring the desired result:

Code: Select all

ffmpeg -i "$filename" -vn -ar 44100 -ac 2 -ab 320k "$basePath".mp3 -autoexit
Unrecognized option 'autoexit'.
Error splitting the argument list: Option not found 
achim

achim
Posts: 48
Joined: Thu 13 Apr 2017, 19:36
Location: Germany

Re: FFmpeg does not stop automatically

#11 Post by achim »

Hello everybody,

I found this solution for me:

Code: Select all

ffmpeg -i "$ filename" -vn -ar 44100 -ac 2 -ab 320k "$ basePath" .mp3
sleep 2
xdotool key "Return" 
It works and thanks for the support.

achim

Post Reply