Coder Social home page Coder Social logo

Comments (4)

winshining avatar winshining commented on June 6, 2024

Make sure nginx has permission to access directories you've configured.

from nginx-http-flv-module.

ZJDATY avatar ZJDATY commented on June 6, 2024

Make sure nginx has permission to access directories you've configured.
还是用母语交流吧,外语容易词不达意,我用的是win11,我已经仔细检查,文件夹的权限都没有问题,我手动创建了tmp,运行程序它自动生成了hls和dash目录,说明不是文件夹权限问题。
我想请教一下 按照默认的conf配置,它是否会在hls下生成视频片段文件?
http://example.com[:port]/dir/streamname.m3u8
还有一点,这里的dir ,是填 tmp 还是 tmp/hls 呢?
我还该怎么去排查问题呢?

from nginx-http-flv-module.

winshining avatar winshining commented on June 6, 2024

snapshot

OS: Windows 11
Compiler: Visual Studio 2022
Media URL: http://localhost/hls/mystream.m3u8
Nginx version: 1.23.1
nginx-http-flv-module version: 1.2.11
Nginx config:

http {
    # ...
    server {
        # ...
        location /hls {
            types {
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }

            root ./;

            add_header 'Cache-Control' 'no-cache';
        }
    }
}

rtmp {
    # ...
    server {
        # ...
        application hls {
            live on;
            hls on;
            hls_path ./hls;
        }
    }
}

from nginx-http-flv-module.

ZJDATY avatar ZJDATY commented on June 6, 2024

snapshot

OS: Windows 11 Compiler: Visual Studio 2022 Media URL: http://localhost/hls/mystream.m3u8 Nginx version: 1.23.1 nginx-http-flv-module version: 1.2.11 Nginx config:

http {
    # ...
    server {
        # ...
        location /hls {
            types {
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }

            root ./;

            add_header 'Cache-Control' 'no-cache';
        }
    }
}

rtmp {
    # ...
    server {
        # ...
        application hls {
            live on;
            hls on;
            hls_path ./hls;
        }
    }
}

可以了,我之前用的是

ffmpeg -re -i .\test.mp4 -c copy -f flv rtmp://127.0.0.1:1935/live/hls

以为它一条指令就可以产生所有的播放连接 。
现在看了大佬给的链接和配置文件,才明白,hls 和http-flv ,是在两个application 。必须把指令改成

ffmpeg -re -i .\test.mp4 -c copy -f flv rtmp://127.0.0.1:1935/hls/hls

那我好奇 ,如果把

 application hls {
            live on;
            hls on;
            hls_path ./hls;
        }

也放到

application live {
         # . . . 
        }

是不是 只要

ffmpeg -re -i .\test.mp4 -c copy -f flv rtmp://127.0.0.1:1935/live/hls

就可以既有 rtsp rtmp://127.0.0.1:1935/live/hls
又有 http-flv
又有 hls http: . . .m3u8

现在也可以做到
http://127.0.0.1:80/live?port=1935&app=hls&stream=hls
rtmp://127.0.0.1:1935/hls/hls
http://127.0.0.1:80/hls/hls.m3u8

from nginx-http-flv-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.