Opened 6 years ago

Closed 6 years 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

Description

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 quality.so 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 by Carl Eugen Hoyos, 6 years ago

Keywords: h264 removed
Priority: criticalnormal

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

Last edited 6 years ago by Carl Eugen Hoyos (previous) (diff)

in reply to:  1 comment:2 by jidckii, 6 years ago

Replying to cehoyos:

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

Hello!
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
https://ffmpeg.org/ffmpeg-all.html#async
, 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:
https://hub.docker.com/r/jrottenberg/ffmpeg/

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: @ 192.168.86.169: 554/0? .sdp

-map 0 -r 15 -c: v copy -an -f mpegts

-muxdelay 1 -max_interleave_delta 0 -fflags + genpts

udp: 239.0.0.1: 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 by jidckii, 6 years ago

If necessary, I can create a separate ticket ?

comment:4 by Carl Eugen Hoyos, 6 years ago

Resolution: needs_more_info
Status: newclosed
Note: See TracTickets for help on using tickets.