Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hls playback 404 not found for rtmp streaming #116

Open
SaulMoonves opened this issue Apr 4, 2024 · 9 comments
Open

hls playback 404 not found for rtmp streaming #116

SaulMoonves opened this issue Apr 4, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@SaulMoonves
Copy link

XIU version
v0.12.6

Describe the bug
hls m3u8 404 not found

To Reproduce

xiu --rtmp 1935 --rtsp 1554 --hls 8081 -l debug
ffmpeg -re -stream_loop -1 -i test.mp4 -c:a copy -c:v copy -f flv -flvflags no_duration_filesize rtmp://<my-server>:1935/live/test

on the streaming machine:

# curl http://localhost:8081/live/test/test.m3u8
Not Found

However rtmp playback via ffplay does work.

What am I doing wrong?

Expected behavior
playback

@harlanc
Copy link
Owner

harlanc commented Apr 4, 2024

The issue can be reproduced using the Docker image environment but not with a locally build because the generation of .ts and .m3u8 files relies on relative paths. Using absolute paths can fix this problem.

@harlanc harlanc added the bug Something isn't working label Apr 4, 2024
@SaulMoonves
Copy link
Author

I am having the problem even if it is built from Cargo or if I download a release. I did not try from source though.

@harlanc
Copy link
Owner

harlanc commented Apr 5, 2024

@SaulMoonves

Try to build from this branch https://github.com/harlanc/xiu/tree/fix_116

@SaulMoonves
Copy link
Author

It seems to still get not found.

@harlanc
Copy link
Owner

harlanc commented Apr 6, 2024

Could you paste the logs of xiu when playing the hls stream which should contain "m3u8 folder:" and "ts folder:" as follows:

[2024-04-06T22:39:45Z INFO  hls::m3u8] m3u8 folder: /Users/username/github/xiu/target/debug/live/test
[2024-04-06T22:39:45Z INFO  hls::ts] ts folder: /Users/username/github/xiu/target/debug/live/test

@suzp1984
Copy link
Contributor

suzp1984 commented Apr 12, 2024

check whether below cmd works?
ffplay -i http://localhost:8081/live/test/test.m3u8

otherwise, stop the service, then delete ${xiu running folder}/live/test/ directory, then run boot the service again.
you need to wait around one ts segment time gap, around 6 ~ 10 seconds, to get first ts segment generated.

I met once the ${xiu running folder}/live/test/ has ts segment, maybe generated before, but no index m3u8 file. After I clean the live/test, and reboot service, hls recovered.

@fs8vsx59h
Copy link

I got this issue too

running in powershell:

.\xiu-0.12.5-x86_64-pc-windows-msvc.exe  -r 1935  -f 8888 -s 9999 --log debug

some info:

[2024-04-18T04:58:15Z INFO  streamhub] subscribe:  stream identifier: RTMP - app_name: live, stream_name: test

OBS setting:
image

ffplay command:

 ffplay -i http://localhost:8888/live/test/test.flv

httpflv works fine:

Input #0, flv, from 'http://localhost:8888/live/test/test.flv':/0
  Metadata:
    fileSize        : 0
    audiochannels   : 2
    2.1             : false
    3.1             : false
    4.0             : false
    4.1             : false
    5.1             : false
    7.1             : false
    encoder         : obs-output module (libobs version 30.1.2)
  Duration: 00:00:00.00, start: 0.033000, bitrate: N/A
  Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 163 kb/s
  Stream #0:1: Video: hevc (Main), yuv420p(tv, bt709), 1600x900 [SAR 1:1 DAR 16:9], 2560 kb/s, 60 fps, 60 tbr, 1k tbn
   2.99 A-V: -0.012 fd=   5 aq=   19KB vq=  336KB sq=    0B f=0/0

ffplay command:

ffplay -i http://localhost:8888/live/test/test.m3u8

hls 404:

[http @ 0000026278cd3300] HTTP error 404 Not Foundsq=    0B f=0/0
http://localhost:8888/live/test/test.m3u8: Server returned 404 Not Found

The xiu running path generate no index m3u8 and ts (its acctially generated once , but after I delete it , no more )
image

@harlanc
Copy link
Owner

harlanc commented Apr 18, 2024

@fs8vsx59h
It seems that you are not using the correct port number, the correct one may be :

ffplay -i http://localhost:9999/live/test/test.m3u8

If the problems persists, try the following step:

Try to build from this branch https://github.com/harlanc/xiu/tree/fix_116

@fs8vsx59h
Copy link

@fs8vsx59h 您似乎没有使用正确的端口号,正确的端口号可能是:

ffplay -i http://localhost:9999/live/test/test.m3u8

如果问题仍然存在,请尝试以下步骤:

Try to build from this branch https://github.com/harlanc/xiu/tree/fix_116

sorry for that , I delete the live/test folder and restart , it works now and generate correct index m3u8
I'm trying fix_116 see if this issue fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants