Assume I want (have to) re-encode (wiht MP3) the audio part of an original video. I can do it by flags like:
ffmpeg -i .... -acodec mp3 -ab 128 ...
or
ffmpeg -i .... libmp3lame -aq 5 ....
Ok, but this way I define the output quality independently from the existing audio quality.
Is there a way to tell ffmpeg:
"Hey ffmpeg, I don't know the exact audio source quality but find out by yourself and auto-adjust
the target audio quality by yourself so that the quality loss is minimal" ?
As far as I know there was a flag like "-sameq" in the past but this seems to be deprecated/removed in newer versions of ffmpeg.
Is there a corresponding new flag for that?
Is there a corresponding new flag for video part (Xvid codec) as well?
Thank you
Peter
+ Reply to Thread
Results 1 to 9 of 9
-
-
May not be what you mean, but you can use the "copy" codec to have ffmpeg extract the audio from a video, basically just demuxing it, no conversion made.
e.g., (assuming the video uses AAC audio)
Code:ffmpeg -i %1 -vn -acodec copy %1.aac
-
Sameq was just same quantizers if you converted between same codecs, see http://ffmpeg.org/trac/ffmpeg/wiki/Option%20'-sameq'%20does%20NOT%20mean%20'same%20quality''
-
I did ffmpeg -i Ramble_On__It_Might_Get_Loud.flv -vn -acodec Ramble_On__It_Might_Get_Loud.mp3 and it says I must specify at least one output file???? when I put copy after -acodec terminal says: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
-
You specify the audio codec by: "-acodec XXX".
In your original line line the XXX is "Ramble_On__It_Might_Get_Loud.mp3" which of course isn't a codec, and so then there is no output file either.
-acodec copy
is the same as the input.
Are you sure your flv is MP3 audio?
A lot are AAC.
Do just
ffmpeg -i Ramble_On__It_Might_Get_Loud.flv
and it will tell you what video and audio codecs the file has. -
yeah thanks it's aac, so i'll convert it into aac but is there an option to convert aac-mp3 with "same" bitrate or like the mp3 eqivalent of particular aac
-
Code:
cd /media/data/robert/Videos/nekonvert while IFS= read -r line; do ## line is stored in $line .. len nepozna -r =recursive fname="${line%.*}" e="${line##*.}" #extension echo "$fname" echo "$e" case "$e" in mp4) ffmpeg -i $line -vn -acodec copy $fname.mp3 #ffmpeg -i $line -vn -acodec $fname.mp3 ;; #konci moznost pre mp4 flv) ffmpeg -i $line -vn -acodec copy $fname.aac #ffmpeg -i $line -vn -acodec $fname.aac esac #case ends done < /media/data/robert/Videos/nekonvert/obsah.txt
-
I think you're using a Unix shell script, so I can't test it directly.
But it looks like it assumes that mp4 all have mp3 audio, which is not true.
That will create a file with the extension mp3, but won't make any conversion, it will just copy the original codec. So if it wasn't already MP3, it won't work.Last edited by AlanHK; 16th Oct 2013 at 21:12.
Similar Threads
-
ffmpeg: getting quality loss of avi when adding audio back in
By vidgem in forum AudioReplies: 2Last Post: 15th Mar 2012, 23:39 -
solved = ffmpeg to .flv audio quality improvement
By richiedood in forum Video ConversionReplies: 31Last Post: 1st Jul 2011, 18:04 -
Is original/source video file still the best to play on 1080p HDTV?
By tigerb in forum Newbie / General discussionsReplies: 5Last Post: 8th Feb 2011, 06:17 -
Best VHS playback source--original deck or other
By Cingular in forum RestorationReplies: 5Last Post: 25th Oct 2009, 21:33 -
ffmpeg choppy audio from large avi but not small avi source file
By cybertheque in forum Capturing and VCRReplies: 9Last Post: 13th Oct 2008, 15:38