Opened 9 months ago

Closed 2 months ago

#6851 closed defect (needs_more_info)

rtsp with udp not working well

Reported by: dodo11 Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: udp rtsp
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


when i want to save rtsp stream to file i got lot of error like

[h264 @ 098e5c80] RTP: missed 198 packets
[h264 @ 0ad4f500] error while decoding MB 21 9, bytestream (-5)

so the file in loq quality and skip on frame
the command i run :

ffmpeg -i rtsp://x.x.x.x/video -rtsp_stransport udp file.264

some facts:
1)I can get this stream only on rtsp udp, (not tcp )
2) When i "record" this stream to file with OpenRtsp?/live55 I get no error , and exelent the answer "udp is not good protocol, it's loose package is not correct (another lib do it well)
3) i get the same error if I save to file.avi/file.mp4/file.ts
4)i don't want to use -c:v copy because I want to apply some filters.(v:c copy not always fix the problem)
5)on resolution under 1080x1920 I got better results.

thank you all!

Change History (4)

comment:1 follow-up: Changed 9 months ago by cehoyos

  • Keywords h264 removed
  • Priority changed from critical to normal

Please provide the command line you tested together with the complete, uncut console output to make this a valid ticket.

Last edited 9 months ago by cehoyos (previous) (diff)

comment:2 in reply to: ↑ 1 Changed 2 months ago by jidckii

Replying to cehoyos:

Please provide the command line you tested together with the complete, uncut console output to make this a valid ticket.

I have had such a problem for a very long time and I can not figure out how to solve it.
According to my assumptions, this is due to the fact that the input and output work in the same thread.
Whatever buffers I set up in the end result, I'm getting early loss of packets when reordering RTP "RTP: misssed XX pacets" or errors like "jitter buffer is full"

I know about the existence of the parameter async and cache
, but they can not be added to the rtsp input.

I'm using the latest builds from git, assembled in the docker image from this repository:

Here are the startup parameters:
"ffmpeg -v 48 -nostats -analyzeduration 20000000 -fflags igndts -fflags genpts -fflags latm

-max_delay 500000 -reorder_queue_size 10000 -rtsp_transport udp
-r 15 -i rtsp: admin: @ 554/0? .sdp
-map 0 -r 15 -c: v copy -an -f mpegts
-muxdelay 1 -max_interleave_delta 0 -fflags + genpts
udp: 1234? ttl = 1? pkt_size = 1316 "

During the experiments, I changed the values ​​of the parameters responsible for buffering, but whatever I put, the packets are still lost and the quality of the video stream spoils.

comment:3 Changed 2 months ago by jidckii

If necessary, I can create a separate ticket ?

comment:4 Changed 2 months ago by cehoyos

  • Resolution set to needs_more_info
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.