[FFmpeg-user] Download audio only bytes with ffmpeg

Robert Krüger krueger at lesspain.de
Fri Oct 25 16:28:06 CEST 2013


On Fri, Oct 25, 2013 at 10:48 AM, Tom Evans <tevans.uk at googlemail.com> wrote:
> On Thu, Oct 24, 2013 at 5:42 PM, Feras Salim <feribg at gmail.com> wrote:
>> Hi,
>> I noticed a few youtube downloaders out there give the option of
>> downloading only the audio and skipping the video stream. I was wondering
>> if that is possible with ffmpeg.
>
> Yes
>
>> Given we have an url that has flv or mp4
>> source and is seekable, is it possible to download only the audio form it
>> and convert to mp3, without having to download the whole file first.
>
> No. Audio and video packets are typically interweaved with each other,
> to split out the audio you need to demux the entire file. The "youtube

I don't know what the downloader really does but technically it is
possible at least with a seekable mp4 stream (don't know much about
flv) to read the positions of only audio sample chunks in the moov
atom and only download them by seeking to their start position one
after the other. Don't know how much you would practically gain
because of the tons of seeks you would have to do.

> downloaders" are also downloading the whole file.
>
>> I tried the following commands but all of them resulted in using the
>> bandwidth to download the entire video:
>>
>> ffmpeg -i "url" output.mp3
>> ffmpeg -i "url" -vn -c:a copy output.mp3
>> ffmpeg –i video.flv –vn –c:a libaac –ar 44100 –ac 2 –ab 64k audio.mp3
>> ffmpeg -i video.flv -ab 160k -ac 2 -ar 44100 -vn audio.mp3
>> ffmpeg -i “input” -vn -acodec copy output.mp3
>> ffmpeg -i "input" -vn out.mp3
>>
>> Is doing something like that even possible?
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user


More information about the ffmpeg-user mailing list