nginx-rtmp-module icon indicating copy to clipboard operation
nginx-rtmp-module copied to clipboard

FFMPEG / Nginx not creating files such as ts and m3 for HLS

Open lyntree opened this issue 4 years ago • 4 comments

Hello,

We've tried to follow the instructions as close as possible but no matter what we have done, we can't seem to pull through on HLS or Dash despite RTMP works. We've configured the file so many times that we can only guess and narrow it down to the following areas.

I presume its this command that starts to generate the playlist file - ffmpeg -listen 1 -i rtmp://185.181.9.232/hls
-c:v libx264 -crf 21 -preset veryfast
-c:a aac -b:a 128k -ac 2
-f hls -hls_time 4 -hls_playlist_type event stream.m3u8

but we get on response: [rtmp @ 0x5631e4a20800] Cannot open connection tcp://185.181.9.232:1935?listen&listen_timeout=-1000 rtmp://185.181.9.232/hls: Address already in use

as for the TS files, we have OBS software streaming fine through VLC but nothing is being recorded on the server. Can you please advise if there is any reason why its not creating these files despite its been configured in the nginx file?

lyntree avatar Nov 08 '21 17:11 lyntree

can u please post your full configuration? Some guesses in advance.

1: Your apllication should define "hls on;" and a hls_path 2: also I think your input misses the streamName it should look like rtmp://185.181.9.232/hls/$name 3: I cant examine what your ffmpeg call is for. You may have a look at https://github.com/arut/nginx-rtmp-module/wiki/Directives#exec_push 4: If you just want to get a simple stream working use the sample config and work on from there https://github.com/arut/nginx-rtmp-module#example-nginxconf

Dropye avatar Nov 19 '21 15:11 Dropye

terminal1.txt

We have tried everything to get this to work and nothing no matter what, works any insight would be great, we have gone over this constantly, and it shows an error of:

Pwrite recording Error - bad descriptor

lyntree avatar Nov 22 '21 21:11 lyntree

It literally will create the folders but will not create the playlist or save the ts files onto server for what we need for HLS/DASH support.

lyntree avatar Nov 22 '21 21:11 lyntree

I got a video.mp4 in the correct format, so copy is ok: ffmpeg -re -i video.mp4 -loop -1 -c:v copy -c:a copy -f flv rtmp://127.0.0.1/hls/foo i set 'hls_path /tmp/hls' when the ffmpeg command starts a file is created foo-0.ts after 10s the next file foo-1.ts and THEN a file foo.m3u8 is created

so m3u8 is created only when the first fragment is done after hls_fragment seconds

z0rti avatar Nov 28 '21 17:11 z0rti