Tv-Browser + WinTVCap_GUI + VLC ?

For talk and Help about everything concerning TV-Browser.
Antworten
swedub

Tv-Browser + WinTVCap_GUI + VLC ?

Beitrag von swedub »

Tv-Browser + WinTVCap_GUI + VLC ?

Hi, this question concerns using Tv-Browser + WinTVCap_GUI to schedule recordings to use VLC as DVB-T tuner
I hope it is ok to post here rather than in the WinTVCap_GUI forum (There is no english section there.)

To in TV-browser schedule recordings for VLC I need a custom WinTVCap_GUI profile. The downloadable profiles does not include one for VLC. So I need to set it up manually. I've gotten command line recording to work in VLC (see
http://forum.videolan.org/viewtopic.php?f=2&t=55779 ; grozea = swedub ). Command line example:

Code: Alles auswählen

C:\Program Files\VideoLAN\VLC\vlc.exe dvb-t:// :dvb-frequency=522000 :dvb-bandwidth=-1 :program=5840 :sout=#duplicate{dst=std{access=file,mux=ps,dst=C:\temp\test.ps}, dst=display}
I need to make a profile in WinTVCap_GUI that includes two variables:
- frequency
- program number

I already have a list with what the two variables above should be for each channel. But the WinTVCap_GUI manual profile creation window only seems to support one variable (%channel%). Is there some workaround to accomplish what I'm after? Can anyone assist me on getting this to work?

edit:
Specifically, this is what the WinTVCap_GUI help box for the start-recording-parameter settings states:
The following parameters are available:
%quality% = recording quality
%file% = file name (the file ending have to be entered after %file%)
%channel% = channel name
%length% or %seconds% = recording duration in seconds
%minutes% = recording duration in minutes
%board% = the number of the tuner to use (for multi tuner environment and applications that support the selection of the tuner like WinTVCap)
%card% = the name of the to using tuner (settings of the tuner list)
Zuletzt geändert von swedub am 13 Feb 2009, 00:05, insgesamt 1-mal geändert.
ds10
Site Admin
Beiträge: 19117
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: Tv-Browser + WinTVCap_GUI + VLC ?

Beitrag von ds10 »

swedub hat geschrieben:I hope it is ok to post here rather than in the WinTVCap_GUI forum
I will accept it this times. ;-)
swedub hat geschrieben:(There is no english section there.)
There is an English section plain viewable on the main site called English Forum, it's just not the first section like here.
swedub hat geschrieben:I need to make a profile in WinTVCap_GUI that includes two variables:
- frequency
- program number

I already have a list with what the two variables above should be for each channel. But the WinTVCap_GUI manual profile creation window only seems to support one variable (%channel%). Is there some workaround to accomplish what I'm after? Can anyone assist me on getting this to work?
Well I have to say that there is no easy way to get it done with the current version, but I could change it. But that would need some time as I don't have time to do it now or in the next weeks. I simply don't see this comming as WinTVCap_GUI was first for analogue recording and there were every frequency a channel.

One way to get it work would be to create a profile for each frequency then the program number can be entered in the WinTVCap.ini. You will be able to select the used profile for each channel in the settings of WinTVCap_GUI at the tab Channel-Application. Another way would be to create a wrapper for the recordings with AutoHotkey that hold an ini file that contains the frequency and program number for each channel to read it from when parsed a unique name for the channel and then start the recording with VLC.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
swedub

Re: Tv-Browser + WinTVCap_GUI + VLC ?

Beitrag von swedub »

Thanks for the quick reply. Ok, I'll try to make a wrapper. Will post back here when I'm done.
swedub

Re: Tv-Browser + WinTVCap_GUI + VLC ?

Beitrag von swedub »

Ok, made a wrapper just now. Works fine! Messy code though - will clean it and post later.

A new problem:

VLC can very quickly start recordings and change frequencies so I have disabled any delay time between WinTVCap and VLC. I have also disabled any padding (i.e. start/stop recording x minutes before/after the programs time listings).

But tv-browser still gives an error message about "conflict" when scheduling both one program and the program right after it. Two tasks are still created but the second recording never starts. It seems that WinTVCap_GUI ignores it because the first is still running.

Example:
10:10-12:00 channel 1
12:00-12:45 channel 2 <--- not recorded due to conflict!

Can I set tv-browser/WinTVCap_GUI to ALWAYS let later recordings override earlier (ongoing) recordings? Like how it works when I in WinTVCap_GUI manually start a recording when another is still running. It would be even better with two options: (1) override in adjacent cases, (2) override in both adjacent and overlapping cases

Example of overlapping case:
10:10-12:20 channel 1 ---> forced to stopp 12:00
12:00-12:45 channel 2 ---> starts at 12:00

(note: My wrapper already shuts down any previous VLC session before starting a new recording so no problem there)

(note: I also noticed that I can manually force a recording to override the previous by changing its priority variable. But I want automation.)

Oh and by the way, I was wrong about the english forum section for WinTVCap_GUI of course :oops: What is worse: I see that I have actually posted in it before, but had forgotten that now :shock: :lol:
Zuletzt geändert von swedub am 13 Feb 2009, 13:57, insgesamt 1-mal geändert.
ds10
Site Admin
Beiträge: 19117
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: Tv-Browser + WinTVCap_GUI + VLC ?

Beitrag von ds10 »

You have to have at least a minute between two recordings because the start of a recording is at full minutes and it takes a little time to then start the recording itself, so the running recording is on at the end full minute. The second recording gets this and didn't start unless it has a higher priority than the first recording.

Go to Scheduler settings in WinTVCap_GUI and set the entry Priority expires after hours: to 0. Then all following recordings will stop running recordings to get the access to the card but you will lose the priority function of WinTVCap_GUI.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
swedub

Re: Tv-Browser + WinTVCap_GUI + VLC ?

Beitrag von swedub »

ok, I'll try that right now.
edit: works fine! Thanks.
Idea: when the "priority expires after hours" is set to 0 then it would make sense if TV-Browser did not show the conflict error message when scheduling. Since the user has actively made the choice to override the default setting.
ds10
Site Admin
Beiträge: 19117
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: Tv-Browser + WinTVCap_GUI + VLC ?

Beitrag von ds10 »

swedub hat geschrieben:Idea: when the "priority expires after hours" is set to 0 then it would make sense if TV-Browser did not show the conflict error message when scheduling. Since the user has actively made the choice to override the default setting.
I'm not sure that you can assume that the changing of this setting reflects the setting not to be warned about conflicts. But whatever, there is a setting to disable the warning right now: WinTVCap_GUI->Options->Settings, Scheduler settings, Warning if not enough tuner exist to record the scheduled task. The tasks are still colored blue in the Tasklist but you will not get a hint about that on scheduling.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Gast

Re: Tv-Browser + WinTVCap_GUI + VLC ?

Beitrag von Gast »

Here is the wrapper for WinTVCap_GUI to record in VLC, if anyone else needs it. Written in autohotkey, so Windows only.

Instruction:
1. Set up the channels in tv-browser + WinTVCap_GUI as usual so that when the user schedules in tv-browser then WinTVCap_GUI is passed a command that includes filename, channel, starttime, duration and so on.

2. install VLC ( http://www.videolan.org/vlc/ )

3. in WinTVCap_GUI: options > applications edit > add:
name: vlc_ahk_wintvcap
path: [some folder]\vlc_ahk.exe
parameters: "%channel%_____%file%_____%seconds%"

4. save the code below to as plain text file named vlc_ahk_wintvcap.ahk in [some folder] (same folder as above!)

5. open a new textfile in notepad.
On line 1 put the path to VLC.
On line 2 put the folder to save recordings in.
On line 3,4,5... put each TV channels frequency, program number and (optionally) channel name. Separate them with tabs (must use tabs, not press space multiple times). Put them in the same order as in WinTVCap_GUI !
Example:
C:\Program Files\VideoLAN\VLC\vlc.exe
C:\my recordings\
522000 5840 SVT1
522000 5640 SVT2
Frequency and program values varies with your geographical location. I found them by installing another TV-recording program, ProgDVB, and doing a channel scan. The values were then visible on each channels properties. But there's likely some other easier way to get them.

Save the notepad file to [some folder] as vlc_ahk_wintvcap.ini

6. install autohotkey. Then right click vlc_ahk_wintvcap.ahk and choose compile. You then get vlc_ahk_wintvcap.exe . You can now de-install autohotkey if you
wish.

end of instruction

Code: Alles auswählen

#singleinstance, force
#Persistent
;-- expected command line input:  %channel%_____%file%_____%seconds%

StringReplace, 1, 1, _____,£, All
StringSplit, xx, 1,£

xx2 := RegExReplace(xx2, "\d\d\d\d_\d\d_\d\d_\d\d_\d\d_\d\d_(.*)", "$1_"A_YYYY A_MM A_DD "_" A_Hour A_Min)
;-- change WinTVCap defaul no-name file name format to a shorter one

Loop, Read, %A_Scriptdir%\vlc_ahk_wintvcap.ini
{
if A_index = 1
  vlcpath = %A_LoopReadLine%

if A_index = 2
  savefolder = %A_LoopReadLine%

if A_index < 3
 continue
StringSplit, y, A_LoopReadLine,%A_Tab%
indexvar := A_index - 2
c%indexvar% = :dvb-frequency=%y1% :dvb-bandwidth=-1 :program=%y2%
}
ch := c%xx1%

; ---- check variables ----
 ifnotexist %vlcpath% 
{
msgbox,  error: set vlcpath on line 1 in vlc_ahk_wintvcap.ini`n`nVLC path = %vlcpath%`nsavefolder = %savefolder%
 exitapp
 }
 
 ifnotexist %savefolder%
{
msgbox,  error: set savefolder on line 2 in vlc_ahk_wintvcap.ini`n`nVLC path = %vlcpath%`nsavefolder = %savefolder%
 exitapp
 }
 if InStr(savefolder, "\") != StrLen(savefolder)		;-- if path end backslash missing, add it
 savefolder = %savefolder%\
 
 if xx2 =
 xx2 := A_now 
 
 if xx1 =
{
 msgbox,  error: no channel number!
 exitapp
 } 
  
runwait "%vlcpath%" vlc://quit		;-- shut down previous
run, "%vlcpath%" dvb-t:// %ch% :sout=#duplicate{dst=std{access=file`,mux=ps`,dst="%savefolder%%xx2%.mpg"}} , , Min, pidvar
WinWait ahk_pid %pidvar%
if xx3 !=							;-- If parameters included duration in seconds, then start a timer. Else record until manual stop
 if xx3 != `%seconds`%
  SetTimer, rectimer, 1000
return

rectimer:
IfWinNotExist, ahk_pid %pidvar%
 exitapp
xcount += 1
if xcount < %xx3%
 return
 run "%vlcpath%" vlc://quit		;-- close program, WinTVCap autocloses thereafter
exitapp
return
swedub

Re: Tv-Browser + WinTVCap_GUI + VLC ?

Beitrag von swedub »

I thought I was still logged in when posting the above, sorry for the confusion. :)

One more thing: for those that use VLC a lot for playback and also wish to have it set to single instance then using a separate copy of VLC portable only for DVB-T recording purposes might be a good idea. I haven't tried that yet but think it will allow simultaneous playback in "regular" VLC and DVB-T recording in portable VLC. That would decrease the risk of accidentally stopping a recording by starting playback of some other video.

EDIT: an error in step 3 in the instruction above: when creating the profile, the path should of course be [some folder]\vlc_ahk_wintvcap.exe (not vlc_ahk.exe) so that it matches the name further down in the instruction.
Antworten