Any way to automatically detect / add video files on VLC Streamer Helper?

196 views
Skip to first unread message

Spiro Kourtessis

unread,
Mar 3, 2019, 1:31:52 PM3/3/19
to Hobbyist Software Forum
Problem summary:

I have a DVR running on my Mac which records full resolution transport stream mpeg-2 HD video. I can add these files to VLC Streamer Helper via the mobile app or Mac app, but I'd like to know if there is a CLI, API or other way to add files to be converted. I am technical so I can automate as needed. I prefer not to have to automate via VLC Streamer Helper UI (click the Add File and navigate). Ideally, I'd like to define a set time after midnight, look for recently added files in recording directory and add these files so they are ready for streaming / downloading by the following morning. 


Confused Vorlon

unread,
Mar 3, 2019, 1:46:19 PM3/3/19
to Hobbyist Software Forum
You can do this with some tech skills - but my first question would be 'why?'

If you convert everything in advance, then that will use a bunch of storage space for very little advantage.
Why not just add what you want to watch from the iPad/iPhone when you want to watch it.

Typically you'll only wait about 10seconds for the streaming to start

--

Assuming you do want to add things, then you can add items to the queue by saving an appropriate xxx.params.txt file in the _queue directory

fire up the helper, open the folders tab and click on 'show working directory'. You'll see a _queue folder there with a readme.txt file describing the details

VLC Streamer uses exactly this process, so you can add a few movies, then go into the queue folder and see what has been generated. That'll give you an easy template to follow.

Spiro Kourtessis

unread,
Mar 4, 2019, 8:48:21 PM3/4/19
to Hobbyist Software Forum
There are few reasons I want to automate this. 

1. I prefer to allocate the CPU for encoding on my desktop overnight as opposed to during the day when I want to watch. The computer is shared in the family.
2. I'd like to have the option to download encoded files in a few minutes time in the morning to take with me offline (airplane, somewhere where LTE is not available, times when I am running low on cellular data for the month). 
3. Sometimes I'll watch some of a show on my TV. If I start encoding at the time I want to watch on an iOS device, I can't scrub to the place I left off since that part is not encoded yet. I have to wait a lot longer then the initial 10 sec needed to get a stream started. 
4. Similar to 3 above, there are times when I want to just skip to a part of a show. Say I want to catch an interview on 60 Minutes, and it's the 3rd segment on the show. Again, I can't just encoding and immediately skip 40 min into the show to watch the part I want. 

BTW, while I was encoding a file, I did ps aux | grep VLC and copied the CLI command used to encode the file. I then aborted the encoding and tried to paste that command back into a bash prompt, but it failed:


This is an example CLI I tried:


/Applications/VLCStreamer.app/Contents/Resources/VLC/VLC.app/Contents/MacOS/VLC --ignore-config -I dummy /Volumes/Data/TV-Record/Gotham-2019-02-28-20-00-05.ts vlc://quit --sout=#transcode{vcodec=h264,soverlay,acodec=aac,channels=2,venc=x264{profile=baseline,level=2.2,keyint=90,bframes=0,ref=1,nocabac},width=640,vb=600,ab=40,audio-sync,deinterlace}:std{access=livehttp{seglen=10,index="/Users/spiro/Library/Application\ Support/VLCStreamer/Streams/Gotham-2019-02-28-20-00-05/stream.m3u8",index-url=stream-###.ts},mux=ts{use-key-frames},dst="/Users/spiro/Library/Application\ Support/VLCStreamer/Streams/Gotham-2019-02-28-20-00-05/stream-###.ts"} --sout-ffmpeg-strict=-2 -vvv


Got:


[0x50d548] main stream output debug: using sout chain=`transcodedeinterlace:stddst=/Users/spiro/Library/Application\ Support/VLCStreamer/Streams/Gotham-2019-02-28-20-00-05/stream-###.ts'

[0x50d548] main stream output debug: stream=`stddst=/Users/spiro/Library/Application\'

[0x50d878] main stream out debug: looking for sout stream module: 0 candidates

[0x50d878] main stream out debug: no sout stream module matched "stddst=/Users/spiro/Library/Application\"

[0x50d878] main stream out debug: TIMER module_need() : 0.101 ms - Total 0.101 ms / 1 intvls (Avg 0.101 ms)

[0x50d878] main stream out debug: destroying chain... (name=(null))

[0x50d878] main stream out debug: destroying chain done

[0x50d548] main stream output error: stream chain failed for `transcodedeinterlace:stddst=/Users/spiro/Library/Application\ Support/VLCStreamer/Streams/Gotham-2019-02-28-20-00-05/stream-###.ts'

[0x50ab88] main playlist debug: finished input

[0x406a88] main input error: cannot start stream output instance, aborting



I tried both with a \ in 'Application\ Support' and without as 'Application Support'. I also tried in a different path w/o whitespace: 

/Applications/VLCStreamer.app/Contents/Resources/VLC/VLC.app/Contents/MacOS/VLC --ignore-config -I dummy /Volumes/Data/TV-Record/Gotham-2019-02-28-20-00-05.ts vlc://quit --sout=#transcode{vcodec=h264,soverlay,acodec=aac,channels=2,venc=x264{profile=baseline,level=2.2,keyint=90,bframes=0,ref=1,nocabac},width=640,vb=600,ab=40,audio-sync,deinterlace}:std{access=livehttp{seglen=10,index="/Users/spiro/tmp/Gotham-2019-02-28-20-00-05/stream.m3u8",index-url=stream-###.ts},mux=ts{use-key-frames},dst="/Users/spiro/tmp/Gotham-2019-02-28-20-00-05/stream-###.ts"} --sout-ffmpeg-strict=-2 -vvv


[0x416ea8] main playlist debug: adding item `Gotham-2019-02-28-20-00-05.ts' ( file:///Volumes/Data/TV-Record/Gotham-2019-02-28-20-00-05.ts )

[0x416ea8] main playlist debug: no fetch required for (null) (art currently (null))

[0x500ee8] main interface debug: looking for interface module: 1 candidate

[0x41d0a8] main input debug: Creating an input for 'Gotham-2019-02-28-20-00-05.ts'

[0x500ee8] dummy interface: using the dummy interface module...

[0x500ee8] main interface debug: using interface module "dummy"

[0x500ee8] main interface debug: TIMER module_need() : 0.502 ms - Total 0.502 ms / 1 intvls (Avg 0.502 ms)

[0x416ea8] main playlist debug: processing request item: null, node: Playlist, skip: 0

[0x416ea8] main playlist debug: rebuilding array of current - root Playlist

[0x416ea8] main playlist debug: rebuild done - 2 items, index -1

[0x416ea8] main playlist debug: starting playback of the new playlist item

[0x416ea8] main playlist debug: resyncing on Gotham-2019-02-28-20-00-05.ts

[0x416ea8] main playlist debug: Gotham-2019-02-28-20-00-05.ts is at 0

[0x416ea8] main playlist debug: creating new input thread

[0x41bbc8] main input debug: Creating an input for 'Gotham-2019-02-28-20-00-05.ts'

[0x504078] main stream output debug: using sout chain=`transcodedeinterlace:stddst=/Users/spiro/tmp/Gotham-2019-02-28-20-00-05/stream-###.ts'

[0x504078] main stream output debug: stream=`stddst=/Users/spiro/tmp/Gotham-2019-02-28-20-00-05/stream-###.ts'

[0x504318] main stream out debug: looking for sout stream module: 0 candidates

[0x504318] main stream out debug: no sout stream module matched "stddst=/Users/spiro/tmp/Gotham-2019-02-28-20-00-05/stream-###.ts"

[0x504318] main stream out debug: TIMER module_need() : 0.082 ms - Total 0.082 ms / 1 intvls (Avg 0.082 ms)

[0x504318] main stream out debug: destroying chain... (name=(null))

[0x504318] main stream out debug: destroying chain done

[0x504078] main stream output error: stream chain failed for `transcodedeinterlace:stddst=/Users/spiro/tmp/Gotham-2019-02-28-20-00-05/stream-###.ts'

[0x416ea8] main playlist debug: finished input

[0x41bbc8] main input error: cannot start stream output instance, aborting

Note file exists: 


mac-mini:~/scripts#ls -lah /Volumes/Data/TV-Record/Gotham-2019-02-28-20-00-05.ts

-rw-r--r--  1 spiro  staff   4.8G Feb 28 21:00 /Volumes/Data/TV-Record/Gotham-2019-02-28-20-00-05.ts


Confused Vorlon

unread,
Mar 8, 2019, 7:27:35 AM3/8/19
to Hobbyist Software Forum
the easiest way to check your command would be to try adding the file through the standard interface. That will create a folder and put the cmd.txt in the folder.

you can compare that to your own command

having said that - the queue folder is the mechanism designed for this job, so that's the way I would do it!

Spiro Kourtessis

unread,
Mar 10, 2019, 7:18:30 PM3/10/19
to Hobbyist Software Forum
Thanks!

Although this worked in terms encoding the input file, the final result doesn’t end up being listed as an encoded file in the iOS app. However this got me poking around under the Streams directory and I discovered the _Queue directory. In it there is a Readme text file which explains how it’s a simple API for adding files to be encoded. You just need to generate a file of parameters (taking an example from a previously encoded file with modification for the input file name and a unique systemId) and place it under _Queue. This will encode the file and it will show up in iOS.

Confused Vorlon

unread,
Mar 11, 2019, 6:01:00 AM3/11/19
to hobbyist-so...@googlegroups.com
If only someone had mentioned the queue directory in their first and second response ;)
Reply all
Reply to author
Forward
0 new messages