123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|518|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Extracting Frames

Page : 1 2 Next
Prev
Sun, 24 Jun 2018, 02:32
spinal
is it possible to extract 8-bit frames from a video (using ffmpeg) and have each image use the same palette?

-=-=-
Check out my excellent homepage!
Sun, 24 Jun 2018, 02:32
Jayenkai
If you can find a decent gif converter, gif allows palettised frame/video Settings, with colour limits. (Eg, you can specify 32 colours, and have the 32 colour palette be per frame, or consistent through the entire gif)

If you still have Jasc PaintshopPro 7,there should be an AnimShop exe in the folder, that can do a lot with it's optimise animation function. But you will need to get it from ffmpeg compatible to AnimShop compatible format, first. Export to full individual frames, then use AnimShop's import option..?

Either that or find a tool that can do everything at once.

But, either way, aim for .gif, as it has nice limitations.

-=-=-
''Load, Next List!''
Sun, 24 Jun 2018, 03:19
spinal
Found it!

The following batch file will first create a good fit palette for the whole video, then use that palette to extract 8bit frames in bmp format




-=-=-
Check out my excellent homepage!
Sun, 24 Jun 2018, 03:26
Jayenkai
Ooh, a premade palette. Nice!
Sun, 24 Jun 2018, 03:38
spinal
I can't take credit for the code, but I did google it myself

-=-=-
Check out my excellent homepage!
Sun, 24 Jun 2018, 13:24
Dabz

but I did google it myself


That give me a chuckle!

I sorta do the same at work if someone drops a bollock, I'm like "Well, I'm not going to name names, nah, but me and Keith were there, and it wasnt me!" hehehe

Dabz

-=-=-
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 8Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit
Sun, 24 Jun 2018, 13:34
spinal
Its a long time since I've tried to blitz something, but this should work right?



...it doesnt.



-=-=-
Check out my excellent homepage!
Sun, 24 Jun 2018, 13:48
Jayenkai
Any way of including the files, or is it a mega-sized file?!

-=-=-
''Load, Next List!''
Sun, 24 Jun 2018, 14:14
spinal
It's a few thousand smallish files. Extracted from a video using the code higher up. But for test purposes any old 8bit bmp files should do. In fact any file with a size larger than a 110x88 bmp.

-=-=-
Check out my excellent homepage!
Sun, 24 Jun 2018, 15:17
Jayenkai
OK, I'll see what I can fathom!

Meanwhile
Quick tip : infile$=a$+Right$("000"+frameNumber,3)+".bmp"

-=-=-
''Load, Next List!''
Sun, 24 Jun 2018, 15:37
Jayenkai
Issue 1.
--- If fileNumber < 1000 Then b$ = "" + frameNumber
fileNumber vs frameNumber



Issue 2.
--- gfxr=LoadImage(infile$)
gfxr?

-=-=-
''Load, Next List!''
Mon, 25 Jun 2018, 00:53
spinal
typo! dammit!
Mon, 25 Jun 2018, 14:08
spinal
current conversion progress...

requirements - ffmpeg

The first step is to rip the frames from whatever video we use. The following bat file will rip all o fthe files and a nice small size, all images using the same 256 colour palette, while flipping the image upside down (bmp files are saved upside down, we want them the correct way up).

convert.bat


Then the following blitzbasic code copies the first frames palette, then every other frames image data to a single file.

movie_maker.bb


The video file can then be tested with the following code

movie_player.bb


and finally, the pokitto code



Here is is in action...
https://twitter.com/i/status/1011335716746547202

-=-=-
Check out my excellent homepage!
Mon, 25 Jun 2018, 14:47
Jayenkai
That’s not Bill and Ted.. !!!

Great work, though.
Any specific purpose?

-=-=-
''Load, Next List!''
Tue, 26 Jun 2018, 00:56
spinal
Other than wondering if it would work you mean?
Tue, 26 Jun 2018, 01:41
Jayenkai
LOL, ok
Tue, 26 Jun 2018, 04:49
rockford
That's really cool
Tue, 03 Jul 2018, 09:25
spinal
Here's a question...

The following code is only getting through about 10% of my video file before simply closing (it's not supposed to close, but wait for esc key) Can anyone see anything wrong with it?

Are there for example any limits to reading/writing files of a certain size in blitz3d?



-=-=-
Check out my excellent homepage!
Tue, 03 Jul 2018, 10:05
Jayenkai
I can't remember if Blitz2D/3D/Plus cleaned up when you LoadImage() over another image.
Just in case, add a FreeImage(gfx) in there, and see if that helps.

-=-=-
''Load, Next List!''
Tue, 03 Jul 2018, 10:09
spinal
Well spotted, added it and it seems to be working
Thanks Jay!

It's now at 29000 out of 77611 frames and counting

-=-=-
Check out my excellent homepage!
Tue, 03 Jul 2018, 10:53
spinal
Nope, it still doesn't make it to the end not far off though.

-=-=-
Check out my excellent homepage!
Tue, 03 Jul 2018, 12:30
Jayenkai
Is it crashing or exiting the loop? Stick a little flag/debug/something so that you can tell if it's exiting or crashing...
(maybe a Writestring(outfile,"Closed Normally") before the closefile, then check in the file when it's done)
That should help decide whether it's a "weird" issue that's closing the loop early, or whether it's another memory based issue.

-=-=-
''Load, Next List!''
Tue, 03 Jul 2018, 13:11
spinal
It's freezing and becoming unresponsive at around frame 77598, give or take. Which puts the output file at around 614mb.

-=-=-
Check out my excellent homepage!
Tue, 03 Jul 2018, 13:26
Jayenkai
If you can get it to repeat the task, could you possibly make a second edition to start from the given frame, and continue the video?!

-=-=-
''Load, Next List!''
Tue, 03 Jul 2018, 13:37
spinal
Good idea, I'll test now starting at frame 50000...

|edit| Got to 77602. I wonder if its something to do with the 54.7mb audio file...
[edit2] tried without seeking the audio file to the correct position, copying from the beginning instead, same result.

I wonder if blitz, or even windows for that matter, has a problem with the number of files in a folder?

Even starting at frame 76000 (out of 77611) it still gets to roughly the same point
|edit| Even removing the image preview doesn't help.
This is weird one.

-=-=-
Check out my excellent homepage!
Tue, 03 Jul 2018, 14:34
Jayenkai
obvious checks.. the specific image file is ok?
The palette number's not somehow a non byte?
If it’s sticking specifically on that same number, I’d focus on that, not your code...

-=-=-
''Load, Next List!''
Page : 1 2 Next
Prev