LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   FFmpeg so slow after updating (https://www.linuxquestions.org/questions/slackware-14/ffmpeg-so-slow-after-updating-4175439650/)

ponce 12-03-2012 10:31 AM

ffmpeg-0.11.x works fine here: as 414N told you, the syntax has changed (also in 1.0), acodec is deprecated in favour of c:a (or codec:a), but there are lot of other changes (that make every maintainer of something that uses it very happy -not :( ).

be aware that if you upgrade to 1.0, most of the things available on slackbuilds.org depending on it won't build/run.

michijo 12-03-2012 04:00 PM

Quote:

Originally Posted by ponce (Post 4841822)
ffmpeg-0.11.x works fine here: as 414N told you, the syntax has changed (also in 1.0), acodec is deprecated in favour of c:a (or codec:a), but there are lot of other changes (that make every maintainer of something that uses it very happy -not :( ).

be aware that if you upgrade to 1.0, most of the things available on slackbuilds.org depending on it won't build/run.

I upgraded to it, and so far there are no problems. Also, on 1.0 the acodec command still works fine, though it didnt work at all in 0.11! I use music-on-console to play mp3s, and it has no problems, so basically I am happy with 1.0. I am just an end-user and am not sure even how to really find or decipher changelogs to know that acodec was deprecated. I mean, I can find the changelog and locate the part where it says acodec is deprecated, but its in version version 0.9 that it was deprecated.

https://raw.github.com/FFmpeg/FFmpeg/master/Changelog


Also, I was thinking of a universal command using wildcards, and wonder if there is a special character to do the following:


# ffmpeg -i *.flv -acodec copy some-regex-character.mp3

So in place of "some-regex-character", is there a character that would retain the name of the flv file that is automatically called from the wildcard character: * ? So I might run this command, it takes any flv file in the directory and turns it into an mp3 with the actual name of the random flv file that the wildcard chose? I dont really imagine so, but just curious!

schmatzler 12-03-2012 05:51 PM

What also helps:

Code:

ffmpeg -vn -i file.flv output.mp3
Apparently there was a problem with ffmpeg 0.10 which was also mentioned in the dev forums there. Without the vn option it always tried to convert the videostream too which caused a lot of cpu power.

It's fixed in 0.11.

Martinus2u 12-04-2012 02:42 PM

Quote:

Originally Posted by michijo (Post 4842019)
Also, I was thinking of a universal command using wildcards, and wonder if there is a special character to do the following:


# ffmpeg -i *.flv -acodec copy some-regex-character.mp3

So in place of "some-regex-character", is there a character that would retain the name of the flv file that is automatically called from the wildcard character: * ? So I might run this command, it takes any flv file in the directory and turns it into an mp3 with the actual name of the random flv file that the wildcard chose? I dont really imagine so, but just curious!

that might be something like

Code:

for file in *.flv ; do echo $file ${file%.flv}.mp3 ; done
I do something similar in my m4a2ogg script, which additionally preserves metadata like artist, genre etc.

414N 12-04-2012 02:51 PM

Quote:

Originally Posted by Martinus2u (Post 4842754)
Code:

for file in *.flv ; do echo $file ${file%.txz}.mp3 ; done

Maybe you meant ${file%.flv}

Martinus2u 12-04-2012 03:07 PM

Quote:

Originally Posted by 414N (Post 4842758)
Maybe you meant ${file%.flv}

thx, you're right. i tested the line briefly with txz and overlooked one occurrence after pasting it. lol.

michijo 12-05-2012 12:53 PM

Quote:

Originally Posted by Martinus2u (Post 4842754)
that might be something like

Code:

for file in *.flv ; do echo $file ${file%.flv}.mp3 ; done
I do something similar in my m4a2ogg script, which additionally preserves metadata like artist, genre etc.

Based on your idea I wrote this script:

Code:

#!/bin/bash

for file in *.flv ; do mp3=${file%.flv}.mp3 ; done

ffmpeg -i *.flv -c:a copy $mp3

This automatically produces a correctly named mp3, though if there are more than one flv files, then it attempts to overwrite one flv with another.

Martinus2u 12-05-2012 01:59 PM

Quote:

Originally Posted by michijo (Post 4843364)
Based on your idea I wrote this script:

Code:

#!/bin/bash

for file in *.flv ; do mp3=${file%.flv}.mp3 ; done

ffmpeg -i *.flv -c:a copy $mp3

This automatically produces a correctly named mp3, though if there are more than one flv files, then it attempts to overwrite one flv with another.

Hardly surprising. I recommend reading about wildcard expansion plus any programming tutorial about loops. or man bash.

this should work (not tested):

Code:

#!/bin/bash

for file in *.flv ; do ffmpeg -i $file -c:a copy ${file%.flv}.mp3 ; done


michijo 12-05-2012 03:30 PM

Quote:

Originally Posted by Martinus2u (Post 4843398)
Hardly surprising. I recommend reading about wildcard expansion plus any programming tutorial about loops. or man bash.

this should work (not tested):

Code:

#!/bin/bash

for file in *.flv ; do ffmpeg -i $file -c:a copy ${file%.flv}.mp3 ; done


This little line works very good and rapidly on multiple flv files. thanks.

Ive been thinking to learn Haskell more, since I use Xmonad.

michijo 06-05-2013 07:31 PM

Update:

This script ceased to work after working good for some months. I am not sure why it no longer works. It merely stopped one day. I tried updating my system afterwards but it failed to fix it.

I just looked at the changelog for FFmpeg and didnt see anything strange. I thought maybe "-c:a copy" was now deprecated. Before it was "-acodec copy" deprecated.

414N 06-06-2013 02:15 PM

Just try the same ffmpeg options on an flv file manually: you should see if there's any issue.

michijo 06-08-2013 12:54 PM

Quote:

Originally Posted by 414N (Post 4966772)
Just try the same ffmpeg options on an flv file manually: you should see if there's any issue.

That doesnt work either, but I did find something out. It says FFMPEG is deprecated itself now! So I was right about something being deprecated. Supposedly it is being replaced with AVCONF, another program. I dont know why they are calling it Ubuntu Video Converter though. I dont think FFMPEG or AVCONF is Ubuntu specific.

http://linuxheadline.com/lets-know-u...converter.html

andrew.46 06-08-2013 05:12 PM

Quote:

Originally Posted by michijo (Post 4967876)
That doesnt work either, but I did find something out. It says FFMPEG is deprecated itself now! So I was right about something being deprecated. Supposedly it is being replaced with AVCONF, another program.

You have seen a rather malicious message put in place by the avconv developers...

414N 06-09-2013 03:40 AM

avconv is an ffmpeg fork started because of diverging opinions between ffmpeg developers.
Your distro has probably replaced the "pure" ffmpeg package with the avconv one, which provides an ffmpeg executable too (running avconv under the hood, if I'm not mistaken).
This, however, is not a valid reason for the conversion not happening. What is the error printed out by your ffmpeg/avconv?

michijo 06-11-2013 11:05 AM

Quote:

Originally Posted by 414N (Post 4968138)
avconv is an ffmpeg fork started because of diverging opinions between ffmpeg developers.
Your distro has probably replaced the "pure" ffmpeg package with the avconv one, which provides an ffmpeg executable too (running avconv under the hood, if I'm not mistaken).
This, however, is not a valid reason for the conversion not happening. What is the error printed out by your ffmpeg/avconv?

"-c:a copy" no longer seems to work as an option. The exact error is:

"Could not write header for output file #0 (incorrect codec parameters ?)"

I have not changed anything in the way I used it, and it worked before. Another error it now shows is:

"Invalid audio stream. Exactly one MP3 audio stream is required".

I have tried this for instance:

"ffmpeg -i the-Wolfgang-Press-A-Question-of-Time.flv -c:a copy the-Wolfgang-Press-A-Question-of-Time.mp3"

It fails. I also tried running this from a terminal:

for file in *.flv ; do ffmpeg -i $file -c:a copy ${file%.flv}.mp3 ; done

This used to work, but now produces errors regarding codecs.

"Stream mapping:
Stream #0:0 -> #0:0 (h264 -> png)
Stream #0:1 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?)"


All times are GMT -5. The time now is 04:59 PM.