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

Video speed up when playing with custom websocket #412

Open
Petingo opened this issue Jan 7, 2023 · 0 comments
Open

Video speed up when playing with custom websocket #412

Petingo opened this issue Jan 7, 2023 · 0 comments

Comments

@Petingo
Copy link

Petingo commented Jan 7, 2023

Hello and happy new year!

I'm trying to stream .ts file with my own WebSocket, but the video would speed up for like 1.5x when playing in the browser.
I use this command to generate video segments, and I have another program that detects if there's any newly available sequence and writes to the WebSocket.

ffmpeg -y -re \
-f v4l2 \
    -video_size 640x480 -i /dev/video0 \
-f alsa \
                -ar 44100 -i hw:0 \
        -f mpegts \
                -codec:v mpeg1video -s 640x480 -b:v 1000k -bf 0 \
                -codec:a mp2 -b:a 128k \
                -muxdelay 0.001 \
-f hls \
    -hls_time 5 \
    -hls_playlist_type vod \
    -hls_flags independent_segments \
    -hls_segment_type mpegts \
    -hls_segment_filename stream_%v/data%02d.ts \
test

I also tried to use a fixed framerate (ffmpeg -r 25 with -f v4l2 -framerate 25) but the situation is the same.
Since the video is generated on the fly, so the behaviour would be like:
[play seq0 at very fast speed] - [wait for seq1 ( for like 1.5s ) ] - [play seq1 for very fast speed] - [wait for seq2]

I wonder if this happens due to the same reason as #184 (which I also experience). Does anyone know any potential solution (or any alternative)?

p.s.
When I run the websocke example in the README, everything works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant