Closed rukez closed 8 years ago
Oups, looks like i figured out: When i set --rtsp-frame-buffer-size option below 200000 value, value seems to be dropped to default (200000). And when this value is too high (947483647 in my example above) frame drops appear until this buffer is full, so setting 500000 seems to eleminate difference in VLCJ and VLC behaviour. Do i need to specify buffer length relatively to stream resolution (frame size) or it can be auto-changed on-the-fly? If i have to take care of it, how can i determine stream resolution via VLCJ without actually getting video data (rtp stream), to make one rtsp call for info, than setting buffers size and then connecting to rtsp for video data?
I have no idea really. Those switches are not supported by LibVLC. vlcj does nothing with them apart from pass them to VLC.
I figured out how --rtsp-frame-buffer-size buffer works - default is 200k (and looks like no way to set it lower), on each frame that is larger than buffer size, live555 increase buffer automatically. Seems like there is no way to reasonable-fast check stream resolution before playback, so fastest way is to connect with hidden video layer, get resolution of received frame, if it's possible size is lower than default buffer - show video layer, if possible size is bigger - stay hidden for one frame, than repeat check taking in mind auto-increased buffer.
Trouble is that after some time of testing (no code was changed) problem repeated and --rtsp-frame-buffer-size fix stopped working. I've tried DirectMediaPlayer instead of embedded one ... i still have ton's of "picture is too late to be displayed" warnings in log, but playback is very nice - no picture stall, no skips, looks like even no frame drops. CPU usage is almost the same - 5mpx stream rendering to 800x600 panel takes about 70-80% of one core (this is most strange - last time i tried it year ago difference was much higher) - i'll try to change test PC - maybe old 6600gt simply fails to renderer properly.
It's not clear to me if there's still a problem or not...
I am also facing the similar issue. Has anyone fixed it?
Hello! I use vlcj for rtsp stream playback, everything is ok with low-res streams, but hi-res stream is missing frames. In pure vlc hi-res stream is showing ok.
Here is my vlcj player code (actually it is taken from docs with some additional args, player is drawing to canvas):
And here is vlcj's output:
**So tons of frames are "late to be displayed". As you can see avccodec performance options are allready enabled. --no-skip-frames don't help - vlc just dropping frames then, --no-drop-late-frames don't help also. I've tried setting huge network cache option but only --live-caching increasing change something - instead of multiple drops log contains also multiple "core video output debug: picture might be displayed late". Leaving rtsp cache in default low value don't help also. After some time (about a minute) playback may become (not allways) more stable, can be played without drops for 30-60 seconds, than some more drops, than stable again and so on. Also, after some time, multi-drops commonly starts with zero time delay (picture might be displayed late (missing 0 ms))
When i open same rtsp in pure VLC, playback is ok - only first frame is rendered buggy (it's ok because in vlcj i set huge frame buffer, vlc is launched without any options, just -vvv) and second frame is dropped with "picture is too late to be displayed". Next frames are rendered perfectly without any issues for hours of playback. Here is VLC connection log:**
Test system is old 8 core xeon with nvidia 6600gt While playback none of cores are loaded to maximum (7 are almost idle, 1 is loaded to ~80%)
Maybe i need to set some kind of caching or time-related options, that are used by VLC by default, but are lost when using VLC through VLCJ?
I have tried --clock-jitter=2147483647, huge file, network and rtsp caches, disabling of network clock sync and so on.