[Libav-user] Timestamps are unset in a packet

wolverin wolverin82 at mail.ru
Tue Jan 10 08:26:55 EET 2023


Hi, I'm trying to modify ffserver.c of the old version to use rtps server.
If I send an rtsp/rtp stream via  av_interleaved_write_frame(pFmtCtxOut, ppktout) to rtsp-simple-server and watch it in VLC, then there are no errors, I install pts/dts myself in my source.
 
But if I send x264 encoded packets via udp protocol to a connection implemented so as not to use temporary files.
 
    AVDictionary * pDicStm = NULL;
    av_dict_set(&pDicStm, "rtsp_flags", "listen", 0);
    av_dict_set(&pDicStm, "protocol_whitelist", "tcp,udp,rtp", 0);
    av_dict_set(&pDicStm, "rtsp_transport", "udp", 0);
    av_dict_set(&pDicStm, "allowed_media_types", "video", 0);
    avformat_open_input(&pFmtCtxStm, rtsp_url, NULL, &pDicStm);
 
Then when reading from such a connection, I see errors
 
[rtp @ ] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[rtp @ ] Encoder did not produce proper pts, making some up.
[rtp @ ] Packets poorly interleaved, failed to avoid negative timestamp -12886 in stream 0.
Try -max_interleave_delta 0 as a possible workaround.
 
Yes, I know that it is suggested to use -fflags +genpts for ffmpeg, but what should I actually specify to avoid this error?
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20230110/528c34eb/attachment.htm>


More information about the Libav-user mailing list