using libVLC to restream a low fps low bandwidth stream

This forum is about all development around libVLC.
tomasz_c
New Cone
New Cone
Posts: 8
Joined: 27 Jan 2016 14:14

using libVLC to restream a low fps low bandwidth stream

Postby tomasz_c » 27 Jan 2016 14:27

Hello,

We are using libVLC (through the nVLC .NET wrapper) to re-stream a low-bandwidth low-fps stream (2-3 fps, 64kbps). We are using libVLC 2.2.1, H.264 codec, MP3, TS container. We want to preserve the stream as is, so avoiding transcoding, yet still VLC is frame-multiplying and we get 10-15 fps on the output if the input stream is below 10 fps. The lower the bandwidth on the input stream, the higher the CPU usage due to the frame insertions.

How can we work around this? We need frame-for-frame accuracy, and were assuming that if we are not transcoding we should be able to get this accuracy. Seems not to be the case.

Incoming stream: H264 - fps: 2, Keyframe: 30, 640x360, Bitrate: VBR 100 kbps, G711_Alaw; Outputing stream: Container: TS, H264, MP3

Any help appreciated!

/Tomasz

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: using libVLC to restream a low fps low bandwidth stream

Postby Rémi Denis-Courmont » 27 Jan 2016 14:32

VLC does not change the frame rate if not transcoding. That's not even logically feasible. So your question makes no sense.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

tomasz_c
New Cone
New Cone
Posts: 8
Joined: 27 Jan 2016 14:14

Re: using libVLC to restream a low fps low bandwidth stream

Postby tomasz_c » 27 Jan 2016 15:39

Hi, thanks for your answer. I was trying to gather some logs to add as evidence to my question. Without involving our own application (to take it out of the equation) I put in the re-streaming parameters into VLC:

Code: Select all

:sout=#std{access=http,mux=ts,dst=:8555/test1} :sout-keep
Transcoding this stream in standalone VLC just causes CPU to go to 100% and nothing meaningful is served. The VLC that is set up to stream keeps printing:

Code: Select all

[00007fe17c02c558] core video output warning: picture is too late to be displayed (missing 1472 ms) [00007fe17c02c558] core video output warning: picture is too late to be displayed (missing 1507 ms) [00007fe17c02c558] core video output warning: picture is too late to be displayed (missing 1465 ms) [00007fe17c02c558] core video output warning: picture is too late to be displayed (missing 1499 ms) [00007fe17800c2e8] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?) [00007fe17800c2e8] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
Trying to play back the served stream just yields:

Code: Select all

[00007f72a8c03e18] ts demux error: libdvbpsi (PSI decoder): TS discontinuity (received 2, expected 10) for PID 0 [00007f72a8c03e18] ts demux error: libdvbpsi (PSI decoder): TS discontinuity (received 2, expected 10) for PID 66
Trying to play back the input stream yields the same errors like the VLC set up to stream it.

Code: Select all

[00007fcf3c02a188] core video output warning: picture is too late to be displayed (missing 1463 ms) [00007fcf3c02a188] core video output warning: picture is too late to be displayed (missing 984 ms) [00007fcf3c02a188] core video output warning: picture is too late to be displayed (missing 1458 ms) [00007fcf4000c368] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?)
This is what ffplay says about the input stream (and is able to play it):

Code: Select all

Input #0, rtsp, from 'rtsp://login:password@192.168.2.222:554/snl/live/1/3': Metadata: title : NVT comment : From NVT Duration: N/A, start: 2.999978, bitrate: N/A Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p(pc), 640x360 [SAR 1:1 DAR 16:9], 2 fps, 25 tbr, 90k tbn, 4 tbc Stream #0:1: Data: none
Not sure where I saw the 10fps, but definitely there is a problem when trying to re-stream this low-fps input stream. Sorry for the confusing initial description. I have full (-vvv) logs available if you wish to see them.

Thanks in advance for your answer,
Tomasz

tomasz_c
New Cone
New Cone
Posts: 8
Joined: 27 Jan 2016 14:14

Re: using libVLC to restream a low fps low bandwidth stream

Postby tomasz_c » 27 Jan 2016 15:41

Oh and the command-line for streaming:

Code: Select all

vlc -vvv --live --no-drop-late-frames --no-skip-frames --rtsp-tcp rtsp://login:password@192.168.2.222:554/snl/live/1/3 --sout=`#std{access=http,mux=ts,dst=:8555/test1}:sout-keep`

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: using libVLC to restream a low fps low bandwidth stream

Postby Rémi Denis-Courmont » 27 Jan 2016 15:54

PEBKAC
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

tomasz_c
New Cone
New Cone
Posts: 8
Joined: 27 Jan 2016 14:14

Re: using libVLC to restream a low fps low bandwidth stream

Postby tomasz_c » 27 Jan 2016 15:57

:-) We all make mistakes, so if I am doing something wrong please help me solve it. You are the VLC gurus, having read through the documentation over and over I can't find what I am doing wrong. Ffplay plays the stream. VLC doesn't. How to solve this simple playback issue to start with?

tomasz_c
New Cone
New Cone
Posts: 8
Joined: 27 Jan 2016 14:14

Re: using libVLC to restream a low fps low bandwidth stream

Postby tomasz_c » 28 Jan 2016 09:49

IMHO this is a VLC bug (also affecting libVLC). I created a separate thread about how to reproduce it with VLC, but libVLC gives the exact same results. I think it workes randomly, like 1 in 20 or 1 in 50 times, probably that's when I saw the upsampled 10 fps figure. Can't reproduce it because it barely ever works at all and requires a massive network cache for a 3kbps stream.
https://forum.videolan.org/viewtopic.php?f=4&t=130443

tomasz_c
New Cone
New Cone
Posts: 8
Joined: 27 Jan 2016 14:14

Re: using libVLC to restream a low fps low bandwidth stream

Postby tomasz_c » 23 Feb 2016 14:30

And this is not a new issue either:

http://lists.live555.com/pipermail/live ... 16128.html


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 18 guests