Image and video viewers

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Post Reply
marss
Atari Super Hero
Atari Super Hero
Posts: 565
Joined: Thu Nov 07, 2002 12:29 pm

Re: Image and video viewers

Post by marss »

Thanks for the tip. I will try 144p video with no sound.
ldv-01
Captain Atari
Captain Atari
Posts: 151
Joined: Wed Jun 01, 2011 10:14 pm

Re: Image and video viewers

Post by ldv-01 »

Hi.
Tested latest v0.31 on the FB. Doesn't crash, and the replay window is opened. Unfortunately only the first second of the audio mp4 is played in loop (tested ATM only the mp4 you linked a few posts above).
medmed wrote: Wed Nov 01, 2023 10:11 am
ldv-01 wrote: Wed Nov 01, 2023 9:19 am Tested v 0.2. Started as TTP, as a filename is requested as argument. Infortunately it crashed with a bus error after reporting on console mp4 file details (tracks, sampling freq.). I'll try latest v0.31
medmed wrote: Sun Oct 29, 2023 8:46 pm Hi,

But I haven't found FPU bench for Firebee.

So I wonder if someone with a Firebee could test an mp4 sample with the latest version and tell me if he can play mp4 sound on this machine?

Many thanks.
Thanks,

Yes v0.2 instantiate c++ class objects with c style (malloc), then it crashes. v0.3.1 should resolve the issue.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

ldv-01 wrote: Wed Nov 01, 2023 1:56 pm Hi.
Tested latest v0.31 on the FB. Doesn't crash, and the replay window is opened. Unfortunately only the first second of the audio mp4 is played in loop (tested ATM only the mp4 you linked a few posts above).
medmed wrote: Wed Nov 01, 2023 10:11 am
ldv-01 wrote: Wed Nov 01, 2023 9:19 am Tested v 0.2. Started as TTP, as a filename is requested as argument. Infortunately it crashed with a bus error after reporting on console mp4 file details (tracks, sampling freq.). I'll try latest v0.31

Thanks,

Yes v0.2 instantiate c++ class objects with c style (malloc), then it crashes. v0.3.1 should resolve the issue.
Many thanks,

So the load of the realtime resampler is too heavy.
Could you test this sound file? As It doesn't need to be realtime resampled.

Also can the firebee play classic PC samplerate like 44,1khz or 48khz?
If yes does someone know how to init this with xbios sound functions? i.e. ask for 44,1 khz for example?
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

Hi,

Just signaling mm_pic m68000 binary is available (very slow).

Regards,
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

Hi,

I've implemented FFMPEG to mm_pic so depending the video format and your cpu you should be able to play many videos on your machine.

Just open the file (or drag & drop), then right click to get the play button and click on it.
I've tested it on Aranym JIT & Hatari Falcon 030.
Consider using >=16bpp.
Better performances will be obtained with 32bpp.

Also notice that the console output may be sometime verbose.

Sound isn't implemented yet: It will consume a lot of cpu time to dynamically rescale the sound samples.
I guess I'll made it optional via a form when opening a video.
There're two possibilities for the future:
- Use zitaresample library in order to dynamically rescale the sound frequency
- Use pre existing frequencies available on Atari platforms: then the video will be faster/slower depending the selected frequency

But for now you can grab the 020+/CF binaries here.
The list of file extensions redirected to the player is available in this array.

Playing mpeg1/2 on 030+ should be ok.
Playing low res AVI file on 060+ should also be ok.
Aranym JITx86 should play all compressed formats.
For the others you'll have to discover it, let me know :).

Enjoy!

Image
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

Hi,

I've updated mmpic to v0.9.

Among many fixes I've implemented a libav sound player (all ffmpeg sound format should play).

The sound is directly resampled for our frequencies so it consumes cpu's time.

Tests on Aranym + MMU passed.

I'm asking if someone with a Firebee + GSXB could test the sound player?

I've implemented GSXB cookie detection and if it's present I select clock_ext & play at common frequencies.

Many thanks in advance.

Note: I've got wrong CRC header for all my OGG files - It may be related to libogg and endianess? I guess I'll have to test with libogg alone to figure out why OGG keyword isn't find in the OGG headers :)
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
marss
Atari Super Hero
Atari Super Hero
Posts: 565
Joined: Thu Nov 07, 2002 12:29 pm

Re: Image and video viewers

Post by marss »

Excellent!!!
Thanks ;)
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3329
Joined: Sun Aug 03, 2014 5:54 pm

Re: Image and video viewers

Post by ThorstenOtto »

I dont know if it checks the CRC, but the playwave utility from SDL can play ogg files without problems.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

ThorstenOtto wrote: Sat May 11, 2024 1:17 pm I dont know if it checks the CRC, but the playwave utility from SDL can play ogg files without problems.
It comes from one my libs - I've tried with yours and ogg file are ok -
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

I've re-uploaded mmpic for 020 & CF with OGG support ok :)

hoping you will enjoy it :)

EDIT: I've reuploaded again 020/CF archive. It seems gcc 9.5 build on Mac M1 produced a bus error with MMU. Same code, same libs, gcc 9.1 build with Mac x64 is ok.
I'm really disappointed by some behaviors...
You do not have the required permissions to view the files attached to this post.
Last edited by medmed on Sun May 12, 2024 1:55 am, edited 1 time in total.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

ThorstenOtto wrote: Sat May 11, 2024 1:17 pm I dont know if it checks the CRC, but the playwave utility from SDL can play ogg files without problems.
You need to apply some fixes on your ffmpeg library: You need to disable fatal assertion on memory alignment.
The consequence is that the video becomes unreadable (because there is no longer any yuv to RGB, see attached error screenshot).
Find my attached patch.

EDIT: I'm not sure at all about disable memalign & disable posix_memalign but as these functions aren't well implemented in mintlib I guess they shouldn't be used.

I've re uploaded mmpic v0.9 again. It should be ok for both video & audio. Sorry for the inconvenience guys.
I've tested mpeg / mov / avi / mp4 /dv / ogm / webm video formats.
For audio I've tested aac / wma / ogg /au / mp3 / flac / wav formats.
As there's many formats supported by the lib I can't test all of them but let me know.

I've noticed random crashes sometimes with MMU enabled. I think it's due to the lib, I've rechecked my code so many times.

Next step will be to synchronize audio & video...

Code: Select all

v0.9

New :

- Added internal sound API
- Implemented sound player using LibAV
- Refactoring LibAV video implementation
- Event timer logic for "while" threaded loop refactored for a better thread management

Misc :

- Added Wav Read functions (for testing purpose)

Fix :

- Potential memory leaks
- TTF Font rendering in 16bpp
- Align video buffer depending on the screen format

ToDo:

- Seeking frame to the beginning at start / loop reading / move back and forward
- A/V Sync player
Regards
You do not have the required permissions to view the files attached to this post.
Last edited by medmed on Sun May 12, 2024 2:34 pm, edited 1 time in total.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3329
Joined: Sun Aug 03, 2014 5:54 pm

Re: Image and video viewers

Post by ThorstenOtto »

medmed wrote: Sat May 11, 2024 11:55 pm EDIT: I'm not sure at all about disable memalign & disable posix_memalign but as these functions aren't well implemented in mintlib I guess they shouldn't be used.
Why do you think they are not well implemented in mint?
You need to apply some fixes on your ffmpeg library: You need to disable fatal assertion on memory alignment.
Your patch disables *all* fatal assertions. That seems a bad idea to me, usually there are reasons to have them in place.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

ThorstenOtto wrote: Sun May 12, 2024 4:10 am Why do you think they are not well implemented in mint?
As seen with libpsd_sdk before: free isn't reliable.
Your patch disables *all* fatal assertions. That seems a bad idea to me, usually there are reasons to have them in place.
Yes because the code checks time to time for memory alignment.
Whatever I played video and audio without this assert() who is too radical I think. May be it could stay only verbose.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3329
Joined: Sun Aug 03, 2014 5:54 pm

Re: Image and video viewers

Post by ThorstenOtto »

Well the assertion you encountered is indeed wrong for __MINT__ because the calculation there assumes that the variables in struct SwsContext are aligned(8), which was disabled for __MINT__, and therefor the structure layout is different. Fixed now, but i left the other assertions in place.

BTW, some weeks ago ffmpeg 7.0 was released, but according to the news, the API slightly changed, so i don't know if that is usable.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

ThorstenOtto wrote: Sun May 12, 2024 7:58 am Well the assertion you encountered is indeed wrong for __MINT__ because the calculation there assumes that the variables in struct SwsContext are aligned(8), which was disabled for __MINT__, and therefor the structure layout is different. Fixed now, but i left the other assertions in place.

BTW, some weeks ago ffmpeg 7.0 was released, but according to the news, the API slightly changed, so i don't know if that is usable.
Many thanks Thorsten. I’ll test it asap hoping there will be no more avlog panic for align and let you know.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

ThorstenOtto wrote: Sun May 12, 2024 7:58 am BTW, some weeks ago ffmpeg 7.0 was released, but according to the news, the API slightly changed, so i don't know if that is usable.
Haha, My code for libav 6.x is not yet finished and you already want me to change it...

I haven't yet seen the changes made to the API but in reality the more the less.

The best feature after a quick read of the changelog is
- DVD-Video demuxer, powered by libdvdnav and libdvdread

The problem is that we cannot mount an ISO file. I tried to port isoinfo (https://github.com/cmatsuoka/isoinfo) but stopped because of the lack of nmap on mint.
I don't even know if you can use a DVD on freemint? And would libdvdnav and libdvdread be easily portable?
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3329
Joined: Sun Aug 03, 2014 5:54 pm

Re: Image and video viewers

Post by ThorstenOtto »

AFAIK you can use a DVD on freemint, but that requires metados or hddriver, so i don't think that libdvdread will be easy to port. But i cannot tell, the DVD drive in my PC was broken, and i never bothered to replace it.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

ThorstenOtto wrote: Sun May 12, 2024 7:58 am Well the assertion you encountered is indeed wrong for __MINT__ because the calculation there assumes that the variables in struct SwsContext are aligned(8), which was disabled for __MINT__, and therefor the structure layout is different. Fixed now, but i left the other assertions in place.

BTW, some weeks ago ffmpeg 7.0 was released, but according to the news, the API slightly changed, so i don't know if that is usable.
Unfortunately It's still nok with both 6.0 & 7.0, audio & video - May be still the panic log thing?
See screenshots with older & newer build.
You do not have the required permissions to view the files attached to this post.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3329
Joined: Sun Aug 03, 2014 5:54 pm

Re: Image and video viewers

Post by ThorstenOtto »

Does the program abort? The error messages don't look like being from the assertion macros.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

ThorstenOtto wrote: Sun May 12, 2024 2:39 pm Does the program abort? The error messages don't look like being from the assertion macros.
Yes it aborts after these messages. I've never had these errors with former ffmpeg release.

I can quickly prepare debug source code without pdf/psd support (psd_sdk & my xpdf lib) if you want to try.

EDIT: I've added defines flags for PDF & PSD support in the 020 makefile, it should be easy to build it without the needs of -lxpdf and -lpsd_sdk by just setting WITH_PSD and WITH_XPDF variables.

EDIT2: There's also av_log_set_level(AV_LOG_QUIET); to comment
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

Hi,

I released v0.9.1.

There're now binaries with "images support only" named as "classic".
Audio & Video support is still available with 0.9 version.

v0.9.1. support now all these images formats.

For remind MM_PIC allows you to export many formats to pi1 in the standard STE palette (with an acceptable quality) and to mfd (raw data from fd_addr, mainly used by xaaes).

Regards,
You do not have the required permissions to view the files attached to this post.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
marss
Atari Super Hero
Atari Super Hero
Posts: 565
Joined: Thu Nov 07, 2002 12:29 pm

Re: Image and video viewers

Post by marss »

Great 👍
medmed
Atari Super Hero
Atari Super Hero
Posts: 983
Joined: Sat Apr 02, 2011 5:06 am
Location: France, Paris

Re: Image and video viewers

Post by medmed »

Hi,

I've updated mm_pic with some new features.

mm_pic_020_CF_v0.9.2

New:

- PNG Icons are now cached (if in planar screen configuration)
- Xbrz scaling
- Progress bars are now rendred in windows
- Better dithering for 4bpp redering & export
- Fix colors for planar 8bpp
- Testing sound circular buffer with wav files (default to 8 buffers)
- 44.1khz & 48khz frequencies available on v4sa
You do not have the required permissions to view the files attached to this post.
M.Medour - 1040STF, Mega STE + Spektrum card, Milan 040 + S3Video + ES1371.
marss
Atari Super Hero
Atari Super Hero
Posts: 565
Joined: Thu Nov 07, 2002 12:29 pm

Re: Image and video viewers

Post by marss »

Thanks!!!
Post Reply

Return to “C / PASCAL etc.”