Search code examples
node.jsunixffmpegsegmentfluent-ffmpeg

Ffmpeg segment doesn't show file size update in real time


I'm trying to run ffmpeg mp3 stream with segmentation for each hour. Everything is working perfectly, except for one thing: when i run the command, the file size doesn't grow in real-time as i need, it only grows in packages of 256k.

Is there a way to turn a "real-time mode"?

I'm using ubuntu 18.04 with ffmpeg 3.4.6

This is the code i'm trying to run on linux terminal:
ffmpeg -i http://radiocentova.conectastm.com:8363/stream -y -acodec libmp3lame -b:a 16k -ac 1 -ar 11025 -vn -strftime 1 -f segment -segment_time 3600 -flush_packets 1 @test_%Y%m%d%H%M%S+00.mp3



Recording with segment: Recording with segment Recording without segment: Recording without segment


Solution

  • The flush packets option has to be directed to the child muxer (mp3 in this case), so

    -segment_format_options flush_packets=1 instead of -flush_packets 1.