Programming/ffmpeg2017. 2. 9. 19:43

vlc 에서 rtsp 추가 옵션을 보면

캐쉬로 기본 1000ms 가 설정되는데 이걸 어디서 설정하나 검색중..


ffplay의 max_delay?

ffplay -max_delay 500000 -rtsp_transport udp -v trace "rtsp://user:pass@CamIP:Port/URL" 

[링크 : https://github.com/ZoneMinder/ZoneMinder/issues/811]


ffplay -h 도움말을 보니 이렇게 us 단위라네..

-max_delay         <int>   ED... maximum muxing or demuxing delay in microseconds 


다시 읽어 보니.. 레이턴시에 영향을 주긴 하지만.. TCP에는 적용사항이 없고

UDP에서 패킷 재조합시간에 대한 내용이라 일단 패스~

When receiving data over UDP, the demuxer tries to reorder received packets (since they may arrive out of order, or packets may get lost totally). This can be disabled by setting the maximum demuxing delay to zero (via the max_delay field of AVFormatContext). 

[링크 : https://ffmpeg.org/ffmpeg-protocols.html#rtsp]

[링크 : https://ffmpeg.org/doxygen/2.7/structAVFormatContext.html#a58422ed3d461b3440a15cf057ac5f5b7]


AVFormatContext의 buffer_size

cache 버퍼 크기

av_dict_set(&options, "buffer_size", "655360", 0); 

[링크 : http://stackoverflow.com/questions/29075467/set-rtsp-udp-buffer-size-in-ffmpeg-libav]

  [링크 : https://git.libav.org/?p=libav.git;a=commit;h=e3ec6fe7bb2a622a863e3912181717a659eb1bad] commit log

  [링크 : https://git.libav.org/?p=libav.git;a=blob;f=libavformat/rtsp.c;h...d] rtsp whole source

  [링크 : https://git.libav.org/?p=libav.git;a=blobdiff;f=libavformat/rtsp.c;h...f] diff


1547 AVDictionary *metadata;

[링크 : https://ffmpeg.org/doxygen/trunk/avformat_8h_source.html#l01331] AVFormatContext structure


int av_dict_set (AVDictionary ** pm, const char * key, const char * value, int flags ) 

[링크 : https://www.ffmpeg.org/doxygen/2.7/group__lavu__dict.html#ga8d9c2de72b310cef8e6a28c9cd3acbbe]


AVCodecContext의 rc_buffer_size

int AVCodecContext::rc_buffer_size

decoder bitstream buffer size


encoding: Set by user.

decoding: unused

Definition at line 2291 of file avcodec.h. 

[링크 : https://www.ffmpeg.org/doxygen/2.5/structAVCodecContext.html#a15000607a7e2371162348bb35b0184c1]


일단... 두개 옵션을 줘서 어느 구간에서 지연시간들이 생기는지 검사할 수 있는 듯?

Also setting -probesize and -analyzeduration to low values may help your stream start up more quickly (it uses these to scan for "streams" in certain muxers, like ts, where some can appears "later", and also to estimate the duration, which, for live streams, the latter you don't need anyway). This should be unneeded by dshow input. 

[링크 : https://trac.ffmpeg.org/wiki/StreamingGuide#Latency]

'Programming > ffmpeg' 카테고리의 다른 글

ffmpeg 예제 소스 분석  (0) 2017.02.10
ffmpeg 3.2 소스관련  (0) 2017.02.10
ffmpeg - vlc cache 설정관련  (0) 2017.02.10
ffmpeg + opengl  (0) 2017.02.09
ffmpeg 예제 (sdl / live555)  (0) 2017.02.06
Posted by 구차니