flavioribeiro / nginx-audio-track-for-hls-module

:sound: Nginx module that generates audio track for HTTP Live Streaming (HLS) streams on the fly.
GNU General Public License v3.0
136 stars 17 forks source link

Crash with high bitrates #26

Closed ghost closed 9 years ago

ghost commented 9 years ago

I'm trying to extract audio tracks from several .ts files. This works fine for tracks with audio bitrates up until 128kbps. However, if for example, I try to extract a 320kbps audio track, nginx crashes. Any ideas?

flavioribeiro commented 9 years ago

Interesting. Can you give me access to your deploy or duplicate it in other place so I can try to find the problem?

ghost commented 9 years ago

I'm currently using this in connection with the nginx-rtmp module to enable HLS for a radio stream hence the use of this module for audio only tracks. Should I post up my nginx config?

flavioribeiro commented 9 years ago

sure, please give me a gist with your config

ghost commented 9 years ago

Here is the nginx.conf. https://gist.github.com/jezhodges/83f254adc391af4800d5

ghost commented 9 years ago

Not sure whether this helps but the error log shows this on crash.

2015/04/05 00:03:51 [alert] 3415#0: worker process 3416 exited on signal 6 (core dumped) * Error in `nginx: worker process': free(): invalid next size (normal): 0x000000000280c600 ** 2015/04/05 00:03:51 [alert] 3415#0: worker process 4143 exited on signal 6 (core dumped) Error in`nginx: worker process': free(): invalid next size (fast): 0x0000000002865fe0 ***

flavioribeiro commented 9 years ago

@jezhodges still didn't have time to look deep on this. Can you try to reproduce building from fe3d94672b5d8d3b74782a60ad6d95c19ab451e3 commit?

ghost commented 9 years ago

Not a problem. Sorry for the lack of update, but I solved the crashing, by increasing the buffer size and audio chunk size. The problem has disappeared and have been streaming successfully for several days. Whether this is the correct way of doing this I don't know.

flavioribeiro commented 9 years ago

Awesome, could you show me your solution @jezhodges? Just for curiosity, where are you using this plugin?

ghost commented 9 years ago

Certainly. I am using this module to extract an audio track from a live nginx-rtmp stream, which provides a video track, which is not needed for a live radio stream.

My solution was:

This seems to have prevented further crashes and has given a stable stream.

flavioribeiro commented 9 years ago

good. Do you mind sending a pull request?