Riddle me this Batman ...

*nix specific usage questions
lewtwo
Blank Cone
Blank Cone
Posts: 20
Joined: 22 Sep 2014 07:44
VLC version: varies
Operating System: windows, linux, andr
Location: Houston, Texas, USA

Riddle me this Batman ...

Postby lewtwo » 23 Sep 2014 16:27

OS Description: Ubuntu 14.04.1 LTS
VLC media player 2.1.4 Rincewind (revision 2.1.4-0-g2a072be)

I am trying to write a bash script to transcribe videos. More specifically a stream from my HDHomeRun Tuner. Problem is I need to scale the video stream down and I would like to do it as it is recording.

This works ---
vlc http://192.168.0.201:5004/auto/v8.1?dlna --run-time=30 --play-and-exit --sout=#transcode{vcodec=mp2v}:std{access=file,mux=ts,dst='/home/user/Videos/test.ts'
Note the missing terminating delimiter "}"

This does not ---
vlc http://192.168.0.201:5004/auto/v8.1?dlna --run-time=30 --play-and-exit --sout=#transcode{vcodec=mp2v}:std{access=file,mux=ts,dst='/home/user/Videos/test.ts'}
Or this
vlc http://192.168.0.201:5004/auto/v8.1?dlna --run-time=30 --play-and-exit --sout=#transcode{vcodec=mp2v}:std{access=file,mux=ts,dst='/home/user/Videos/test.ts'}
This line DOES work in the Windows version (with dst='c:\tempwork\test.ts')
Or this
vlc http://192.168.0.201:5004/auto/v8.1?dlna --run-time=30 --play-and-exit --sout=#transcode{vcodec=mp2v}:std{access=file,mux=ts,dst='/home/user/Videos/test.ts'

I have tried nearly ever variation that I can image. The error is always the same:
# VLC media player 2.1.4 Rincewind (revision 2.1.4-0-g2a072be)
# [0x1002118] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
# [0x7f71d8000bd8] main stream output error: stream chain failed for `transcodescodec=dvbs:stddst=/home/user/Videos/test.ts'
# [0x7f71e8008db8] main input error: cannot start stream output instance, aborting
# [0x1016378] main playlist: end of playlist, exiting

OK lets see it it works through the interactive. JOY, JOY, JOY !!! So I captured the sout parameter from the message window.
sout=#transcode{vcodec=mp2v,vb=800,scale=0.5,scodec=dvbs}:std{access=file{no-overwrite},mux=ts,dst='/home/user/Videos/test.ts'}
So I stuffed that into the command line ---- repeat of the above referenced error.

FLAME ON: Next I tried to upgrade to the latest version of VLC (2.1.5) to see if the problem was resolved. Sadly it seems that conical does not maintain updates for VLC and there is no way short of changing the OS to upgrade or downgrade. You are stuck with whatever version of VLC (stable or otherwise) was available when that version of UBuntu was packaged. FLAME OFF :?

So I then tried the same script on another Ubuntu install (Version 12.0.1). Same problem.

At this point I am guessing there is a serious unknown problem with VLC's command line parsing under Ubuntu --- but it could just be ignorance and inexperience on my part. :oops:

Questions: :?:
1) Has anyone tried using the VLC CLI on Ubuntu and gotten it to work with --sout parameters ?
2) Is there any version of Linux that allows a choice of the version of VLC (short of recompiling it from the sources)?
3) Any suggestions other than dumping Linux and going back to Windows ?

hornerg
Blank Cone
Blank Cone
Posts: 13
Joined: 20 Feb 2014 22:49

Re: Riddle me this Batman ...

Postby hornerg » 23 Sep 2014 17:59

OS Description: Ubuntu 14.04.1 LTS
1) Has anyone tried using the VLC CLI on Ubuntu and gotten it to work with --sout parameters ?
Yes. (well, linux mint 17, actually). If running from script you need to enclose the sout string in quotes or else escape the brackets like \{...\}. Otherwise bash thinks its a script being called.

If you find out how to re-size it, please post here! Tearing my hair out with canvas, aspect ratios etc.

HTH

My last line with parameters:
vlc -v v4l2:// $vdev $vinput $adev $width $height $aspect $cache :run-time="$runfor" \
:sout="#transcode{$vcodec,$acodec,audio-sync}:duplicate{dst=display,dst=standard{access=file,mux=ps,dst=""$filepath""$filename"".mpg""}}" --play-and-exit

lewtwo
Blank Cone
Blank Cone
Posts: 20
Joined: 22 Sep 2014 07:44
VLC version: varies
Operating System: windows, linux, andr
Location: Houston, Texas, USA

Re: Riddle me this Batman ...

Postby lewtwo » 23 Sep 2014 23:30

:D BingGO !!!!! :D
:P Thank Thee :P
You hit ye old nail precisely on the head (and it was due to my ignorance :oops: ).
My head was getting sore from banging it against this particular brick wall.

If any of the admins are reading this:
This should be added as a caveat to the VLC wiki on the CLI interface or perhaps I missed it. That is a very longgggggggggg page.

If I understand (and that is highly questionable) the optional parameters correctly then you can control the output aspect ratio via the height and width parameters. If you specify only one of the above then the system scales the other to match the original input. If you specify both then you get whatever ratio that resolves to.

Example (1):
an input stream of 1920x1080 has a ratio of 16:9
simple direct scaling by 1/2640
the result is 960x480 with a 16:9 aspect ratio for the output stream
vlc http://192.168.0.201:5004/auto/v8.1?dlna --run-time=30 --play-and-exit "--sout=#transcode{vcodec=mp2v,scale=0.5}:std{access=file{no-overwrite},mux=ts,dst='/home/user/Videos/Example_1.ts'}"

Example (2):
an input stream of 1920x1080 has a ratio of 16:9
with a output width of 640 and height of 360
the result is 16:9 aspect ratio for the output stream
vlc http://192.168.0.201:5004/auto/v8.1?dlna --run-time=30 --play-and-exit "--sout=#transcode{vcodec=mp2v,width=640,height=360}:std{access=file{no-overwrite},mux=ts,dst='/home/user/Videos/Example_2.ts'}"

Example (3):
an input stream of 1920x1080 has a ratio of 16:9
with a output width of 848 and height not specified
the result is a height 476 for a 16:9 aspect ratio for the output stream
vlc http://192.168.0.201:5004/auto/v8.1?dlna --run-time=30 --play-and-exit "--sout=#transcode{vcodec=mp2v,width=848}:std{access=file{no-overwrite},mux=ts,dst='/home/user/Videos/Example_3.ts'}"

Example (4):
an input stream of 1920x1080 has a ratio of 16:9
with a output width of 800 and height of 600
the result is a 4:3 aspect ratio for the output stream (I think)
(and why would anyone want to do that?)
vlc http://192.168.0.201:5004/auto/v8.1?dlna --run-time=30 --play-and-exit "--sout=#transcode{vcodec=mp2v,width=800,height=600}:std{access=file,mux=ts,dst='/home/user/Videos/Example_4.ts'}"

All of the above have been confirmed to work but I am getting the following errors/warnings:
#[0xb0903730] access_http access error: error: HTTP/1.1 406 Not Acceptable
#Xlib: extension "XFree86-DRI" missing on display ":0.0".
#libva: va_getDriverName() returns -1

I have not yet looked at cropping.
There are several OTA stations that broadcast old movies in "pillarbOX" and worse yet "Windowbox" so that is on my to-do list.
It seems a bit more complex. Among other things you need fore knowledge of how much to crop and where.

Why double quotes:
I am trying to write a front end to use TitanTV "program.tvpi" files to schedule recording via VLC. I want it to work on both Windows and Linux. One might call it a simple "VLC PVR" --- well I am calling ti that. I used double quotes around the --sout string because that approach should work on both platforms (consistency is next to godliness). Having the option to scale the output stream can save a very time consuming post-processing step (not to mention a lot of disk space).

---cheers and many thanks

hornerg
Blank Cone
Blank Cone
Posts: 13
Joined: 20 Feb 2014 22:49

Re: Riddle me this Batman ...

Postby hornerg » 24 Sep 2014 00:06

YW, and thanks for the suggestions which I'll try tomorrow, but my problem is a 720x576 stream which needs to be recorded at 16:9 (digital TV and DVD video in general does not use square pixels).

I have successfully commanded the capture card to output 720x406, but that's losing some quality and it's not really how it should be done. Vlc in Windows does what I want no sweat - I get a file with 16:9 encoded in the frame headers, but in linux it behaves differently and I haven't been able to figure whether it's vlc or v4l2 that's the problem.

lewtwo
Blank Cone
Blank Cone
Posts: 20
Joined: 22 Sep 2014 07:44
VLC version: varies
Operating System: windows, linux, andr
Location: Houston, Texas, USA

Re: Riddle me this Batman ...

Postby lewtwo » 25 Sep 2014 05:11

The simple things are sometimes the most challenging.

You said you were using Mint. I decided to give LMDE a try (as a VMware virtual machine) to see if I get get the latest version of VLC loaded. no joy yet....


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 8 guests