sout to a file, questions

About encoding, codec settings, muxers and filter usage
quu
Blank Cone
Blank Cone
Posts: 55
Joined: 14 Jul 2010 19:09

sout to a file, questions

Postby quu » 19 Aug 2010 21:19

I have some questions about streaming to a file. I need to be able to test various encoder tools vs my target platform (VLC). I want to make sure that the A/V sync is not skewed at the encoder level. I was told by a dev on IRC that I could use the -sout to test that... so

1) Is the audio and video that is output from -sout identical (before any encoding, etc) to what would would be displayed on the screen and played via the sound card?
1a) Is the audio and video sync identical?
1b) If i add the postproc video filter to the command line, will it be applied to the output of -sout, or do I need to add that filter to the -sout string?
1c) If I add audio normalization to the command line, will that reflect in the -sout audio, or do I need to add it to the -sout string

2) When writing to a file, does VLC skip frames if it is running behind? Ie if there is 4 or 5 of these commands running in parallel or this is being run on an older machine, would the slowdown cause frame skips, or does the lack of an externally forced "clock" allow VLC to process at its own pace?

3) Is it possible to have vlc wait until the file is done processing before returning control back to the command prompt. right now if I want to convert 20+ files, if I build a batch file to run the commands the second video starts processing before the first is done. Maybe it is possible to have multiple -sout commands in a command line, one for each file? (right now I play a single video and add a vlc://quit command to the end of the playlist)

4) If the goal is to test the A/V sync of the rendered video and the quality of the encoder, what is the best -sout string to use? I need the audio and video to be lossless... uncompressed if possible. I also need to be able to inspect the file, either in VirtualDub, or via AVISynth. I was told on IRC not to use the AVI muxer, as it is broken. So far the optimal solution seams to be

Code: Select all

vlc bsgtest.mpg --sout=#transcode{vcodec=HFYU,acodec=s16l}:file{dst="test-huff-wav.mkv"} vlc://quit
and then I have to load that MKV into AVISynth's directshow filter to access it.

random
Cone that earned his stripes
Cone that earned his stripes
Posts: 155
Joined: 09 Jul 2008 11:42

Re: sout to a file, questions

Postby random » 20 Aug 2010 01:05

1. of course
2. yes see pref, in sout transcode 'hurry up' option.
3. you can try -I dummy
4. you can check the pref, there's Set QP option under transcode/H.264 encoder

quu
Blank Cone
Blank Cone
Posts: 55
Joined: 14 Jul 2010 19:09

Re: sout to a file, questions

Postby quu » 21 Aug 2010 20:12

-I dummy does nto stop the command line in windows, it just pops up a second window

andd i don't want hurry up... so it is good it is off by default

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

Re: sout to a file, questions

Postby Rémi Denis-Courmont » 21 Aug 2010 20:30

1) Yes, unless you specify any transcode stanza. The signals are merely multiplexed again.
But then you cannot use audio and video filters, including normvol and postproc. For that, by design, you need to decode, filter and reencode.
2) No, unless you try to render or stream the video at the same time. If you are merely converting/saving to disk, VLC will run at the maximum speed permitted by the CPU and the hard drive, rather than real-time speed. This should prevent any loss.
3) That is the default behaviour on all systems except Windows. On Windows, you would need to recompile VLC as a console application.
4) There is no encoder if you decode to raw. This question makes no sense.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

quu
Blank Cone
Blank Cone
Posts: 55
Joined: 14 Jul 2010 19:09

Re: sout to a file, questions

Postby quu » 23 Aug 2010 06:59

4) There is no encoder if you decode to raw. This question makes no sense.
what I am trying to do is export a lossless copy of what would have been played on the screen/speakers if i had played the file normally through VLC
If I run the command

Code: Select all

%VLC% --video-filter=postproc --postproc-q=6 --norm-buff-size=10 --norm-max-level=200.000000 --equalizer-preamp=0.000000 test1.avi vlc://quit
the test1.avi file will play with filtering and audio normalization on my screen... I want to capture that to a file that I can then inspect afterwords in a third party tool, such as VirtualDub or AVISynth.

I have about 60+ copies of the same original uncompressed AVI file that has been compressed with different codecs (audio and video) encoders and muxed with different containers.

I want to compare the audio and video sync (and then later quality) of each of these options, when played back in VLC. I was told not to use AVI (and when I tried, they were broken)

I have tried --sout=#transcode{vcodec=HFYU,acodec=s16l}:file{dst="test1-huff-wav.mkv"} which created an MKV file that plays perfectly in VLC and nothing else i can find.
I have tried "--sout=#transcode{vcodec=h264,acodec=s16l}:file{dst="test1-h264-wav.mkv"} --sout-x264-crf=0" which created a VERY small (100 megs vs the huffyuv being 2 gig???) file that vlc has trouble playing right
I have tried "--sout=#transcode{vcodec=h264,acodec=s16l}:file{dst="test1-h264-wav.mp4"} --sout-x264-crf=0" which created an mp4 file with no audio
I have tried "--sout=#transcode{vcodec=h264,acodec=s16l}:std{access=file,mux=ps,dst="test1-h264-wav.ps.mpg"} --sout-x264-crf=0" which created a file that was slightly larger than the mp4, but same thing, no audio
(and I am not sure those h.264 were losslessly encoded... start with a 4 gig uncompressed YUV avi file, 2 gig huffyuv, and h.264 crf 0 is 100 megs?)

so please... please help me... i just need an -sout string that I can use to export what would be played from VLC into a file that I can analyze?

quu
Blank Cone
Blank Cone
Posts: 55
Joined: 14 Jul 2010 19:09

Re: sout to a file, questions

Postby quu » 23 Aug 2010 15:14

here is another example

Imagine I have a real media file and I want to use it in Adobe Premiere for a project. Premiere can't read the .rm file itself, so I would use VLC and the -sout command to export it into a format that can be used by Premiere. As Premiere can read AVISynth scripts, if I can come up with a format that can be read in an .avs file, that could work also. And, what ever format I export it in, from VLC, i want to be lossless, so I lose as little quality as possible.

See, if someone was asking for help from VLC that way, what -sout string would work? (I also tried doing -vout=yuv and even included the --no-hurry-up and the pure yuv export dropped frames)

I tried "--sout=#transcode{vcodec=RV24,acodec=s16l}:file{dst="test-raw.mkv"}" but the resulting mkv file was audio only
I tried "--sout=#transcode{vcodec=RV24,acodec=s16l}:file{dst="test-raw.avi"}" but the resulting avi file was broken, would crash VirtualDub during opening, and vlc, when it tried to open it, could only get half way through

quu
Blank Cone
Blank Cone
Posts: 55
Joined: 14 Jul 2010 19:09

Re: sout to a file, questions

Postby quu » 23 Aug 2010 20:28

I have a solution that works now... I am using 1.1.3 win32

--sout=#transcode{vcodec=HFYU,acodec=s16l}:std{access=file,mux=ffmpeg{mux=avi},dst=test-huff-raw.avi}

that exports an AVI file that can be read in virtualdub, etc (I just need huffyuv 2.1.1 installed)... I tried using the RV24 vcodec (which is supossed to be uncompressed RGB video) but it did not encode a video track... not sure why, but i don't care that much... the above sout string lets me export an lossless copy of the playback so I can compare things. the only strange part is that resulting file is one frame short. My original sample test file is 7200 frames long, while the export is 7199 frames long... the sync is perfect, just the very absolute last frame is missing

I can live with that


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 11 guests