ffmpeg equivalent for -movflags faststart for audio

2

I have several video and audio files on my server that I wish to stream. I have converted all video files to mp4 and audio files to aac.

Now I am streaming both type of files but it seems audio files are taking longer, much longer, to begin playing than videos. Sometimes I can see it buffering the entire file before it starts playing it.

I am not sure if it has any effect but for video files I use the -movflags faststart option and it gets the job done.

I was wondering if there is something similar to be done for audio files to make them start playing faster.

EDIT:

here is how I run the command to convert the files:

ffmpeg -i OriginalPath.wma -strict experimental -c:a aac -b:a 128k -n SomePath.m4a

And I use the HTML5 web player to play them from my server.

Zaid Amir

Posted 2015-10-06T06:24:12.460

Reputation: 157

What actual files do you export your aac tracks to ? .aac files ? If so, I'd recommend .m4a (the same as mp4 but with a different name often associated with audio-only). – Ely – 2015-10-06T14:44:26.740

What is your ffmpeg command and complete console output? How are you playing the files? – llogan – 2015-10-06T20:46:48.130

Try adding -movflags +faststart to the command in your question. – llogan – 2015-10-07T17:00:20.133

@LordNeckbeard that seems to work. I was under the impression that this was only for video files. One question though, why the + sign before faststart? – Zaid Amir – 2015-10-08T05:32:35.253

The + should add it to any default flags (assuming if there are any). Without it I believe it will clear everything but faststart, but I haven't actually looked into this or tested it. – llogan – 2015-10-09T16:45:43.567

Answers

2

You can still use -movflags +faststart with MP4 & M4A outputs that just contain audio.

llogan

Posted 2015-10-06T06:24:12.460

Reputation: 31 929

0

Oh, for the love of god...

aac for music? is a complete ordinay encode, your audios will look like youpoop.com ohhh sory youtube.com

ok, now you have a files in m4a, like SomePath.m4a, (m4a is ipod extension files, so old), then you have to put it into a container friendly for html5, like mp4.

ffmpeg -i SomePath.m4a -c copy -strict -2 audio_friendly.mp4

I think that your problem is your html5`s code for play this audio file, because the -movflags +faststart is only if in you mp4 has videos... this code here is ignored, so in your html file, you have to know the attr and his options

<audio src="audio_friendly.mp4" preload="" controls></audio>

The "preload" option have to be your problem, how do you configure it?

preload

Used for buffering large files; it can take one of three values:

 "none" does not buffer the file
 "auto" buffers the media file
 "metadata" buffers only the metadata for the file

The source for html5 audio

xear

Posted 2015-10-06T06:24:12.460

Reputation: 39