Another Video Test

For Scene Demos that display animations, graphics, and music. Also for tech demos of graphics capability of VERA or the audio capabilities of the PSG, FM, or PCM audio channels.
User avatar
ahenry3068
Posts: 1181
Joined: Tue Apr 04, 2023 9:57 pm

Re: Another Video Test

Post by ahenry3068 »

Ed Minchau wrote: Sat Jan 04, 2025 5:20 pm I've done a number of these over the years. The main bottleneck is getting data from the SD card to VERA. I've managed 20fps for a distorted image (2.35 to 1 converted to 160x32 pixels, then using VSCALE to stretch the vertical back to proper proportions). I've got some ideas for converting video to double PETSCII, perhaps with a special character set.
I can get 15 fps pretty reliably with 4bpp video. Either Grayscale or color at 160x112.

8 bpp with Palette update I'm struggling with 10 fps at that res. (I'm almost making it but don't quite have the proper Audio parameters yet. It works fine on the Emulator in HOSTFS but i get Audio artifacts on hardware because of the FIFO running empty. Also on Hardware it's strongly dependent on the quality of SD-Card used and even where on the SD-Card the files reside.
User avatar
ahenry3068
Posts: 1181
Joined: Tue Apr 04, 2023 9:57 pm

Re: Another Video Test

Post by ahenry3068 »

Ed Minchau wrote: Sat Jan 04, 2025 5:20 pm I've done a number of these over the years. The main bottleneck is getting data from the SD card to VERA. I've managed 20fps for a distorted image (2.35 to 1 converted to 160x32 pixels, then using VSCALE to stretch the vertical back to proper proportions). I've got some ideas for converting video to double PETSCII, perhaps with a special character set.
I actually just ordered a couple different brands of UHS II SD-Cards to see if they make any difference. Transcend brand was rated the Highest but pricey ($59,00 bucks for a 64gb card !!). I may spring for one eventually. In the meantime I ordered a Samsung Extreme Pro and a Lexar Professional both 128gb's and less than the Transcend card. Both of these cards rated very well and my existing Samsung cards are the fastest I currently own.
Ed Minchau
Posts: 508
Joined: Sat Jul 11, 2020 3:30 pm

Re: Another Video Test

Post by Ed Minchau »

ahenry3068 wrote: Sat Jan 04, 2025 5:56 pm (I'm almost making it but don't quite have the proper Audio parameters yet. It works fine on the Emulator in HOSTFS but i get Audio artifacts on hardware because of the FIFO running empty.
For audio I've been using 12970 Hz 16 bit mono. That puts 2594 bytes in the FIFO every 1/10 of a second. By the time the FIFO reaches 1024 bytes remaining there's just under 0.04 seconds of data remaining in the buffer, more than enough time to push another 2594 bytes (and the buffer won't overflow that way either).
User avatar
ahenry3068
Posts: 1181
Joined: Tue Apr 04, 2023 9:57 pm

Re: Another Video Test

Post by ahenry3068 »

Ed Minchau wrote: Sun Jan 05, 2025 9:20 am
ahenry3068 wrote: Sat Jan 04, 2025 5:56 pm (I'm almost making it but don't quite have the proper Audio parameters yet. It works fine on the Emulator in HOSTFS but i get Audio artifacts on hardware because of the FIFO running empty.
For audio I've been using 12970 Hz 16 bit mono. That puts 2594 bytes in the FIFO every 1/10 of a second. By the time the FIFO reaches 1024 bytes remaining there's just under 0.04 seconds of data remaining in the buffer, more than enough time to push another 2594 bytes (and the buffer won't overflow that way either).
Yah I could do that. But I've been using between 16440 and 20000 hz Audio. I've been doing some Music stuff and the difference between that 12 khz (ish) is audibly different for Music. I just got done last night converting my core player algorithm to pure assembly code. I had been using a Hybrid module that was partially compiled XC=BASIC with some inline assembly code.

The upshot of the full assembly rewrite. My 10 fps 8 bpp stuff (at 160 x 112) appears to be working on the first couple runs on my 2nd Fastest SD-Cards (PNY cards). Those cards were leading to click's and pops in the Audio with the hybrid module. I'm kind of anxious to see how much difference (if any) the UHS II cards I ordered might make, and if it's significant how far I can push things. (15 fps or even 12fps in 8 bpp would make a HUGE difference in how good the video looked)
Ed Minchau
Posts: 508
Joined: Sat Jul 11, 2020 3:30 pm

Re: Another Video Test

Post by Ed Minchau »

I'm thinking the maximum frequency for streaming audio from SD is probably 15360 Hz (Vera audio rate of $27 is close, its 15328 Hz). That way when the FIFO only has 1024 bytes remaining you'd load the next 3072 bytes in the buffer, neither overflowing nor underflowing.
User avatar
ahenry3068
Posts: 1181
Joined: Tue Apr 04, 2023 9:57 pm

Re: Another Video Test

Post by ahenry3068 »

Ed Minchau wrote: Sun Jan 05, 2025 9:45 pm I'm thinking the maximum frequency for streaming audio from SD is probably 15360 Hz (Vera audio rate of $27 is close, its 15328 Hz). That way when the FIFO only has 1024 bytes remaining you'd load the next 3072 bytes in the buffer, neither overflowing nor underflowing.
NOT TRUE: I'm using 16440 as my **minimum**. That's what I use for 8bpp 10 fps 160 x 112

FOR 192 x 128 6fps 8bpp I use 19730

FOR 160 x 112 4bpp I use 17925 1195 bytes of Audio per frame at 15 fps.

(These numbers were arrived at via Trial & Error for best results, don't try to make sense of them with any formula)

I was using 16022 for my old 1 bit mono videos but there I was trying to time Video and Audio seperately. (Video with the system Timer, Audio via VERA FIFO AFLOW). That approach **could** work out with a lot of tweaking for each individual video But switching to timing the Video off of AFLOW right along with the Audio worked out much better for A/V sync.

Desertfish was trying to do 27khz 16 bit for some gray scale videos with some success.
Attachments
BACOLOR2.zip
(12.17 MiB) Downloaded 2 times
BAHARDWARE.mp4.zip
(13.22 MiB) Downloaded 2 times
Last edited by ahenry3068 on Sun Jan 05, 2025 10:08 pm, edited 1 time in total.
User avatar
ahenry3068
Posts: 1181
Joined: Tue Apr 04, 2023 9:57 pm

Re: Another Video Test

Post by ahenry3068 »

Ed Minchau wrote: Sun Jan 05, 2025 9:45 pm I'm thinking the maximum frequency for streaming audio from SD is probably 15360 Hz (Vera audio rate of $27 is close, its 15328 Hz). That way when the FIFO only has 1024 bytes remaining you'd load the next 3072 bytes in the buffer, neither overflowing nor underflowing.
For streaming JUST AUDIO (without Video with it) I can do 44.1 khz 16 bit stereo since they introduced the Auto-tx feature to the Kernal.
Post Reply