winshining / nginx-http-flv-module

A media streaming server based on nginx-rtmp-module. In addtion to the features nginx-rtmp-module provides, HTTP-FLV, GOP cache, VHosts (one IP for multi domain names) and JSON style statistics are supported now.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why not generate ts file when convert RTMP to HLS stream?

ondev opened this issue · comments

my nginx config is

worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  4096;
}

rtmp {
    server {
        listen 1935;
        #chunk_size 4096;
         application live {
            live on;
            record off;
            gop_cache on;
        }

        application hls {
            live on;
            hls on;
            hls_path /data/hls;
            hls_fragment 5s;
            hls_playlist_length 10m;
            hls_continuous on; #连续模式。
            hls_cleanup on;    #对多余的切片进行删除
        }
    }
}

ffmpeg command is:

ffmpeg -rtsp_transport tcp -r 25 -i rtsp://your_rtsp_url -vcodec copy -acodec libfdk_aac -f hls -hls_time 2.0 -hls_wrap 15 rtmp://localhost:1935/hls/test.m3u8

When I check the folder /data/hls, there is no ts file generate.

the ffmpeg log is:

[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test0.ts' for writing7x
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test1.ts' for writing4x
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test2.ts' for writing6x
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test3.ts' for writing9x
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test4.ts' for writing5x
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test5.ts' for writing2x
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test6.ts' for writing1x
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test7.ts' for writing8x
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test8.ts' for writing7x
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test9.ts' for writing6x
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test10.ts' for writingx
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test11.ts' for writingx
[hls @ 0x136c4c0] Opening 'rtmp://localhost:1935/hls/test12.ts' for writingx

the nginx access.log is:


127.0.0.1 [21/May/2021:11:08:47 +0800] PUBLISH "hls" "test.m3u8" "" - 424 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:49 +0800] PUBLISH "hls" "test11.ts" "" - 424 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:49 +0800] PUBLISH "hls" "test.m3u8" "" - 424 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:50 +0800] PUBLISH "hls" "test12.ts" "" - 424 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:51 +0800] PUBLISH "hls" "test.m3u8" "" - 424 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:52 +0800] PUBLISH "hls" "test13.ts" "" - 136361 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:53 +0800] PUBLISH "hls" "test.m3u8" "" - 424 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:54 +0800] PUBLISH "hls" "test14.ts" "" - 136361 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:55 +0800] PUBLISH "hls" "test.m3u8" "" - 424 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:56 +0800] PUBLISH "hls" "test0.ts" "" - 136357 640 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:57 +0800] PUBLISH "hls" "test.m3u8" "" - 424 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:58 +0800] PUBLISH "hls" "test1.ts" "" - 136357 640 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:08:59 +0800] PUBLISH "hls" "test.m3u8" "" - 424 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:09:00 +0800] PUBLISH "hls" "test2.ts" "" - 136357 640 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:09:01 +0800] PUBLISH "hls" "test.m3u8" "" - 424 642 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)
127.0.0.1 [21/May/2021:11:09:03 +0800] PUBLISH "hls" "test3.ts" "" - 420 640 "" "FMLE/3.0 (compatible; Lavf58.45.100)" (0s)

2021-05-22-1
2021-05-22-2
2021-05-22-3

Make sure your Nginx has permission to access the directory you have specified.