Kodi-send --action=TakeScreenshot

I would like to take screenshots of two different files. One 4k HDR as seen on 1080p SDR TV and one 1080p SDR and at the exactly the same moment to compare the colors and lightning and I need to know if I can add a timestamp to that kodi command to get it right.

Is it possible to go frame by frame in kodi ?

I don’t think it’s possible to go to an exact frame (probably only an I frame). But for your purposes, something like this should get you near enough to the same scene.

#!/bin/bash

playerIP=127.0.0.1
playerport=8080

if [[ $1 == "seek" ]]; then
	curl -s --data-binary \
	'{"jsonrpc": "2.0", "method": "Player.Seek", 
		"params": { 
			"playerid": 1, 
			"value":{ 
				"time":{ 
					"hours": '$2',
					"milliseconds": '$5',
					"minutes": '$3',
					"seconds": '$4'
				}
			} 
		}, 
		"id": "VideoGetItem"
	}' \
	-H 'content-type: application/json;'\
	http://osmc:osmc@$playerIP:$playerport/jsonrpc
elif [[ $1 == "stop" ]]; then
	curl -s --data-binary \
	'{"jsonrpc": "2.0", "method": "Player.Stop", 
		"params": { 
			"playerid": 1
		}, 
		"id": "VideoGetItem"
	}' \
	-H 'content-type: application/json;'\
	http://osmc:osmc@$playerIP:$playerport/jsonrpc
elif [[ $1 == "pause" ]]; then
	curl -s --data-binary \
	'{"jsonrpc": "2.0", "method": "Player.PlayPause", 
		"params": { 
			"playerid": 1
		}, 
		"id": "VideoGetItem"
	}' \
	-H 'content-type: application/json;'\
	http://osmc:osmc@$playerIP:$playerport/jsonrpc
else
	echo 'Usage osmcplayer.sh stop|seek|pause hours minutes seconds milliseconds'
fi
3 Likes

How would I use this script in practice? Just copy paste into putty and press enter? while playing each file? Or do I have to create a Linux equivalent of a bat file and then run it? Sorry, I’m really bad at these things. The only time I used Linux before I bought a very was when I was 13 and learned about dual boot and Linux because I was afraid that my parents will see that I’m watching porn in windows :monkey:

Your secret is safe here :wink:

You need to make a script file. Using ssh (putty):

cd /home/osmc
mkdir bin
cd bin
nano osmcplayer.sh

cut and paste (right mouse button or shift-Ins) the text I posted above into the nano editor. Save the file (Ctrl-X, Yes).

chmod +x osmcplayer.sh

Now start a video playing and you can type, say:

osmcplayer.sh pause
osmcplayer.sh seek 0 0 30 0

That will take you to 30sec into the file.

HTH

Oh, and you may have to enable the webserver (Settings-Services-Control). The script assumes the port is 8080 and the username and password are the default.

1 Like