Cannot make proper ScreenShot on x265 videos

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

So many dunk memes lost cuz screenshots stopped working correctly.
Dunk memes were the most important feature of CoreELEC.
Santa wants dunk memes back!

Try echo 2. Also, this only affects HEVC and VP9 content.

I extensivly tested script.amlogic.framecapture.zip but alas, it randomly fails for me. Cannot spot any pattern. Maybe it’s some racing issue.

For example Silicon Valley S06E02…

If any of you can recommend hardware where screenshots work without issues
then that will be appreciated. My old but otherwise working ok S905X sucks.

PS sometimes but rarely a screenshot is good (regardless of codec or image ratio)

you wrote,

“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.”

I’d rather have better video quality than photos

1 Like

I literally can’t tell any difference in picture quality when setting 2 in double write for h265 or vp9.
Tested on many h265 shows (cuz I don’t have a fast net and this encoding is much smaller). I assume the degraded quality issue depends on the hardware and S905X is somehow not affected.

Though screenshots still have black stairs in the corner so went back to defaults anyway.