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

ERR: muxer error: unable to extract DTS: invalid POC #1552

Closed
andrew-ld opened this issue Mar 10, 2023 · 5 comments
Closed

ERR: muxer error: unable to extract DTS: invalid POC #1552

andrew-ld opened this issue Mar 10, 2023 · 5 comments
Labels
bug Something isn't working hls

Comments

@andrew-ld
Copy link
Contributor

Which version are you using?

25dc252

Which operating system are you using?

https://github.com/andrew-ld/rtsp-simple-server/blob/e24eaba1ffc80e1e8ee297fab2f55e4747ef0882/Dockerfile

Describe the issue

When retransmitting an rtsp stream from ffmpeg to rtsp-simple-server using runOnInit about every minute I get an error from the hls muxer (hlsAlwaysRemux is active).

the affected log lines are these

2023/03/10 08:58:08 WAR [RTSP] [session dfc6ecdc] 2 RTP packet(s) lost

2023/03/10 08:58:08 INF [HLS] [muxer vdeo_52089] ERR: muxer error: unable to extract DTS: invalid POC

often when the muxer gives this problem a few moments earlier rtsp complains about packet loss

I use these options with ffmpeg:

ffmpeg -rtsp_transport tcp -i $[RTSP_UPSTREAM_URL} \
 -c copy \
 -f segment -segment_time 00:30:00 -reset_timestamps 1 -strftime 1 \
 /${STORAGE}/output#%Y-%m-%d_%H-%M-%S-%z#${DEVICE_ID}.ts \
 -c:v copy -c:a libopus -b:a 16k \
 -f rtsp rtsp://ffmpeg:${PUBLISH_SECRET}@localhost:${RTSP_PORT}/${RTSP_PATH}

the same stream by connecting it directly to rtsp-simple-server does not give this problem, it seems that only retransmitting it gives this problem.

I have tried adding various hacks to ffmpeg such as

  • use_wallclock_as_timestamps
  • map 0:0
  • fflags +igndts+genpts
@github-actions
Copy link
Contributor

This issue is being automatically closed because it does not follow the issue template.
Please reopen the issue and make sure to include all sections of the template.

@aler9 aler9 reopened this Mar 13, 2023
@aler9 aler9 added bug Something isn't working hls labels Mar 13, 2023
@aler9
Copy link
Member

aler9 commented Mar 13, 2023

Hello,

In order to record incoming streams, my advice is to use FFmpeg inside runOnReady as described here:
https://github.com/aler9/rtsp-simple-server#save-streams-to-disk

Eventually the recording feature will be integrated into the server as described here #1399

The issue with using HLS to record streams is that most HLS client expects a clean playlist, without gaps in time and without errors, and that's the reason why segments and playlists are resetted in case of error.

Anyway, if you post a sample recording of the stream that causes the error, we can try to fix the error instead of adding workarounds. You can record the stream by using

ffmpeg -i rtsp://original-stream -t 00:02:00 -c copy -f mpegts record.ts

@yanhua1012
Copy link

yanhua1012 commented Jul 11, 2023

I have encounter the same situation.
the console complain the error:
[HLS] [muxer vdeo_52089] ERR: muxer error: unable to extract DTS: invalid POC

I resolve it by issue the command
ffmpeg.exe -rtsp_transport tcp -i rtsp://xxxx:[email protected]/live1s1.sdp -vcodec libx264 -f rtsp -rtsp_transport tcp rtsp://localhost:8554/videoPath

the version of mediamtx.exe is 0.23.6
below is the record file link from rtsp video source
https://drive.google.com/file/d/1HvqLgkKf-c19jcjn5CZ9MfZ3UW8ICcMn/view?usp=sharing

below is the link of mediamtx.yml
https://drive.google.com/file/d/1EfKak99D6pcRjKc5_L3HmeYBU7roZyvy/view?usp=sharing

aler9 added a commit to bluenviron/mediacommon that referenced this issue Aug 8, 2023
aler9 added a commit to bluenviron/mediacommon that referenced this issue Aug 8, 2023
aler9 added a commit to bluenviron/mediacommon that referenced this issue Aug 8, 2023
@aler9
Copy link
Member

aler9 commented Aug 8, 2023

This error has been removed by bluenviron/mediacommon#55, timing-related issues are still possible and are tracked in #1002.

@aler9 aler9 closed this as completed Aug 8, 2023
aler9 added a commit to bluenviron/mediacommon that referenced this issue Aug 8, 2023
Copy link
Contributor

This issue is being locked automatically because it has been closed for more than 6 months.
Please open a new issue in case you encounter a similar problem.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working hls
Projects
None yet
Development

No branches or pull requests

3 participants