Display on screen, and transcode to file

About encoding, codec settings, muxers and filter usage
ChrisFlynn
New Cone
New Cone
Posts: 5
Joined: 29 Jun 2022 17:31

Display on screen, and transcode to file

Postby ChrisFlynn » 29 Jun 2022 17:40

I'm trying to take input from a capture device, show it on screen and save to a file, using Windows.

I started with this:

Code: Select all

"C:\Program Files\VideoLAN\VLC\vlc.exe" dshow:// :dshow-vdev="USB Video Device" :dshow-adev="Microphone (USB Audio Device)" --sout "#transcode{vcodec=mp4v,acodec=mpga,fps=25,scale=0.5,vb=2100,ab=128,deinterlace}:duplicate{dst=display,dst=std{access=file,mux=mp4,dst=Recording.m4v}"
This works.

However, I would like my output file to be AVI/h264 instead, so I tried this:

Code: Select all

"C:\Program Files\VideoLAN\VLC\vlc.exe" dshow:// :dshow-vdev="USB Video Device" :dshow-adev="Microphone (USB Audio Device)" --sout "#transcode{vcodec=h264,fps=25,scale=0.5}:duplicate{dst=display,dst=std{access=file,mux=avi,dst=Recording.avi}"
This saves the file successfully, but doesn't display on screen (only the first frame is shown).
I am guessing that displaying a transcode of h264 is not possible due to resource (Though Windows Task Manager doesn't show VLC above ~27%). N.B. without fps=25 it works, but the out file is larger than desired.


Fine! I tried switching it, so only the file is transcoded to h264.

Code: Select all

"C:\Program Files\VideoLAN\VLC\vlc.exe" dshow:// :dshow-vdev="USB Video Device" :dshow-adev="Microphone (USB Audio Device)" --sout "#duplicate{dst=display,dst="transcode{vcodec=h264,fps=25,scale=0.5}:dst=std{access=file,mux=avi,dst=Recording.avi}"}"
This displays on screen, but the file isn't transcoded (15 seconds is 3.5GB...)


Can I achieve what I'm trying to do (are there any typos in the above?), or is my machine not high spec enough?

I have looked at https://wiki.videolan.org/Documentation ... _Examples/ and the "Display the input stream, transcode it and send it to a multicast IP address with the associated SAP announce:" example seem relatively similar, but I'm not sure I see the difference. I don't know if the last apostrophe on that example is a mistake?

Alaric
Developer
Developer
Posts: 36
Joined: 27 Apr 2022 18:37

Re: Display on screen, and transcode to file

Postby Alaric » 30 Jun 2022 16:42

This is probably a bug in the transcode pipeline. Could you share your verbose log output (add `-vv` to your command-line) ?
It's unlikely that this is a performance problem from your machine your third example confirms this :)

ChrisFlynn
New Cone
New Cone
Posts: 5
Joined: 29 Jun 2022 17:31

Re: Display on screen, and transcode to file

Postby ChrisFlynn » 04 Jul 2022 14:55

Thanks Alaric.

I tried adding "-vv", but couldn't see anything in terminal, nor when >log.txt. However, as VLC app opens, I was able to go to View > Add Interface > Console; which DOES show more information in that window.

Logs are very log, so due to forum char limit, I have "snip" some parts.

For the 2nd command (transcode, then display) when also adding "-vv":

Code: Select all

VLC media player - 3.0.16 Vetinari Copyright © 1996-2021 the VideoLAN team Warning: if you cannot access the GUI anymore, open a command-line window, go to the directory where you installed VLC and run "vlc -I qt" Remote control interface initialised. Type `help' for help. [000002459584fee0] main interface debug: using interface module "oldrc" [000002459ec14a50] avcodec decoder warning: More than 11 late frames, dropping frame [00000245953e90f0] main mux warning: late buffer for mux input (166001) [00000245953e90f0] main mux warning: late buffer for mux input (184001) [00000245953e90f0] main mux warning: late buffer for mux input (191001) (snip) [000002459ec14a50] avcodec decoder warning: More than 11 late frames, dropping frame [00000245953e90f0] main mux warning: late buffer for mux input (159001) [00000245953e90f0] main mux warning: late buffer for mux input (166001) [000002459ec14a50] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?) [000002459ec14a50] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?) [00000245953e90f0] main mux warning: late buffer for mux input (158001) [00000245953e90f0] main mux warning: late buffer for mux input (150001) [000002459ec14a50] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?) [000002459ec14a50] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?) [00000245953e90f0] main mux warning: late buffer for mux input (158001) [000002459ec14a50] avcodec decoder error: more than 5 seconds of late video -> dropping frame (computer too slow ?) [00000245953e90f0] main mux warning: late buffer for mux input (151001) [00000245953e90f0] main mux warning: late buffer for mux input (144001) (snip)

For the 3rd command (display, then transcode file only) when also adding "-vv":

Code: Select all

VLC media player - 3.0.16 Vetinari Copyright © 1996-2021 the VideoLAN team Warning: if you cannot access the GUI anymore, open a command-line window, go to the directory where you installed VLC and run "vlc -I qt" Remote control interface initialised. Type `help' for help. [000002416a02a300] main interface debug: using interface module "oldrc" [000002416a2d7e20] main video output debug: picture might be displayed late (missing 4 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 31 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 33 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 40 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 45 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 48 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 50 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 60 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 66 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 57 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 50 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 38 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 28 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 18 ms) [000002416a2d7e20] main video output debug: picture might be displayed late (missing 5 ms) [000002416a2d7e20] main video output debug: picture might be displayed late (missing 0 ms) [0000024169c99730] avi mux warning: argg length < 0 l [000002416a2d4b40] main vout display debug: auto hiding mouse cursor [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 24 ms) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 12 ms) [0000024169c99730] main mux warning: late buffer for mux input (1789) [0000024169c99730] main mux warning: late buffer for mux input (399791) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 300 ms) [0000024169c99730] main mux warning: late buffer for mux input (855232) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 756 ms) [000002416a2a7080] main decoder warning: decoder/packetizer fifo full (data not consumed quickly enough), resetting fifo! [0000024169c99730] main mux warning: late buffer for mux input (725000) [000002416a2d7e20] main video output warning: picture is too late to be displayed (missing 627 ms) [0000024169c99730] main mux warning: late buffer for mux input (1216845) [0000024169c99730] avi mux warning: argg length < 0 l (snip)
I did notice today however that the display on screen also stalls every few seconds, which is when the logs started going crazy.

Does this help?

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

Re: Display on screen, and transcode to file

Postby Rémi Denis-Courmont » 05 Jul 2022 20:49

Computer is too slow. You'll need to reduce the frame rate or the resolution of the source capture.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 7 guests