Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I try to conver flv files to ordinary mpg with ffmpeg.
I try many audio options including bitrate, sampling, audio channel,
but the result is no audio at all / silent.
The picture is OK
What is the best software for converting flv movies to mpg?
What is the best parameter for ffmpeg that will work 100%?
There is no 100% solution when it comes to multimedia because there are too many variables to consider. What may work on one file can easily fail on another with only slightly different parameters.
At a first guess, I'd say it's probably a codec problem. You may need to install a separate audio decoder or get/recompile a version of ffmpeg with different codec support. Try running "ffplay file.flv" to see if ffmpeg can decode file normally.
Anyway, how about showing us the command(s) you've tried and what output you get. And is this true of all flv files or just a few? Have you tried the same processes on other types of files such as an avi or mpeg?
I have a script I found to convert flv to avi. When I first tried it I missed the avifix command and was getting the same result of video without audio. You could probably use this and modify or add to it to change the avi to mpg. Hope this helps.
Code:
#!/bin/sh
if [ $# = 0 ]; then
echo "Usage: flv2avi file.flv"
exit 1
fi
#Convert to avi with stereo 48K sound
OUT=$1.avi
ffmpeg -i $1 -ar 48000 -ac 2 $OUT
avifix -i $OUT -F DX50
exit 1
Before using the script make sure ffmpeg is compiled with built-in libmp3lame. You must install / compile lame first before compiling ffmpeg.
Present problems:
File name after -i cannot contain space or "-" (minus) character. Example:
flv2mpg "Lionel Richie---Hello.flv" will produce error.
I had to rename the file to "richiehello.flv"
After the conversion I had to rename the result from
"richiehello.mpg" to "Lionel Richie---Hello.mpg"
Is it possible to modify the script to enable it to accept space and "-" (minus) character?
About a year or so ago the ffmpeg project changed their command argument requirements a bit, and one of the things they changed was to require -b and -ab to be in bits. This is why most older examples are wrong. You can easily fix them by simply adding 'k' to the bitrate numbers; e.g. "-b 48k".
But now I don't understand. Your second post has nothing to do with the problem you expressed in the first. Did you manage to get the audio working? Was it just because of the inaccurate bitrate problem?
As for your script, you have to put quotes around the whole filename in order to ensure that it is read as a unit. This is true for the command line and also true for any $# outputs in the script itself. So simply put quotes around the "$1" entries.
That should let it work. Though to tell the truth, it's good practice to avoid spaces and illegal characters in filenames anyway. They're such a headache to work around. I personally try to keep most of my files in lower-case, with spaces changed to underscores and odd characters kept to a minimum. It saves me a lot of hassle that way.
Last edited by David the H.; 06-05-2008 at 02:27 AM.
After several days of battle with mencoder parameters, I created 2 reliable scripts in turning flv videos to mpg with libmp3lame (mp3) and flv to avi with twolame (mp2).
Is there any other possible correction / improvement of the script?
The stuttering audio (stop and go) is because the default bit rate is too high. I use 64 and 56.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.