NineCattoRules
NineCattoRules

Reputation: 2428

How to stream M4A files correctly?

I would like to stream an M4A audio file but for some reason the player starts to play the song only after downloaded the entire file.

<!DOCTYPE html>
<html>
<body>

<audio controls>
  <source src="https://php-test-easybreazy.c9users.io/music/1021785690_1171244514_239291028.m4a" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

</body>
</html>

In my Ubuntu server I used FFMPEG to encode my audio file.

The only thing I can think of is a metadata/encode issue.

Why the player starts playing only after downloaded the entire file audio?

Upvotes: 1

Views: 1844

Answers (1)

llogan
llogan

Reputation: 134063

Add -movflags +faststart when encoding to MP4/M4V/M4A, or re-mux using this option:

ffmpeg -i input.m4a -c copy -movflags +faststart output.m4a

Upvotes: 5

Related Questions