Cannot make proper ScreenShot on x265 videos

Just found out today that SS on all x265 resolutions come out garbeld with vertical lines on my X92_S912 (CE8.95.6)
However SS on all x264 resolutions work properly…

Is it just on my box or…?

1 Like

I don’t think anyone tried that already.

yes, the same lines and part of last x264 frame

1 Like

This is what I get from a screenshot of X265.

I have also noticed some strange kind of stepping in the top right hand corner for capture from any other format.

I’m using the commend kodi-send --host=127.0.0.1 -a “TakeScreenshot” from within WinSCP.

1 Like

I have exactly the same problem, my box have s912 cpu, with 2gb ram.

The same issue here. I cannot make proper screenshots though I was able to do that ~2 or 3 releases ago.

The same thing happens with vp9 encoded video as well, you can fix it by creating an autostart.sh file in .config that contains:-

echo 1 > /sys/module/amvdec_h265/parameters/double_write_mode
echo 1 > /sys/module/amvdec_vp9/parameters/double_write_mode

You’ll need to reboot to apply the changes.

2 Likes

Isn’t it?

 echo 3 > /sys/module/amvdec_h265/parameters/double_write_mode
 echo 3 > /sys/module/amvdec_vp9/parameters/double_write_mode
1 Like

I’ve been using echo 1 > for months and it works perfectly fine for me.

Both 1 and 3 work, 2 messes up the resolution of the playing file.

On my S912, using echo 1 or echo 2, X265 playback makes the screen go haywire and any attempt at capture results in a black screen

echo 3 works perfectly for X265

X264 also continues to work, although there is still the ‘stepping’ issue that is not present with X265 capture.

Thanks guys for the pointing in the right direction though as it’s a step forward :smiley:

Unless all you do all day is taking screen captures of what you are watching, I wouldn’t recommend using double_write_mode, as it degrades picture quality due to compression.

Screenshots can be useful for a variety of uses, whether regular or occasional.

From where I sit though, there are now 2 options to use dependent upon the trade off in picture degradation against having a working option, so having a choice is a step forward pending any form of final solution further on down the line.

1 Like

I think this is due to the fact that there is no way to synchronize between when the capture occurs and weather or not the amvideocap0 buffer is completely full of data.

I wrote this script that basically replicates the capture code Kodi uses but in python, it preforms 3 captures one after the other, guaranteeing that the last one will contain a full frame of data.

Give it a go if you want. As an added bonus it captures just the video frame, no GUI overlaid on top.

script.amlogic.framecapture.zip (3.7 KB)

Just add the script to any button on you remote using a keymap and you are set.

   <keymap>
       <fullscreenvideo>
           <keyboard>
               <key id="your_key_id">runscript(script.amlogic.framecapture)</key>
           </keyboard>
       </fullscreenvideo>
    </keymap>
2 Likes

Cheers.

I’ll give that a whirl.

Nice, how can I made capture gui and frame together ?

Use Kodi’s built in capture.

My script directly accesses the amvideocap0 buffer and thus has no knowledge or access to Kodi’s GUI buffer and so will never be able to capture it.

Carried out some basic testing and so far it seems to do the job quite admirably.

I’ll give a full appraisal when I’ve tested various files and streams but as an alternative option out of the box so to speak, It’s impressive.

1 Like

For me the summary is following:
on current CoreELEC release screenshots don’t work.


Sole script.amlogic.framecapture.zip also don’t work (gives above image too).
Update: it looks like it works for some shows but screenshotting x265 4:3 Star Trek: Voyager
consistently results in garbage.

Changing double_write_mode to 1 or 3 results in glitches.

Changing double_write_mode to 3 and
using script.amlogic.framecapture.zip results in screenhots
but they are low resolution and sometimes have a visible artifact in top right corner.
Setting double_write_mode to 1 and using above script crashes Kodi for me.

Is there some way to restore working screenshots like in older CoreELEC releases?

(Tested on X96 S905X.)

After more testing of script.amlogic.framecapture.zip errors seem random.
I got one proper screenshot from 4:3 x264 Star Trek Voyager but garbage from The Flash x265

@roidy maybe increasing captures number could help in my case?

I checked all 4 and I still have the right corner black

how to withdraw from these settings ???

echo 1 > /sys/module/amvdec_h265/parameters/double_write_mode
echo 1 > /sys/module/amvdec_vp9/parameters/double_write_mode

echo 3 > /sys/module/amvdec_h265/parameters/double_write_mode
echo 3 > /sys/module/amvdec_vp9/parameters/double_write_mode