xbmc.Player().seekTime() doesn't update screen when video paused
#1
First let me explain what I'm trying to do:

I have a number of videos that are recorded from MythTV and then converted/compressed to MP4. The issue I have is the commercial breaks. I find the mythcommflag job doesn't always get it right (and often gets it very wrong!). I'm therefore writing a script that lets me create an EDL file for videos that I watch through Kodi.

The way it works is that you start the script and then start playing the file. When you pause the video, the script asks you if you want to add a marker at that spot. However, as my reactions are not lightning fast, there's a natural delay between where I want the marker to be and where I hit pause! To counter this, I want the script to be able to nudge the video forward or back until I hit the right spot. I do this by using the seekTime method of the player. However, while the seekTime method works (in that Kodi tells me the video is seeking), the paused screenshot doesn't update until I resume the video, at which point it jumps to wherever the seekTime told it to go. Unfortunately, this defeats the purpose of what I'm trying to do as I need to be able to see whether the video is in the right place.

So the simple question is: is there a way to force the video screen to refresh without resuming the video?
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#2
This is a very cool idea. Can you share some sample code to have a look?
Reply
#3
Sure. I'm away until tomorrow evening but can try to share something then.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#4
Code is on github: https://github.com/elParaguayo/script.edl.creator

If you set this line to True then the script will give you the menu about adjusting the video time - that's the bit that's not working. If you set it to False then the script just adds the marker wherever you hit pause.

Another quirk that's coming out of this is that, when using the time adjustment bit, it seems to enter a bit of a recursive loop so the menu pops up again even when you've added the marker. I tried to prevent that by using flags (see here and here) but it's not quite working.

Any tips greatly appreciated.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#5
Great, I'll have a look at it for sure. Thank you for sharing
Reply
#6
Hey mate,

I've been making some experiments with the json-rpc api using Player.Seek with a video paused and you have full control over the player there. By doing "smallbackward","bigbackward" or "smallforward"/"bigbackward" with the player paused it will seek to the desired time and it will refresh the screen. So probably you can use something similar on your script?
The method also allows you to seek to a given time. In both cases, as the method receives the player.id as an argument you need to call player.getactiveplayers first.

Here's a quick demo:

https://www.youtube.com/watch?v=9sGw6kJD...e=youtu.be

I can't stop recomending people the tool by angrycamel I'm using in the video (http://forum.kodi.tv/showthread.php?tid=172734). It saves you a lot of time understanding the structure and options of all json-rpc calls. All calls can be used in python with xbmc.executeJSON(). In the case of the video above:

Code:
'{"jsonrpc":"2.0","method":"Player.Seek","params":{"playerid":1,"value":"bigbackward"},"id":43}'

cheers
Reply
#7
Funny, I had originally intended to use JSON but thought that direct python calls would be quicker as I had assumed that the JSON calls would be calling the same core functions as the python class methods. I guess this was a bad assumption.

I'll try to give it a go later tonight and let you know how I get on (thanks for the pointer to angrycamel's JSON-RPC utility - I'll give that a try too).

Obrigadinho.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#8
Sadly this doesn't seem to work either. The JSON requests work because I get the seeking notification on the video, but there's no refresh of the screen itself.

If I use the JSON RPC browser, the video does update but only when I use the small step, big step etc. If I use the "time" parameters then it doesn't update.

Unfortunately, I think I need to use this latter method as I'm looking at small margins here.

EDIT: The revised code is on Github so you can see how I've implemented it.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#9
The other way I'd thought about doing this was with some slow motion or frame advance functionality but I don't think either of these are currently possible in Kodi.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#10
Yes I've seen the issue now. The problem is the small step you're applying is too small :/ 1 or 2 seconds step do work fine though. I have no idea how this is implemented internally but it seems to me that kodi only renders a % of the total number of frames when seeking the video and shows the closest one. When you do a rewind you notice this...despite the time bar changes its value only sometimes the frames are refreshed on the screen. No absolute truth though...just what it seems to me that kodi is doing.

Probably you can ping someone from the team with knowledge on this? Don't know exactly who...probably @FernetMenta?

I can't figure out, unfortunately, other way for you to do this. Rendercapture() will likely give you the same result (if the class can be used at all for this goal).

Sorry.

Cheers
Reply
#11
I've seen a few (old posts) about how slow motion, frame-by-frame skipping won't be implemented.

RenderCapture is an interesting idea. I might try and see if that updates but I'm not overly hopeful (I've also never used it before so it's going to be a slow learning process for me!).

If the worst comes to the worst, I'll just disable the frame jumping and keep it as the simple version because, after all, the script does work - it's just not as perfect as I'd like it to be!

Thanks for all your tips.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#12
RenderCapture didn't work either (or rather I could take screenshots easily enough but the screenshot didn't change with small updates).

I think I'll go back to my simple version for now.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply

Logout Mark Read Team Forum Stats Members Help
xbmc.Player().seekTime() doesn't update screen when video paused0