Hi,
I'm working on a script which downloads cutlists from cutlist.at and converts them to VDR format. As the cutmarks are relative to the start of the recording, the offset between start of recording and start of cutlist has to be calculated. I'm trying parse all information from the info files, but as the unix timestamp relates to the start of the show and not to the start of the recording, I have to assume an fixed offset for all recordings.
So I suggest to add start margin (and maybe stop margin) to the info files of recordings.
Best regards,
Renne
Am 02.11.2010 12:20, schrieb Rene Bartsch:
So I suggest to add start margin (and maybe stop margin) to the info files of recordings.
There is no fixed start/stop margin. I have some timers with 5min before / 10min after, and others with 10min before and 30min after. Depends on how much delays the channel usually has.
Also, this would help only partially, as there's no guarantee that start/stop margin is actually part of the recording. The time in the folder name is just the timer time, not necessarily the recording start time. Differences may appear on VPS recordings, timers set/enabled after start time, and recordings that couldn't be started because of downtime or missing devices.
To get a near match, it would be necessary to store the actual recording start time and the EPG event start time in the info file. And maybe the time when the EPG event became active.
Cheers,
Udo
On Tue, Nov 2, 2010 at 12:54 PM, Udo Richter udo_richter@gmx.de wrote:
To get a near match, it would be necessary to store the actual recording start time and the EPG event start time in the info file. And maybe the time when the EPG event became active.
Wouldn't this also require that you sync your system time to the dvb stream also? It would be nice if someone wrote a patch or plugin to cut out commercials. From what I've _heard_ mythtv has this features and it works quite well.
On Tue, 02 Nov 2010 20:54:06 +0100, Udo Richter udo_richter@gmx.de wrote:
Am 02.11.2010 12:20, schrieb Rene Bartsch:
So I suggest to add start margin (and maybe stop margin) to the info files of recordings.
There is no fixed start/stop margin. I have some timers with 5min before / 10min after, and others with 10min before and 30min after. Depends on how much delays the channel usually has.
I'm talking about the MARGINSTART in setup.conf or a manually per recording set one.
The idea is simple:
1.) Create an OTR filename from the information in the info file (as VDR and OTR recordings use EPG data, it's simple regex parsing)
2.) Download a cutlist for the corresponding OTR recording at Cutlist.at (preferably rated with 5.00)
3.) Substract the 360 seconds OTR standard leader from the cut marks
4.) Add the preset VDR leader (MARGINSTART) to the cut marks
5.) Convert the cut marks to VDR marks file
6.) Be happy
Only precondition: Reliable clock in the VDR machine (e.g. radio clock or NTP)
Also, this would help only partially, as there's no guarantee that start/stop margin is actually part of the recording. The time in the folder name is just the timer time, not necessarily the recording start time. Differences may appear on VPS recordings, timers set/enabled after start time, and recordings that couldn't be started because of downtime or missing devices.
There's no guarantee you survive crossing the street at your home. ;-)
If the VDR clock is reliable and the recording is not started delayed you get perfect cuts. Tried that with impressing results on a Indiana Jones recording.
Just consider: VDR stores the UNIX_TimeStamp of the EPG event which is the same for OTR recordings. To adjust the cutmarks you only need to know the recording start offsets of the VDR machine and OTR.
So VDR just has to store the offset between EPG event UNIX_TimeStamp and real recording start in the info file (tried that with fixed MARGINSTART=10 and 360 seconds for the OTR leader -> perfect match)
For delayed starts the margin in the info file
Best regards,
Renne
P.S: The script is a dirty hack - just a proof of concept:
#!/bin/bash
# Parameters # $1: Absolute path to recording directory # $2: OTR name of station (e.g. 'sat1' instead of 'SAT.1')
# Cutlist rating (cutlist.at x 100, max. 500) RATING=500
# VDR video directory VIDEODIR=/home/vdr/video
# VDR start margin in seconds MARGINSTART_VDR=600
# OTR start margin in seconds MARGINSTART_OTR=360
INFO="`head -n3 $1/info`" STATION="$(echo $INFO | sed -r -n s/'^C .* (.*) E [0-9]+ ([0-9]+) ([0-9]+) [0-9]+[A-Z]+ [0-9]+ T (.*)$'/\1/p)" START="$(echo $INFO | sed -r -n s/'^C .* (.*) E [0-9]+ ([0-9]+) ([0-9]+) [0-9]+[A-Z]+ [0-9]+ T (.*)$'/\2/p)" DURATION="$(echo $INFO | sed -r -n s/'^C .* (.*) E [0-9]+ ([0-9]+) ([0-9]+) [0-9]+[A-Z]+ [0-9]+ T (.*)$'/\3/p)" TITLE="$(echo $INFO | sed -r -n s/'^C .* (.*) E [0-9]+ ([0-9]+) ([0-9]+) [0-9]+[A-Z]+ [0-9]+ T (.*)$'/\4/p)"
# Stations STATION="$2"
# Umlauts TITLE="${TITLE//Ä/Ae}" TITLE="${TITLE//Ö/Oe}" TITLE="${TITLE//Ü/Ue}" TITLE="${TITLE//ä/ae}" TITLE="${TITLE//ö/oe}" TITLE="${TITLE//ü/ue}" TITLE="${TITLE//ß/ss}"
URL="http://cutlist.at/getxml.php?name=$%7BTITLE// /_}_`date -d @$START +%y.%m.%d_%H-%M`_${STATION}_$(($DURATION/60))_TVOON_DE.mpg.avi" XML="`wget --quiet -O - $URL`" if [ "$(echo -e "$XML" | sed -r -n s:'<rating>(.*)</rating>':\1:p | sed -r -n s:'([0-9]).([0-9]+)':\1\2:p | head -n1)" -ge $RATING ]; then { URL="http://cutlist.at/getfile.php?id=$(echo -e "$XML" | sed -r -n s:'<id>(.*)</id>':\1:p | head -n1)" declare -a MARK MARK=(`wget --quiet -O - $URL`) for((i=0; i<${#MARK[*]}; i++)); do { case "${MARK[$i]}" in Start*) MARK[$i]=`calc ${MARK[$i]#Start=} + $MARGINSTART_VDR - $MARGINSTART_OTR` SEC="${MARK[$i]%.*}" MSEC="${MARK[$i]#*.}" MSEC="${MSEC:0:2}" MARKS+="`printf %1d:%02d:%02d.%02d§ $(($SEC/3600)) $(($SEC%3600/60)) $(($SEC%3600%60)) $MSEC`" ;; Duration*) MARK[$i]=`calc ${MARK[$i-1]} + ${MARK[$i]#Duration=}` SEC="${MARK[$i]%.*}" MSEC="${MARK[$i]#*.}" MSEC="${MSEC:0:2}" MARKS+="`printf %1d:%02d:%02d.%02d§ $(($SEC/3600)) $(($SEC%3600/60)) $(($SEC%3600%60)) $MSEC`" ;; *) ;; esac }; done echo -e "${MARKS//§/\n}" > "$1\marks" cat "$1\marks" }; fi
Am 03.11.2010 02:24, schrieb Rene Bartsch:
There is no fixed start/stop margin. I have some timers with 5min before / 10min after, and others with 10min before and 30min after. Depends on how much delays the channel usually has.
I'm talking about the MARGINSTART in setup.conf or a manually per recording set one.
Exactly my point. There IS NO per recording set one. (Don't confuse this with epgsearch search timers where there is one!) VDR adds a margin when using an EPG event to pre-fill a timer entry. But I can still change the starting time to be earlier/later as I want, and after storing the timer, the exact margin is not known any more. Unless you subtract the timer start time from the EPG time of the most probable EPG event.
If you want MARGINSTART from setup.conf, then just get it from there.
The time in the folder name is just the timer time, not necessarily the recording start time.
There's no guarantee you survive crossing the street at your home. ;-)
If the VDR clock is reliable and the recording is not started delayed you get perfect cuts. Tried that with impressing results on a Indiana Jones recording.
Record something with an VPS timer on an average not-always-perfect channel. Recording time isn't accurate.
Or some program is about to start, and you quickly go to EPG and hit record button. Start time will instantly be some minutes in the past.
Oh, and recording time is only accurate to one minute. In the info file, it could be accurate to a second.
Cheers,
Udo
The most sensible solution is to just add a UNIX_Timestamp of the exact recording start to the info file.
That way offsets between EPG and real start of recording can be calculated easily.
Renne
On Tue, 02 Nov 2010 12:20:53 +0100, Rene Bartsch ml@bartschnet.de wrote:
Hi,
I'm working on a script which downloads cutlists from cutlist.at and converts them to VDR format. As the cutmarks are relative to the start of the recording, the offset between start of recording and start of cutlist has to be calculated. I'm trying parse all information from the info files, but as the unix timestamp relates to the start of the show and not to
the
start of the recording, I have to assume an fixed offset for all recordings.
So I suggest to add start margin (and maybe stop margin) to the info
files
of recordings.
Best regards,
Renne
vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
Hi, On Wed, Nov 03, 2010 at 04:56:13PM +0100, Rene Bartsch wrote:
The most sensible solution is to just add a UNIX_Timestamp of the exact recording start to the info file.
That would need a well synchronized systemtime to dvb-time of the transponder were the recording comesfrom. Aditionally the cuttingmarks will differ for cable/sat users due to some delays of the broadcasters etc. Finding a well working solutions seems dificult to me . Better use some of noad/markad plugin.
Just My two cents. BR. Halim
On Wed, 3 Nov 2010 23:05:59 +0100, Halim Sahin halim.sahin@t-online.de wrote:
Hi, On Wed, Nov 03, 2010 at 04:56:13PM +0100, Rene Bartsch wrote:
The most sensible solution is to just add a UNIX_Timestamp of the exact recording start to the info file.
That would need a well synchronized systemtime to dvb-time of the transponder were the recording comesfrom. Aditionally the cuttingmarks will differ for cable/sat users due to some delays of the broadcasters etc.
Maybe the cut function of VDR can be improved to move cutmarks relatively to the start of a recording. If you get cutlists, the offsets BETWEEN the cutmarks are the SAME, but the offset to the START of the recording can DIFFER. A solution would be to import cutmarks into VDR and move the first mark to the correct position with e.g. the left/right keys. The correction offset can then be applied to all other cut marks automatically.
Finding a well working solutions seems dificult to me .
Not really. Sharemarks uses the PTS in the TS-stream to place exact cut marks. The database server is still online, but the 3 year old last version of Sharemarks it not compatible with VDR 1.7. Maybe someone can revive the Sharemarks script and adjust it to new VDR versions.
But it still would be great to have the start timestamp (and maybe the option to move all cutmarks with the same offset) to import non-VDR cutlists.
Better use some of noad/markad plugin.
Better NOT. NOAD worked relatively well, but markad messes up cutmarks. There are channels with over 50 cutmarks in one recording. I really don't want to remind how much time it has cost to remove so much wrong cutmarks from ONE 90-minute recording.
Or VDR just uses cutmarks with NTP-based timestamp and PTS in the marks file ;-) That way the PTS can be used and timestamps if there is no PTS or broken PTS.
Best regards,
Renne
/On Thu Nov 4 16:14:01 CET 2010/, Rene Bartsch>ml at bartschnet.de> wrote: mailto:vdr%40linuxtv.org?Subject=Re%3A%20%5Bvdr%5D%20Feature-Request%3A%20MarginStart%20in%20INFO%20file%20of%20recording&In-Reply-To=%3C17d62c975e67e8c1dbacfd15ab80f9d0%40bartschnet.de%3E
Better NOT. NOAD worked relatively well, but markad messes up cutmarks. There are channels with over 50 cutmarks in one recording. I really don't want to remind how much time it has cost to remove so much wrong cutmarks from ONE 90-minute recording.
I never had 50 cutmarks in one recording. Always use the latest git-Version! Feel free to report bugs onhttp://vdr-portal.de orhttp://projects.vdr-developer.org/projects/plg-markad
Greetings
Jochen