PDA

View Full Version : EDL (and ComSkip) integration


DrDDT
2007-08-07, 14:44
Hi!

I'm trying implement EDL for XBMC
(see http://xbmc.org/forum/showthread.php?t=21890&page=4)

I'm very new to XBMC development so please be patient with me.

I'm trying to add the option 'path_to_movie\movie.edl' to the mplayer options, if the file 'path_to_movie\movie.edl' exists.

As suggested, I'll have to do the following:

- Check if the filename give to mplayer is actually a movie and not a stream/playlist:

// Check if file can have EDL
if (item.IsInternetStream()) ....
if (item.IsPlayList()) ....
if (!item.IsVideo()) ....

- If the file can have an edl, generate the possible filename:

CStdString strEdlFileName;
ReplaceExtension(strFile, "edl", strEdlFileName);

- Check if 'path_to_movie\movie.edl' exists
-[ How do I do this? ]-

- Add the option to the mplayer conf
Someting like:

options.SetEDLFile(strFile);

if (m_stredlfile.length() > 0)
{
m_vecOptions.push_back("-edl=" + m_stredlfile );
}


Is this going to work?
How do I check if the EDL file exists?

spiff
2007-08-07, 14:54
CFile::Exists

and yes it will work

DrDDT
2007-08-07, 15:58
CFile::Exists

and yes it will work

I gave it a shot, it compiles, but I cannot test it yet:


Index: mplayer.cpp

================================================== =================

--- mplayer.cpp (revision 9840)

+++ mplayer.cpp (working copy)

@@ -122,6 +122,7 @@

m_bLimitedHWAC3 = false;
m_bDeinterlace = false;
m_subcp = "";
+ m_strEdl = ""; // DD
m_synccomp = 0.0f;
}
void CMPlayer::Options::SetFPS(float fFPS)
@@ -279,6 +280,12 @@

m_iAutoSync = iAutoSync;
}

+// DD
+void CMPlayer::Options::SetEdl(const string& strEdl)
+{
+ m_strEdl = strEdl;
+}
+
void CMPlayer::Options::GetOptions(int& argc, char* argv[])
{
CStdString strTmp;
@@ -332,6 +339,13 @@

}
}

+ // DD
+ if (m_strEdl.length() > 0)
+ {
+ m_vecOptions.push_back("-edl=" + m_strEdl );
+ CLog::Log(LOGINFO, "Found EDL file, adding -edl=%s", m_strEdl.c_str());
+ }
+
//MOVED TO mplayer.conf
//Enable mplayer's internal highly accurate sleeping.
//m_vecOptions.push_back("-softsleep");
@@ -858,6 +872,17 @@

m_iPTS = 0;
m_bPaused = false;

+ // DD Check for EDL file
+ CStdString strEdlFileName;
+ if (!bFileOnInternet && bIsVideo && !bIsDVD )
+ {
+ CUtil::ReplaceExtension(strFile, "edl", strEdlFileName);
+ if ( CFile::Exists(strEdlFileName) )
+ {
+ options.SetEdl(strEdlFileName);
+ }
+ }
+
// first init mplayer. This is needed 2 find out all information
// like audio channels, fps etc
load();
Index: MPlayer.h

================================================== =================

--- MPlayer.h (revision 9840)

+++ MPlayer.h (working copy)

@@ -61,6 +61,9 @@


void SetAutoSync(int iAutoSync);

+ // DD
+ void SetEdl(const string& strEdl);
+
void SetAudioOutput(const string& output) { m_videooutput = output; }
void SetVideoOutput(const string& output) { m_audiooutput = output; }
void SetAudioCodec(const string& codec) { m_videocodec = codec; }
@@ -94,6 +97,7 @@

string m_demuxer;
bool m_bDisableAO;
string m_subcp;
+ string m_strEdl;
string m_strChannelMapping;
string m_strDvdDevice;
string m_strFlipBiDiCharset;

spiff
2007-08-07, 16:02
i havent tested it either but your diff is unacceptable for inclusion
indent is 2 space using spaces, please comply. and i'd prefer if you didnt spam your name all over the file. (do not mistake this for hostility)

DrDDT
2007-08-07, 16:10
i havent tested it either but your diff is unacceptable for inclusion
indent is 2 space using spaces, please comply. and i'd prefer if you didnt spam your name all over the file. (do not mistake this for hostility)

This patch wasn't meant for inclusion, sorry I didn't make this clear.
The 'name spamming' is only for me to find my own changes. I haven't coded a single line for over ten years, so I'm a bit rusty.

I'll test it first, then I'll find the correct formatting and submit rules for patches.

spiff
2007-08-07, 16:18
cool

DrDDT
2007-08-08, 14:18
I've got it working now (after a few bugfixes).

I'll try to add a on/off switch in the settings now.

spiff
2007-08-08, 14:31
why would we want that? if you dont want your edls, rename them / delete them.

DrDDT
2007-08-08, 18:32
why would we want that? if you dont want your edls, rename them / delete them.

Doesn't the same goes for subtitles?
If I have a recorded tv show, and have comskip generate an edl for removing commercials, I might want to disable the EDL because too much of the show was disabled.

Maybe later then.

spiff
2007-08-09, 00:54
oh sorry you mean an osd option. a conditional osd option (only shown if we have an edl) is all fine. i thought you meant a "real" setting in settings->video.

DrDDT
2007-08-09, 02:02
The following code uses the edl option in mplayer when a 'moviename.edl' file is found.

Observations:
- The 'mute' function doesn't seem to work
- The 'skip' function works fine. You can still use the forward/back functions to see the skipped parts.

Here is the patch, hopefully using the correct format this time:


Index: mplayer.cpp

================================================== =================

--- mplayer.cpp (revision 9840)

+++ mplayer.cpp (working copy)

@@ -122,6 +122,7 @@

m_bLimitedHWAC3 = false;
m_bDeinterlace = false;
m_subcp = "";
+ m_strEdl = "";
m_synccomp = 0.0f;
}
void CMPlayer::Options::SetFPS(float fFPS)
@@ -279,6 +280,11 @@

m_iAutoSync = iAutoSync;
}

+void CMPlayer::Options::SetEdl(const string& strEdl)
+{
+ m_strEdl = strEdl;
+}
+
void CMPlayer::Options::GetOptions(int& argc, char* argv[])
{
CStdString strTmp;
@@ -332,6 +338,12 @@

}
}

+ if (m_strEdl.length() > 0)
+ {
+ m_vecOptions.push_back("-edl");
+ m_vecOptions.push_back( m_strEdl.c_str());
+ }
+
//MOVED TO mplayer.conf
//Enable mplayer's internal highly accurate sleeping.
//m_vecOptions.push_back("-softsleep");
@@ -858,6 +870,16 @@

m_iPTS = 0;
m_bPaused = false;

+ CStdString strEdlFileName;
+ if (!bFileOnInternet && bIsVideo && !bIsDVD )
+ {
+ CUtil::ReplaceExtension(strFile, ".edl", strEdlFileName);
+ if ( CFile::Exists(strEdlFileName) )
+ {
+ options.SetEdl(strEdlFileName);
+ }
+ }
+
// first init mplayer. This is needed 2 find out all information
// like audio channels, fps etc
load();
@@ -2051,4 +2073,4 @@

m_evProcessDone.WaitMSec(1000);
m_evProcessDone.WaitMSec(1000);
}
-}

\ No newline at end of file

+}
Index: MPlayer.h

================================================== =================

--- MPlayer.h (revision 9840)

+++ MPlayer.h (working copy)

@@ -61,6 +61,8 @@


void SetAutoSync(int iAutoSync);

+ void SetEdl(const string& strEdl);
+
void SetAudioOutput(const string& output) { m_videooutput = output; }
void SetVideoOutput(const string& output) { m_audiooutput = output; }
void SetAudioCodec(const string& codec) { m_videocodec = codec; }
@@ -94,6 +96,7 @@

string m_demuxer;
bool m_bDisableAO;
string m_subcp;
+ string m_strEdl;
string m_strChannelMapping;
string m_strDvdDevice;
string m_strFlipBiDiCharset;

DrDDT
2007-08-09, 14:01
Would it be doable to show the EDL 'skip' parts when showing the movie play progress bar?
Maybe use a differen color, so if one shows the progress bar, you know where parts are going to be skipped?

DrDDT
2007-08-10, 14:04
Would it be doable to show the EDL 'skip' parts when showing the movie play progress bar?
Maybe use a differen color, so if one shows the progress bar, you know where parts are going to be skipped?

Example of the progress bar I was thinking of.
Maybe also the miniature one in the top right of the screen, if it uses the same code.

http://img504.imageshack.us/img504/4736/screenshot001ys9.th.jpg (http://img504.imageshack.us/my.php?image=screenshot001ys9.jpg)

spiff
2007-08-10, 14:28
it does use the same code. however there's no such support as of yet.

patch welcome, i doubt any of the devs care (i for one do not). it would be rather tricky, as the progress bar is just generated based on info labels

i'll apply your submitted patch tonite unless elupus objects for some reason (cant see why)

DrDDT
2007-08-12, 18:30
it does use the same code. however there's no such support as of yet.

patch welcome, i doubt any of the devs care (i for one do not). it would be rather tricky, as the progress bar is just generated based on info labels

i'll apply your submitted patch tonite unless elupus objects for some reason (cant see why)

Great! I see the patch is in.

Shouldn't we add this to the Wiki now?

Somewhere in this page?

http://xboxmediacenter.com/wiki/index.php?title=Videos

spiff
2007-08-12, 18:31
go for it

DrDDT
2007-08-12, 21:16
go for it

How about something like:


Edit Decision List

XBMC supports Edit Decision Lists.

An Edit Decision List or EDL allows you to automatically skip or mute sections of videos during playback, based on a movie specific EDL configuration file. The EDL can for example be used to to skip commecials or intros.

The current EDL file format is:
[begin second] [end second] [action]

Where the seconds are floating-point numbers and the action is either 0 for skip or 1 for mute. Example:

5.3 7.1 0
15 16.7 1
420 422 0

This will skip from second 5.3 to second 7.1 of the video, then mute at 15 seconds, unmute at 16.7 seconds and skip from second 420 to second 422 of the video. These actions will be performed when the playback timer reaches the times given in the file.

To use an edl file with a video file, put it in the same folder as the video file.
The edl and video files must have the same name, for example:

Video File: The Matrix.avi
EDL: The Matrix.edl


This is a mix of wikipedia, the mplayer manual and the subtitles section.
Can I reference third party tools like comskip in the manual?

spiff
2007-08-12, 21:32
sure. looks nice and informative to me

jmarshall
2007-08-13, 01:57
Feel free to reference 3rd party stuff, sure. Best with just a link to the site so that if they change stuff that breaks what you write on the wiki it's not our problem ;)

szsori
2007-08-13, 05:37
Are there publicly available EDL files for tv shows? Should there be?

DrDDT
2007-08-13, 11:12
Are there publicly available EDL files for tv shows? Should there be?

I don't think so.

I use my HTPC to record tv shows, and use comskip to find commercials.
Comskip generates an EDL that is now picked up by XBMC to skip these commercials.

DrDDT
2007-08-15, 15:17
it does use the same code. however there's no such support as of yet.

patch welcome, i doubt any of the devs care (i for one do not). it would be rather tricky, as the progress bar is just generated based on info labels


I tried to understand the mechanism, and indeed it doesn't seem simple.
The progress bar is a texture, and it is displayed at a percentage of 100% length.
I might need another texture and method of displaying it, to show the cutpoints. Furthermore, the contents of the EDL file need to be parsed so the cutpoints are available every time the OSD is shown.

Is it possible to take the 'green bar' texture, make it another color, and show it at an offset (to be repeated for every cutpoint)?

spiff
2007-08-15, 15:29
tbh i dont know, elupus?

a general wiseass answer; most stuff is possible, what price it comes at however... ;P

elupus
2007-08-15, 16:54
I have a feeling it would be quite complicated to get this to work. You would either have to modify mplayer to output information about the edl list, so you know when the cutpoint will occure, or parse the edl list yourself.

Then add some sort of new guielement that can highlight parts of the progressbar. Not sure how one would go about that. Either one extends the progressbar class with this, or you add some new type of element wich you can overlay on it.

Gamester17
2007-08-15, 18:23
What about EDL for the DVDPlayer video-core in XBMC?, so it will work on the Linux port (MPlayer isn't going to be supported by it anytime soon)

DrDDT
2007-08-15, 21:32
I have a feeling it would be quite complicated to get this to work. You would either have to modify mplayer to output information about the edl list, so you know when the cutpoint will occure, or parse the edl list yourself.

Then add some sort of new guielement that can highlight parts of the progressbar. Not sure how one would go about that. Either one extends the progressbar class with this, or you add some new type of element wich you can overlay on it.

I was thinking of parsing the EDL list myself, and putting it in a CEdl class.
This might be the most future proof, with possibilities like importing different cutlist formats, and recording/writing new cutlists during video watching.
Also it would be nice to be able to jump to cutpoints.

I'm willing to try to write the class, but the progress bar stuff is a bit too complicated for me now. Maybe I can do something with text in one of the existing 'info' osd pages?

jmarshall
2007-08-15, 23:28
If and when it'll be useful to do a GUI Element I can probably give a hand in that respect.

Other uses may be showing the chapter points of DVDs etc.

DrDDT
2007-08-16, 13:54
I'm trying to understand the already available classes, but it's hard for me to understand what to use for what, and what to write from scratch.

I'm planning to put the following functionality in the CEdl class:

- construct is using the movie as parameter
- a reader
Read EDL if exists, and/ord read other formats
- store edl in internal format, I was thinking of a variable list of CCutpoint class items.
- write internal EDL structure to cache
- retrieve name of cached edl file to feed to mplayer
- pre-calculate values to use for displaying cutpoints on timeline
- Optional: add/remove cut when playing a file in mplayer
- Optional: jump to previous/next cutpoint

My questions:
- Can I find more documentation somewhere about the XBMC source?
- Are there recommendations of what classes to use for the proposed class? I need to read the a file, process it per line, write the (converted) result to an variable size internal structure, and cache the interal structure using the EDL format.

spiff
2007-08-16, 14:11
sorry, no, the only documentation available is the source itself.

files you read using CFile. it has a readstring() method.
for writing/caching use either CFile or normal fileio since it will be local anyway.

you can catch us on #xbmc (or #xbmc-linux) on irc.freenode.net. we're happy to answer dev questions so dont hesitate to ask

DrDDT
2007-08-19, 21:54
I found a bug/feature in the current implementation:

Mplayer does skip over a cutpoint-pair, but you cannot jump 30seconds/10 minutes back to a point before the cutpoint somehow. It 'bounces back' to a point beyond the cutpoint.

Is this a Mplayer problem, or a XBMC problem?

jmarshall
2007-08-20, 01:36
No idea - try it in regular mplayer :)

DrDDT
2007-08-21, 18:04
How do I add a 'buttonhandler'?
Say I want to add a 'skip to next cutpoint/scene' button, and use it to seek to the next/previous cutpoint/scene marker?

I have code ready to generate the correct seek position.

spiff
2007-08-21, 18:08
first, define the appropriate action. then map it in keymap. finally handle the action in OnAction() whereever you want it (most like CGUIWindowFullscreen).

actions are defined in guilib/Key.h

ButtonTranslator.cpp maps it to a 'human' name which you use in keymap.xml

DrDDT
2007-08-22, 02:33
first, define the appropriate action. then map it in keymap. finally handle the action in OnAction() whereever you want it (most like CGUIWindowFullscreen).

actions are defined in guilib/Key.h

ButtonTranslator.cpp maps it to a 'human' name which you use in keymap.xml

Okay, but how does for example <skipminus>SkipPrevious</skipminus>
map to an action in key.h?

jmarshall
2007-08-22, 03:01
ButtonTranslator.cpp does that.

Another option is just re-using the "Next Chapter/Previous Chapter" actions that already exist (in the DVD player). You'd have to implement an OnAction() in mplayer I think to do this.

DrDDT
2007-08-22, 22:57
Next problem:

I'm trying to debug seeking in a movie using xbmc_pc.
I see the time running of the movie I'm trying to play, but the buttons I defined are not handled by CGUIWindowFullScreen somehow.
Is another class handling these buttons, since the movie is not really playing?

jmarshall
2007-08-23, 02:21
The next/previous chapter seeking is done by the DVDPlayer, which should be working on XBMC_PC, at least for some videos.

If it's not, you can make a quick change to PlayerCoreFactory.cpp to make sure it's being used.

If a video is playing the action gets sent to the player first for processing (so it can do dvd menu stuff for instance) and only if not handled (returns false) drops back to CGUIWindowFullScreen.

Cheers,
Jonathan

DrDDT
2007-08-23, 12:06
The next/previous chapter seeking is done by the DVDPlayer, which should be working on XBMC_PC, at least for some videos.

If it's not, you can make a quick change to PlayerCoreFactory.cpp to make sure it's being used.

If a video is playing the action gets sent to the player first for processing (so it can do dvd menu stuff for instance) and only if not handled (returns false) drops back to CGUIWindowFullScreen.

Cheers,
Jonathan

I'm working on EDL integration with MPlayer, or in XBMC_PC, Dummyvideoplayer. I can see the correct keycodes in the debugscreen, but the OnAction in Dummyvideoplayer is not triggered somehow.

jmarshall
2007-08-23, 12:40
Not sure I can give you any hints, other than to dump a breakpoint in CGUIWindowFullScreen::OnAction() and checking that it goes into that function. Work your way back to CApplication::OnKey() until you find the issue.

Cheers,
Jonathan

DrDDT
2007-08-23, 12:57
Not sure I can give you any hints, other than to dump a breakpoint in CGUIWindowFullScreen::OnAction() and checking that it goes into that function. Work your way back to CApplication::OnKey() until you find the issue.

Cheers,
Jonathan

Ok, I'll try that.

DrDDT
2007-08-23, 22:50
Not sure I can give you any hints, other than to dump a breakpoint in CGUIWindowFullScreen::OnAction() and checking that it goes into that function. Work your way back to CApplication::OnKey() until you find the issue.

Cheers,
Jonathan

Video is not fullscreen in dummyvideoplayer, so I'm stuck in CGUIWindowVideoFiles. I see render code in dummyvideoplayer, but it's not used.
Why is this?

jmarshall
2007-08-24, 00:47
because it's not fullscreen?

Tab toggles to fullscreen IIRC.

DrDDT
2007-08-24, 16:56
because it's not fullscreen?

Tab toggles to fullscreen IIRC.

Ah, that simple!
I expected 'full screen' video by default.

jmarshall
2007-08-25, 01:25
Yeah - the dummy video player is more "dummy" than video player, so the fullscreen switch doesn't happen by default for the basic reason that I've been too lazy to look into it!

DrDDT
2007-09-06, 09:41
When using EDL, standard seeking can give a problem when the seek target is inside a cutpoint. When seeking backward inside a cutpoint, mplayer will jump forward again.

I wrote a seek compensator, but I don't know how to interpret the following code:


//If current time isn't bound by the total time,
//we have to seek using absolute percentage instead
if( GetTime() > iTime * 1000 )
{
SeekPercentage(GetPercentage()+percent);
}


Is it possible not to know the total movie time? Of won't this situation occur for normal movies?
(I must admit I didn't know about percentage seeking. As long as I know of I'm seeking in seconds. :blush:)

Gamester17
2007-09-06, 10:23
Have you had time (and interest) to look at using the EDL class for the DVDPlayer video-player core?
http://xboxmediacenter.com/wiki/index.php?title=DVDPlayer#Development
http://xbmc.org/forum/showthread.php?t=10216
http://xboxmediacenter.com/wiki/index.php?title=HOW-TO:_Debug_Dynamic_Link_Libraries

DrDDT
2007-09-06, 10:39
Have you had time (and interest) to look at using the EDL class for the DVDPlayer video-player core?
http://xboxmediacenter.com/wiki/index.php?title=DVDPlayer#Development
http://xbmc.org/forum/showthread.php?t=10216
http://xboxmediacenter.com/wiki/index.php?title=HOW-TO:_Debug_Dynamic_Link_Libraries

Not yet, but the code is pretty generic and will easily integrate.
If I finish it, I can check out DVDPlayer integration. Maybe we can do something smart with chapters and scenemarkers, so we can use chapters for non-DVD movies.

Gamester17
2007-09-06, 12:05
Maybe we can do something smart with chapters and scenemarkers, so we can use chapters for non-DVD movies.That would be great, some non-DVD video containers such as MKV (Matroska), OGM, NUT, and DIVX (that is .divx and not .avi) do have chapter support. I believe FFmpeg (http://ffmpeg.mplayerhq.hu) which the DVDPlayer uses does have support for chapter markers jumping in some of those containers (I think at least for MKV and OGM). Though I'm not sure if it has been implemented and enabled in the DVDPlayer(?)

DrDDT
2007-09-10, 11:02
When using EDL, standard seeking can give a problem when the seek target is inside a cutpoint. When seeking backward inside a cutpoint, mplayer will jump forward again.

I wrote a seek compensator, but I don't know how to interpret the following code:


//If current time isn't bound by the total time,
//we have to seek using absolute percentage instead
if( GetTime() > iTime * 1000 )
{
SeekPercentage(GetPercentage()+percent);
}


Is it possible not to know the total movie time? Of won't this situation occur for normal movies?
(I must admit I didn't know about percentage seeking. As long as I know of I'm seeking in seconds. :blush:)

I'll ignore this for now.

DrDDT
2007-09-13, 10:18
Hi,

I'm pretty much done with upgrading EDL features by writing a seperate class for it, and I'm thinking of supplying a patch and move on to something else.

I played around a lot, added/removed features, and for now I ended up with the following features:

- Read the following EDL formats:
EDL
ComSkip .txt (with framerate, like Comskip generates)
VideoRedo
- Cache EDL file to disk and pass it to MPlayer.
- Adjust seeking so cutpoints are skipped.
- Support for SceneMarkers for the following formats:
VideoRedo
EDL (I introduced a type '3' for scenemarkers)
- Support for SceneMarkers seeking, added keycode.
(I mapped this to the >| and |< keys on my remote)
- added 'edl:y|n to video status screen.

The following is implemented, but disabled:
- Cutpoint seeking (only usefull for cutpoint editing?)
- Automatically create Bookmarks for every SceneMarker.
(Didn't even test this, because commercial skippers generate a lot of scenemarkers).
- Reading of 'VDR' format, because it's not very well specified.

Not implemented:
- Compensation for cutpoint when movie length is unknown and percentage seeking is used.
- Visual cutpoints/scenemarkers on video progress bar.

Problems/Questions:
- The readers now stop reading at the first format error, and invalidate the EDL. This might be a problem for showanalyzer, I get a lot of strange format errror with this tool. Comskip output is fine.
- Should I be able to go to a scenemarker inside a cutpoint? For now, you can.
- Should one be able to seek inside a cutpoint, and just jump over a cutpoint beginning to avoid bouncing?
- Any other missing features, or should I drop features?
- The code needs more testing. I can only test using XBMC_PC and release code on XBOX, using my limited usage pattern.

DrDDT
2007-09-25, 01:49
Hi!

I modified the CMPlayer::seek function to compensate for cutpoints.
So far this was working fine, but I've run into strange mplayer seek behaviour.

Normally, a seek step is 30 seconds, but to jump over a cutpoint, I dynamically increase it. Next CMPlayer::SeekRelativeTime is called with the changed number.

I noticed that sometimes MPlayer seeks with the 'standard' 30 seconds, and not with the number I called SeekRelativeTime with!

I added some debugging to show that the code is correct, only MPlayer doesn't execute the correct seek:


00:31:12 M: 30973952 DEBUG: Mplayer: SeekRelativeTime:300, command:seek +300 0
00:31:13 M: 30990336 DEBUG: CApplication::OnKey: 166 pressed, action is 22
00:31:13 M: 31039488 DEBUG: CEdl: Compensateseek, curtime:2794.00, old:300 new:300
00:31:13 M: 31039488 DEBUG: Mplayer: SeekRelativeTime:300, command:seek +300 0
00:31:15 M: 30998528 DEBUG: CApplication::OnKey: 168 pressed, action is 20
00:31:15 M: 30994432 DEBUG: CEdl: Compensateseek, curtime:3097.00, old:30 new:455 CORRECTED
00:31:15 M: 30994432 DEBUG: Mplayer: SeekRelativeTime:455, command:seek +455 0
00:31:16 M: 30969856 DEBUG: CApplication::OnKey: 168 pressed, action is 20
00:31:16 M: 30969856 DEBUG: CEdl: Compensateseek, curtime:3553.00, old:30 new:30
00:31:16 M: 30969856 DEBUG: Mplayer: SeekRelativeTime:30, command:seek +30 0
00:31:18 M: 30965760 DEBUG: CApplication::OnKey: 168 pressed, action is 20
00:31:18 M: 31039488 DEBUG: CEdl: Compensateseek, curtime:3585.00, old:30 new:30
00:31:18 M: 31039488 DEBUG: Mplayer: SeekRelativeTime:30, command:seek +30 0
00:31:19 M: 30986240 DEBUG: CApplication::OnKey: 169 pressed, action is 21
00:31:19 M: 30986240 DEBUG: CEdl: Compensateseek, curtime:3617.00, old:-30 new:-30
00:31:19 M: 30986240 DEBUG: Mplayer: SeekRelativeTime:-30, command:seek -30 0
00:31:19 M: 30949376 DEBUG: CApplication::OnKey: 169 pressed, action is 21
00:31:19 M: 30949376 DEBUG: CEdl: Compensateseek, curtime:3588.00, old:-30 new:-30
00:31:19 M: 30949376 DEBUG: Mplayer: SeekRelativeTime:-30, command:seek -30 0
00:31:21 M: 30842880 DEBUG: CApplication::OnKey: 169 pressed, action is 21
00:31:21 M: 30842880 DEBUG: CEdl: Compensateseek, curtime:3559.00, old:-30 new:-455 CORRECTED
00:31:21 M: 30842880 DEBUG: Mplayer: SeekRelativeTime:-455, command:seek -455 0
00:31:21 M: 30965760 DEBUG: CApplication::OnKey: 169 pressed, action is 21
00:31:21 M: 31014912 DEBUG: CEdl: Compensateseek, curtime:3531.00, old:-30 new:-455 CORRECTED
00:31:21 M: 31014912 DEBUG: Mplayer: SeekRelativeTime:-455, command:seek -455 0
00:31:22 M: 31035392 DEBUG: CApplication::OnKey: 169 pressed, action is 21
00:31:22 M: 31035392 DEBUG: CEdl: Compensateseek, curtime:3503.00, old:-30 new:-455 CORRECTED
00:31:22 M: 31035392 DEBUG: Mplayer: SeekRelativeTime:-455, command:seek -455 0
00:31:23 M: 30978048 DEBUG: CApplication::OnKey: 169 pressed, action is 21
00:31:23 M: 31047680 DEBUG: CEdl: Compensateseek, curtime:3476.00, old:-30 new:-455 CORRECTED
00:31:23 M: 31047680 DEBUG: Mplayer: SeekRelativeTime:-455, command:seek -455 0
00:31:24 M: 31010816 DEBUG: CApplication::OnKey: 169 pressed, action is 21
00:31:24 M: 31043584 DEBUG: CEdl: Compensateseek, curtime:3446.00, old:-30 new:-455 CORRECTED
00:31:24 M: 31043584 DEBUG: Mplayer: SeekRelativeTime:-455, command:seek -455 0
00:31:25 M: 31023104 DEBUG: CApplication::OnKey: 169 pressed, action is 21
00:31:25 M: 31023104 DEBUG: CEdl: Compensateseek, curtime:3419.00, old:-30 new:-455 CORRECTED
00:31:25 M: 31023104 DEBUG: Mplayer: SeekRelativeTime:-455, command:seek -455 0


Several times, the command 'seek -455' is sent to mplayer, but a seek of -30 is executed.

Any idea what might be wrong, and how to fix this?

DrDDT
2007-09-27, 11:57
I just submitted the edl class/scenemarker code.

http://sourceforge.net/tracker/index.php?func=detail&aid=1803325&group_id=87054&atid=581840

DrDDT
2008-05-21, 15:29
Hi!

I modified the CMPlayer::seek function to compensate for cutpoints.
So far this was working fine, but I've run into strange mplayer seek behaviour.

Normally, a seek step is 30 seconds, but to jump over a cutpoint, I dynamically increase it. Next CMPlayer::SeekRelativeTime is called with the changed number.

I noticed that sometimes MPlayer seeks with the 'standard' 30 seconds, and not with the number I called SeekRelativeTime with!

Several times, the command 'seek -455' is sent to mplayer, but a seek of -30 is executed.

Any idea what might be wrong, and how to fix this?

This behaviour also occurs with the new EDL code, using seektime().

I traced down the problem to the following situation:

Say your EDL file contains a cut from 300 to 600 seconds.
With the 'new' EDL code, the cuttime is removed, so when you're at 610 seconds absolute time, XBMC will display 610-300 cut seconds = 310.

Now when you're at 310 seconds, and trying to seeks before the cutpoint, say to 290 seconds, the bug occurs.

Somehow, the EDL code of MPlayer re-applies the cutpoint, and jumps back to past the cutpoint. A seek to 290 will often throw you back beyond the cutpoint.

I tried debugging, but you cannot debug mplayer.dll easy.

Any ideas would be welcome.