EDL frame number data?
#1
I'm trying to create EDL data but I'm running into a bind. MythTV generates epg data by frames and XBMC expects seconds.

I know that mpg framerate is around 24fps, however I question that framerate when my recordings display freezes temporarily because the desktop used too much processor. Also, different recordings and encoders have different framrates.

Is there a way to use frame data instead of seconds for EDL in XBMC?
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply
#2
the comskip .txt format (frame based) is supposed to work, but i couldn't figure out a format for the file that xbmc would interpret as edl information.

Instead, i found a program called mediainfo (http://mediainfo.sourceforge.net/en/Download), there's a command line version that you can use within a script to read the Frame Rate for a specified video file - then just divide the edl skip list frame counts by the frame rate to get to seconds...

although, i'm finding some problem with the EDL info interpretation by xbmc - not sure if i'm not using it right or not - but i can get it to work. But if the first commercial break is at the start of the show, it doesn't seem to work well, so i have my script adjusting the start time of the first break to be 2-3 seconds instead of 0... so far that seems to fix it.
Reply
#3
Everything inside dvdplayer (the internal player) is time based as this is what all the underlying libraries and APIs are based on, e.g. ffmpeg. Nothing is frame based and all the current EDL related formats that expose frame information are converted to time offsets so they can be used by XBMC. For example, the version 2 Comskip file format includes the frame rate inside the file, which is then used to convert the frame markers in the file to time offsets.

I had the same problem when implementing commercial skip support for the myth:// protocol. The final implementation of this within XBMC passes the detected frame rate (according to the demuxer) of the video stream that is about to be played and that is used to convert the frame offsets held in MythTV to the time offsets.

This doesn't work perfectly all the time. I have at least one case where a 1080i stream is detected as 50fps, but is actually 25fps.

I may need to alter the EDL implementation inside XBMC to better handle this conversion to time offsets using the detected frame rate with some other work that has been happening to calculate the actual frame rate based on playback sampling rather than believing what the stream says it is. This will involve changing the EDL offsets after some playback though so isn't completely straight forward.

If anyone thinks that they are getting commercial breaks skipped at the wrong times due to an incorrectly detected frame rate, please compare the time that XBMC thinks the commercial break starts and when mythfrontend thinks the commercial break starts. If there is a difference (sometime commercials are simply flagged badly) post a debug log along with the noted time differences for the commercial break (likely the times will be different by half).
Reply
#4
jaygardner Wrote:... i'm finding some problem with the EDL info interpretation by xbmc - not sure if i'm not using it right or not - but i can get it to work. But if the first commercial break is at the start of the show, it doesn't seem to work well, so i have my script adjusting the start time of the first break to be 2-3 seconds instead of 0... so far that seems to fix it.

Please supply a full debug log.
Reply
#5
hi-
thanks for your reply-
see my post here: http://forum.xbmc.org/showthread.php?tid=64507

more details and a log is attached there...

changing the start time of first break from 0 to 2 or 3 seconds fixes most of the problems... note that if i play the file from file mode, using the myth:// source it plays completely fine, so i can partially conclude that i'm not forming the edl file the same way you are, or there are some details of the myth:// protocol we're not emulating by simply using the shared volume source with campanion edl file.

Specifically, during playback of this same file from the file mode view of the myth:// source, the edl info in the OSD shows as a number of breaks and scene markers. With the edl file i constructed, and playing the source video from my shared volume source, the OSD simply displays edl with a number of breaks using a "c#" designation, not a b#s# designation.. could you comment on the format of the edl file in my abovce referenced post?

thx, jay
Reply
#6
So, from what I'm reading here, I should just generate frame data and XBMC will eventually take care of determining framerates?
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply
#7
no... you have to translate them to seconds... here's how i am doing it - note, i was going to try and integrate this into your MythSExx script, but haven't got that far yet - please feel free to take this and use to the extent you like... I used media info to get the frame rate - i couldn't find an entry in mythconverg that held that data...

Code:
#!/bin/bash

#get filename from input - later this can come from mythtv run
filename=`basename $1`
#extract channel number
channelnum=`echo $filename | sed 's/_.*$//'`
#get file extention
fileext=`echo "${1#*.}"`
#change suffix to edl
edlfile=`readlink $1 | awk -F "/" ' {print $6} ' | awk -F "$fileext" '{print $1 "edl"}'`
#extract showname directory as a result of MythSExx.sh move
showname=`readlink $1 | awk -F "/" '{print $5}'`
#extract frame rate info using mediainfo
divisor=`mediainfo $1 | grep 'Frame rate' | sed -E 's/(^.*\" : \")([0-9][0-9]\.[0-9][0-9])(.*$)/\2/'`
#get list of commercial skips
mythcommflag --getskiplist -f "$1" | grep "Commercial" | sed 's/^.*: //' | tr ',' '\n' | awk -F "-" ' { print $1/'$divisor' "    " $2/'$divisor' "    0" } ' > "/media/datadrive/TVShows/$showname/$edlfile"
#if first skip starts at time 0, start it at 2 seconds instead - hopefully this can get fixed...
sed -E -i -e 's/^0    /2.0    /' "/media/datadrive/TVShows/$showname/$edlfile"

For example:
here's the result of a mythcommflag --getskiplist run against a myth recording:

Commercial Skip List: 0-969,13322-17863,33867-40210,53074-59711,73893-81863

and the above script will translate that into the following edl data:
2.0 32.3323 0
444.511 596.029 0
1130.03 1341.68 0
1770.9 1992.36 0
2465.57 2731.5 0

and save it the moved directory with a name that corresponds to the name of the moved file.

(i only considered this for MythSExx MOVE mode...)

-jay
Reply
#8
lol. i just came up with one.

Code:
#####EDL DATA#####
#Remove old and generate a EDL Start list
    rm $MythSExx/markupstart.txt
    mysql -u$MySQLuser -p$MySQLpass -e "use '$MySQLMythDb' ; select mark from recordedmarkup where starttime like '$ShowStartTime' and chanid like '$ChanID' and type like "4" ; " |replace "mark" ""|replace " " "">>$MythSExx/markupstart.txt

#Remove old and generate  EDL Stop list
    rm $MythSExx/markupstop.txt
    mysql -u$MySQLuser -p$MySQLpass -e "use '$MySQLMythDb' ; select mark from recordedmarkup where starttime like '$ShowStartTime' and chanid like '$ChanID' and type like "5" ; " |replace "mark" ""|replace " " "">>$MythSExx/markupstop.txt

#get framerate data for generation of a time based markup
    BashSExxframerate=`ffmpeg -i "$3" 2>&1 | grep "tbr, "|sed 's/tbr, .*//'|awk '{ print $NF }'`

#Set up counter, remove old markup data and generate new markup file from markupstart and stop
    MythSExxCounter=0;
    rm "$MythSExx/markupdata.txt"
    while read line
        do
        MythSExxCounter=`expr $MythSExxCounter + 1`;
        StartData=sed -n "$MythSExxCounter"p "$MythSExx/markupstop.txt"
        let StartData=StartData/BashSExxframerate
        StopData=sed -n "$MythSExxCounter"p "$MythSExx/markupstop.txt"
        let StartData=StartData/BashSExxframerate
        echo "$StartData $StopData 0">>"$MythSExx/markupdata.txt"
    done <"$MythSExx/markupstop.txt"

In mine, you just let myth run mythcommflag and then MythSExx will grab that data and modify it. Mine uses ffmpeg for framerate
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply
#9
you know, i just reread your question and dteirney's reply - it does sound like frame counts are supposed to work w/o first converting to time. so, i tried that, but i can't get that to work - i didn't even test the comm skip part, but the time slider never displays the total time, so i just stopped there.

So, with your script, is that an additional myth user job script you run or do you take it and add it into MythSExx at the end?
-jay
Reply
#10
it goes in the "unreleased" version. It's not fully supported yet. The newest version will use the database for further recognition of both movies and shows. There's substantial changes throughout the file from the last version. It also is prepared to record and label programs which are not yet supported by XBMC Media Center. I'm still debugging multiple things before I release it, however I put a feature freeze on it until release and it's just debug now. 650 lines sounds easy, but it should be done by Friday.
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply
#11
A .edl file uses time markers.

A version 1 comskip file uses frame markers and XBMC will internally convert those framemarkers to times using the detected frame rate of the video.

A version 2 comskip file has the frame rate in the file and that is used to convert the frame markers to time offsets

All the other supported file formats use time based offsets.

@jaygardner, I think you've cross posted similar questions in 3 different forums, which is very hard to keep track of. As per one of the responses to one of those posts, if you use 3 instead of 0 in the .edl file the edit will be treated as a commercial break rather than a cut.
Reply
#12
outleradam - sounds good, i'll check your thread &/or xbmc wiki page next week for the update... thanks

dteirney - my apologies, i had the best of intentions (& attempted to redirect interest to more recent posts that reflected updated info), but understand and will refrain from that.) thanks for the clarification on the time vs frame info.
Reply
#13
dteirney Wrote:A .edl file uses time markers.

A version 1 comskip file uses frame markers and XBMC will internally convert those framemarkers to times using the detected frame rate of the video.

A version 2 comskip file has the frame rate in the file and that is used to convert the frame markers to time offsets

All the other supported file formats use time based offsets.

@jaygardner, I think you've cross posted similar questions in 3 different forums, which is very hard to keep track of. As per one of the responses to one of those posts, if you use 3 instead of 0 in the .edl file the edit will be treated as a commercial break rather than a cut.

What would you recommend going with? I've got framerate, frames and calculated seconds. should I EDL or comskip v2?

Also, where can I find a file format sample for those types of files? I would like to see at least 2 before I start making my own.
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply
#14
outleradam Wrote:What would you recommend going with? I've got framerate, frames and calculated seconds. should I EDL or comskip v2?

Also, where can I find a file format sample for those types of files? I would like to see at least 2 before I start making my own.

I've updated the EDL related wiki page today. Still needs some more attention but all the information you need should be there now.

http://wiki.xbmc.org/?title=EDL_(commerc...er_support

File format doesn't matter too much. Whatever you think it easiest to put together. The frame rate conversion that is done within XBMC is probably similar to what you are doing, but XBMC may end up having some workarounds applied for incorrect detection by ffmpeg.
Use MythTV for recording TV? Try the integrated MythTV support in XBMC Media Center. Now with commercial skip support built-in and integration with the Movie database!
Reply
#15
Alright, so are you saying I should use comskip 1 and leave it up to xbmc then?

Very nice wiki entry. I could not find comskip data anywhere on the internet. Thank you.

Is it possible to integrate comskip 1 data into a tag at a tail of a file in the future? IE...

Code:
<Frameskip>12693 17792</Frameskip> <Frameskip>12693 17792</Frameskip> <Frameskip>12693 17792</Frameskip>

This would make it much easier to clean up as deletion of only the file would handle everything.

XBMC detection could go:
Code:
x=tail videofile|Grep <Frameskip>|replace "<Frameskip>" "" |replace "</Frameskip>" "linebreak"

then x would equal a comskip 1 file with junk removed.

Or would that mess with the video?
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply

Logout Mark Read Team Forum Stats Members Help
EDL frame number data?0