Pixiv Ugoira zip anime player basicly done. Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Pixiv Ugoira zip anime player basicly done.

07 Feb 2017, 13:17

I want to load a batch of frame pictures , fast slideshow make it looks like motional.

Let's say load 100 frames load in array, then fast loop slideshow till click close window.


But , fail at the beginning . Don't even success with 2 picture slow loop show

Let's use old uploaded pics to test.
Two dna jpgs from that thread:
https://autohotkey.com/boards/viewtopic.php?t=6121
Change dna.jpg to dna1.jpg
Now we got dna1.jpg dna2.jpg

I try load pics by pattern , then test 1 second for loop show each frame , but it never change. ( And click closed window but ahk still run back ground.)
What's wrong? I beg for help .

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus





Update post:
Play Ugoira zip anime as what it is , without converting to gif or mp4 or webm or any other form.
zip reading front is on going.


What zip anime is https://marcan.st/talks/2014_pixiv_ugoku_player/
Original code is for brower playing
https://github.com/pixiv/zip_player
What I am trying to write is local player without web .
Last edited by peter723pan on 09 Feb 2017, 10:48, edited 6 times in total.
brutus_skywalker
Posts: 179
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Load imgs to array then loop slideshow till exit.

07 Feb 2017, 13:32

check this out,
https://github.com/dufferzafar/Autohotk ... ula%20Girl,
I recommend you download whole github folder before you run script as the images the script loops through are in a sub folder.
Outsourcing Clicks & Presses Since 2004.
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: Load imgs to array then loop slideshow till exit.

07 Feb 2017, 15:03

brutus_skywalker wrote:check this out,
https://github.com/dufferzafar/Autohotk ... ula%20Girl,
I recommend you download whole github folder before you run script as the images the script loops through are in a sub folder.


Thanks for replying.

I download it and tried.
first popup fail , no gdip.
Downloaded from that thread :
https://autohotkey.com/board/topic/2944 ... 45-by-tic/
Add this line :
#Include, Gdip.ahk

Click run . Showing nothing. I tried to rename pictures , then found it was running in the back ground with nothing showing, but locked pictures.
Taskmgr killed it .

Is't the Script ahk version too old , my AHK setup in 2015 ,downloaded from AHK homepage here.
Maybe the version change script rule , like AHK offical doc some example lines don't work on new version.
Last edited by peter723pan on 08 Feb 2017, 08:59, edited 3 times in total.
User avatar
Xtra
Posts: 1192
Joined: 02 Oct 2015, 12:15

Re: Load imgs to array then loop slideshow till exit.

07 Feb 2017, 15:07

Based on these lines in the script:

Code: [Select all] [Download] GeSHi © Codebox Plus

;Create Bitmaps from Files
SetWorkingDir %A_ScriptDir%\Images
Loop, *.png
{
pBitmap%A_Index% := Gdip_CreateBitmapFromFile(A_LoopFileName)
}


You will need to have a sub folder named Images with .pngs in it at your scripts location.

HTH
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: Load imgs to array then loop slideshow till exit.

07 Feb 2017, 15:17

Xtra wrote:Based on these lines in the script:

Code: [Select all] [Download] GeSHi © Codebox Plus

;Create Bitmaps from Files
SetWorkingDir %A_ScriptDir%\Images
Loop, *.png
{
pBitmap%A_Index% := Gdip_CreateBitmapFromFile(A_LoopFileName)
}


You will need to have a sub folder named Images with .pngs in it at your scripts location.

HTH


I notice those lines:
SetWorkingDir %A_ScriptDir%\Images
Loop, *.png

I had folder and the pngs from that script site , it just doesn't work , not even show why , no popup msg .
Pngs got lock by the script , so it must found they.
just me
Posts: 5431
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Load imgs to array then loop slideshow till exit.

08 Feb 2017, 03:18

You might look for LoadPicture() (look at the example).
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: Load imgs to array then loop slideshow till exit.

08 Feb 2017, 06:57

just me wrote:You might look for LoadPicture() (look at the example).


Thank you very much, this function should have a tag in user doc "Graphical User Interfaces" or "Screen" .
How you found it ? That may be helpful to efficiently search doc .

New version is great , but download from Offical homepage at my place is painful. Download all ways fail and cannot rusume. Proxy connect popup Captcha of "proof your are human".
Finally use new version .
It works great.

That 's much easier to fast load and show pictures , extra gdip is not needed. Though some old script need to rewrite , it pops error in new version.

( By the way , I also try to do this slideshow thing by python tk gui , it's gui redraw rate is too slow , about 0.6 second per frame is tk canvas's limit . AHK done well. )
Last edited by peter723pan on 08 Feb 2017, 08:05, edited 1 time in total.
brutus_skywalker
Posts: 179
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Load imgs to array then loop slideshow till exit.  Topic is solved

08 Feb 2017, 07:18

I'm using the latest version of ahk but mine works so here's the script and gdip that i'm using, place them both in the same folder as the 'Images' folder and give it a shot,you can even change the images in the folder to your own,it loops through all png files in the images directory.

Code: [Select all] [Expand] [Download] (HulaGirl.ahk)GeSHi © Codebox Plus





Code: [Select all] [Expand] [Download] (Gdip.ahk)GeSHi © Codebox Plus

Outsourcing Clicks & Presses Since 2004.
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: Load imgs to array then loop slideshow till exit.

08 Feb 2017, 08:04

brutus_skywalker wrote:I'm using the latest version of ahk but mine works so here's the script and gdip that i'm using, place them both in the same folder as the 'Images' folder and give it a shot,you can even change the images in the folder to your own,it loops through all png files in the images directory.




Yes, it works this time.

The offical LoadPic() Loop over and go back restart showing smoothly , though had white screen glitch randomly while playing.

This Gdip way doesn't have the white screen glitch problem , but it disappear at every loop back about 0.6 second. If could fix this problem Gdip way may be best.
brutus_skywalker
Posts: 179
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Load imgs to array then loop slideshow till exit.

08 Feb 2017, 08:25

Well if you used with the hulagirl images you'll find it's wicked smooth,but if you're using your own images you could tweak this line:
SetTimer, Animate, 50 ;the numeral represents the speed at which the images are being cycled and changing it about might make the end of the loop and image cycle restart less abrupt.
Outsourcing Clicks & Presses Since 2004.
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: Load imgs to array then loop slideshow till exit.

08 Feb 2017, 08:40

brutus_skywalker wrote:Well if you used with the hulagirl images you'll find it's wicked smooth,but if you're using your own images you could tweak this line:
SetTimer, Animate, 50 ;the numeral represents the speed at which the images are being cycled and changing it about might make the end of the loop and image cycle restart less abrupt.


Whatever , thanks for your time replying so far.

On forum there was a chm guide for Gdip , but it is not downloadable now , with hard to modify it fit my hope , guess it lefts offical LoadPic() to do it.
just me
Posts: 5431
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Load imgs to array then loop slideshow till exit.

08 Feb 2017, 11:15

might help to reduce flickering in this case.

WS_EX_COMPOSITED (0x02000000L)
Paints all descendants of a window in bottom-to-top painting order using double-buffering.
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: Load imgs to array then loop slideshow till exit.

08 Feb 2017, 13:17

just me wrote:might help to reduce flickering in this case.

WS_EX_COMPOSITED (0x02000000L)
Paints all descendants of a window in bottom-to-top painting order using double-buffering.


It's dosen't change any. but nevermind , there's other problem.

I want to read image files from an uncompressed zip ,

but after find out the offset then FileOpen() file.RawRead ,
both LoadPicture() Gui, Add, Pic, wouldn't accept rawdata in memory. :crazy:
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: Load imgs to array then loop slideshow till exit.

09 Feb 2017, 03:30

brutus_skywalker wrote:I'm using the latest version of ahk but mine works so here's the script and gdip that i'm using, place them both in the same folder as the 'Images' folder and give it a shot,you can even change the images in the folder to your own,it loops through all png files in the images directory.



Your code set a static image number. I what tested pics just 33 frames that's why blank .

I change image number to Var, and the loop way to use GOTO, I am plan to manual control loop index .
Timer removed.

And change loading way to read image struct memory , because my final goal is directly read uncompressed image file from a zip pack.

It's all about local play the pixiv site zip anime file. Pixiv had their code open https://github.com/pixiv/zip_player
https://marcan.st/talks/2014_pixiv_ugoku_player/
But is for web server and brower way to play, what I am doing is write a local play script for playing zippack frame, without unzip or convert to apng or ffmpeg coding it to mp4 webm .

This testing code is read from hard disk files , zip part is on going .
The load to memory code is from Sean provided in old thread https://autohotkey.com/board/topic/2121 ... o-hbitmap/

Edit post update:

This early code have a lot of bugs , I remove it . Go see the final one .
Last edited by peter723pan on 16 Feb 2017, 09:16, edited 7 times in total.
brutus_skywalker
Posts: 179
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Pixiv Ugoira zip anime player on going.

09 Feb 2017, 06:54

So am i right to assume apart from the loading images from zip component, you have solved the flickering issue,i'm only asking such that if you did, i want to keep you're version as a future fix for any future encounter with flickering,i have a 'scripts for future fixes' folder,just want to be sure to put it there :shifty: . Cheers.
Outsourcing Clicks & Presses Since 2004.
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: Pixiv Ugoira zip anime player on going.

09 Feb 2017, 07:23

brutus_skywalker wrote:So am i right to assume apart from the loading images from zip component, you have solved the flickering issue,i'm only asking such that if you did, i want to keep you're version as a future fix for any future encounter with flickering,i have a 'scripts for future fixes' folder,just want to be sure to put it there :shifty: . Cheers.


Your script does not flick , is blank if swap to frames that are not the same as your hulagirl png number , 84, the missing frame will blank .
Also if swap to frames more than 84 , rest part will not be show.

I change to auto count frame number and loop as counted number. It will not blank now.
Last edited by peter723pan on 09 Feb 2017, 07:27, edited 1 time in total.
brutus_skywalker
Posts: 179
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Pixiv Ugoira zip anime player on going.

09 Feb 2017, 07:25

Brilliant,thanks for the quick heads up,best of luck with the zipped playback.
Outsourcing Clicks & Presses Since 2004.
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: Pixiv Ugoira zip anime player on going.

09 Feb 2017, 10:40

brutus_skywalker wrote:Brilliant,thanks for the quick heads up,best of luck with the zipped playback.


I add a memory free line . After the File.close()

Code: [Select all] [Download] GeSHi © Codebox Plus

        File.Close()
VarSetCapacity(Buffer, 0)

And the uncompressed zippack frames player is basicly done.

https://marcan.st/talks/2014_pixiv_ugoku_player/
Download this pixiv Ugoira player demo page zip pack test.
https://marcan.st/talks/2014_pixiv_ugok ... /cirno.zip
or a small one, change script to read it :
https://marcan.st/talks/2014_pixiv_ugok ... takata.zip

Still need add get the filename of script itself , fullscreen , resize , combine Gdip.ahk lines in script and remove unused Gdip.ahk lines.
Just finished main function.

Edit post Update:

Combining Gdip.ahk that part I keep it myself. Since play Ugoria zip pack just my personal interest, read Ugoria frame delay list is not content in this post.
Just consider it is an update for hulagirl.ahk

All other coding finished.

Still can only read "store" type zip pack, add support for none Ugoria zip pack ,which winrar 7zip created "store-noncompressed" zip file.
Now can skip file extra info data , skip folders in zip.

Compressed type not support , can't find good AHK example for doing that , and some of it need extra .dll , which I don't want to.
GDI+ drawing still not very fast while resizing picture, but DirectDraw , I search those old threads on forum , nobody can do it .


How to use it . For example Hulagirl , pack png files of Hulagirl in a zip pack , compress type choose "store".
Now your get a Hulagirl.zip
Rename this script to Hulagirl.ahk , it will read the zip pack with the same main filename (in same folder), just like subtitle file.

Right Mouse Button Toggle Pause : while in pause , mouse wheel down , pageDown key , Xbutton2 make show next frame ,
mouse wheel up , pageUp key , Xbutton1 make show previous frame ,

Middle Mouse Button Toggle Fullscreen , it's auto fit.

Left Mouse Button drag window.

ESC key exit script.

Keeping Right Mouse Button down then click Left Mouse Button also exit script.

Sorry for my bad English discrption , I know my words had some grammar mistakes.
It have been long time since left school, English is not my native lauguage. 我说中文。


Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Last edited by peter723pan on 16 Feb 2017, 09:17, edited 6 times in total.
brutus_skywalker
Posts: 179
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Pixiv Ugoira zip anime player basicly done.

10 Feb 2017, 02:57

"And the uncompressed zippack frames player is basically done."
"it's freaking done!" :bravo:
FREAKIN AWESOME, i FOOLISHLY had doubts, i can think of a few applications for this,hell one can easily combine this with http://www.autohotkey.com/board/topic/8 ... ?hl=binrun, since one can load the zip file in a compiled script to memory,now you can actually have animated splash images and such with out every extracting a single MEG of data from a compiled exe. I must also say i learned a few new tricks from your code,for my future endeavors, so Thanks. I rarely stray into GUI's and out side of logic & math driven console-code mainly in python,now i can roam a bit farther....

A frames per second control variable will also be usefull for your final version,i had to add a few sleep commands to throttle cpu usage.

AWESOMEjob dude.
Outsourcing Clicks & Presses Since 2004.
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: Pixiv Ugoira zip anime player basicly done.

13 Feb 2017, 12:32

brutus_skywalker wrote:........



Last update:

For it's not master peace like tic's GDIP.ank in "Scripts and Functions" board .

And seen not like "Helpful script writing tricks" in "Tutorials" board .


Not very useful script , but if your like the Hulagirl.ahk , can think this is an update .

I not going to start a new thread , just post final code here .

AH, it's done.

Return to “Ask For Help”

Who is online

Users browsing this forum: Hellbent, ZeroX4 and 70 guests