Re: [vdr] Race condition when executing recording hook

2017-12-14 Thread Teemu Suikki
Yeah, I have the same issue with my Comskip setup.

Ideally, I think "after" hook should be called only after the timer is
really finished? It's not really "after" if VDR is soon restarting it.

By the way, instead of markad you could try comskip:
http://www.kaashoek.com/comskip/

It's much better in my experience, and is actively developed. It
generates (slightly invalid) VDR syntax with "output_vdr=1" option in
the .ini file.


2017-12-14 13:08 GMT+02:00 Mikko Tuumanen :
> torstaina 14. joulukuuta 2017 8.26.29 EET Harald Milz kirjoitti:
>> I don't know how to handle this properly. My suggestion would be to ignore
>> the channel pid change during an active recording on this channel, and
>> defer the change until the recording is finished _if_ "-r something" is set
>
> How about starting recording hooks with "pidchange" when stopping is caused by
> pid change and "after" only when recroding has stopped because the timer end
> time has been reached?
>
>
> YLE channels change their pids all the time. Different programmes have
> different sets of audio and subtitle pids. Ignoring a pid change might mean
> missing a subtitle or audio track from the recording.
>
> Ideally VDR should be able to add/remove pids from ongoing recording without
> temporarily stopping it. Couple of years ago I tried to see how adding new
> pids on the fly could be done, but it was not trivial.
>
> For YLE channels, pid changes are frequent but predictable. One could stop VDR
> from changing pids automatically and set all the possible pids statically to
> channels.conf. But if some other broadcaster also changes pids frequently but
> in an unpredictable way, then this doesn't help and pid changes mustn't be
> ignored.
>
>
>
>
>
> ___
> vdr mailing list
> vdr@linuxtv.org
> https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr



-- 
Teemu Suikki
http://www.z-power.fi/

___
vdr mailing list
vdr@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Race condition when executing recording hook

2017-12-14 Thread Mikko Tuumanen
torstaina 14. joulukuuta 2017 8.26.29 EET Harald Milz kirjoitti:
> I don't know how to handle this properly. My suggestion would be to ignore
> the channel pid change during an active recording on this channel, and
> defer the change until the recording is finished _if_ "-r something" is set

How about starting recording hooks with "pidchange" when stopping is caused by 
pid change and "after" only when recroding has stopped because the timer end 
time has been reached?


YLE channels change their pids all the time. Different programmes have 
different sets of audio and subtitle pids. Ignoring a pid change might mean 
missing a subtitle or audio track from the recording.

Ideally VDR should be able to add/remove pids from ongoing recording without 
temporarily stopping it. Couple of years ago I tried to see how adding new 
pids on the fly could be done, but it was not trivial.

For YLE channels, pid changes are frequent but predictable. One could stop VDR 
from changing pids automatically and set all the possible pids statically to 
channels.conf. But if some other broadcaster also changes pids frequently but 
in an unpredictable way, then this doesn't help and pid changes mustn't be 
ignored. 





___
vdr mailing list
vdr@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] Race condition when executing recording hook

2017-12-14 Thread Klaus Schmidinger

On 14.12.2017 08:26, Harald Milz wrote:

I don't know how to handle this properly. My suggestion would be to ignore the
channel pid change during an active recording on this channel, and defer the
change until the recording is finished_if_  "-r something" is set on the
command line.


If you ignore the PID change, you might risk getting a broken or incomplete 
recording.

Klaus

___
vdr mailing list
vdr@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] Race condition when executing recording hook

2017-12-13 Thread Harald Milz
Hi everyone,

I finally managed to pull myself together and install markad-0.1.4 on Ubuntu
14.04.5 LTS and vdr-2.2.0. Not trivial for me because the markad sources
needed patching in order to compile and link properly. Different story - if
someone wants a clue just drop me a note. 

When playing around with markad last night, I noticed that there is a catch
with the combination of an active recording, changing pids and a recording
hook being configured. Look at the syslog snippet below. The recording is
started, then all of a sudden the channel pids change, after which VDR stops
the recording for a very short moment and restarts it accordingly. No problem
for the recording itself because only a few frames will be missing. 

But when stopping, the recording hook is invoked with "after", upon which
markad starts and tries to analyze the recording fragment. Now markad will
handle this situation gracefully because it will be invoked with "after" again
anyway when the recording is finished after a while, overwriting or renaming
an existing marks file. But we cannot always be sure what a user does in the
recording hook. 

I don't know how to handle this properly. My suggestion would be to ignore the
channel pid change during an active recording on this channel, and defer the
change until the recording is finished _if_ "-r something" is set on the
command line. 

Ideas or insights anyone? 


Dec 13 21:55:00 vdr vdr: [3759] record 
/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec
Dec 13 21:55:00 vdr vdr: [3759] creating directory 
/video/Tatort:_Wofür_es_sich_zu_leben_lohnt
Dec 13 21:55:00 vdr vdr: [3759] creating directory 
/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec
Dec 13 21:55:00 vdr vdr: [3759] recording to 
'/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec/1.ts'
Dec 13 21:55:00 vdr vdr: [4035] recording thread started (pid=3759, tid=4035, 
prio=high)

...

Dec 13 21:55:02 vdr vdr: [3768] changing pids of channel 13 (SWR RP HD) from 
5121+5121=27:5122=deu@3,5123=mis@3;5126=deu@106:5135=deu:5134 to 
5131+5131=27:5132=deu@3,5133=mis@3;5136=deu@106:5135=deu:5134
Dec 13 21:55:02 vdr vdr: [4035] executing '/usr/local/bin/markad.sh started 
"/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec"'
Dec 13 21:55:02 vdr vdr: [3768] channel 13 (SWR RP HD) event Wed 13.12.2017 
21:45-22:00 (VPS: 13.12. 21:45) 'SWR Aktuell Rheinland-Pfalz' status 4

...

Dec 13 21:55:06 vdr markad: [4032] detected logo stop (3892)
Dec 13 21:55:06 vdr vdr: [3759] stopping recording due to modification of 
channel 13 (SWR RP HD)
Dec 13 21:55:06 vdr vdr: [4035] recording thread ended (pid=3759, tid=4035)
Dec 13 21:55:06 vdr vdr: [3759] timer 10 (13 2155- 'Tatort: Wofür es sich 
zu leben lohnt') stop
Dec 13 21:55:06 vdr vdr: [3759] executing '/usr/local/bin/markad.sh after 
"/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec"'
Dec 13 21:55:06 vdr markad: [4055] starting v0.1.6 (ea2e182) (64bit)
Dec 13 21:55:06 vdr markad: [4055] on 
/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec
Dec 13 21:55:06 vdr markad: [4055] broadcast aspectratio 16:9 (from info)
Dec 13 21:55:06 vdr markad: [4055] getting broadcast start from info mtime
Dec 13 21:55:06 vdr markad: [4055] no logo found, logo detection disabled
Dec 13 21:55:06 vdr markad: [4055] marks can/will be weak!
Dec 13 21:55:06 vdr markad: [4055] pre-timer 4m
Dec 13 21:55:06 vdr markad: [4055] broadcast length 90m
Dec 13 21:55:06 vdr vdr: [3759] switching device 2 to channel 13 (SWR RP HD)
Dec 13 21:55:06 vdr vdr: [3759] timer 10 (13 2155- 'Tatort: Wofür es sich 
zu leben lohnt') start
Dec 13 21:55:06 vdr vdr: [3759] Title: 'Tatort: Wofür es sich zu leben lohnt' 
Subtitle: 'Fernsehfilm Deutschland 2016'
Dec 13 21:55:06 vdr vdr: [3759] executing '/usr/local/bin/markad.sh before 
"/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec"'
Dec 13 21:55:06 vdr vdr: [3759] record 
/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec
Dec 13 21:55:06 vdr vdr: [3759] recording to 
'/video/Tatort:_Wofür_es_sich_zu_leben_lohnt/2017-12-13.21.55.13-0.rec/2.ts'
Dec 13 21:55:06 vdr markad: [4032] detected logo start (4384)*
Dec 13 21:55:06 vdr vdr: [4058] recording thread started (pid=3759, tid=4058, 
prio=high)

... 


-- 
Don't feed the bats tonight.

___
vdr mailing list
vdr@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr