Welcome, Guest. Please login or register.

Author Topic: Partly solved: Input video format for Convert2CDXL  (Read 1743 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline AndyFCTopic starter

Partly solved: Input video format for Convert2CDXL
« on: July 23, 2019, 07:20:15 AM »
I started to play with Convert2CDXL last night using WinUAE because of disk space and the need for an '040 or '060 CPU in the latest version.

I get a playable CDXL at the end of it, but it's not watchable; the file is about 3 times the length, so plays back slowly. The colours are also very muddy. I've played the CDXL video in WinVLC too and get the same result, so it's not the Amiga video player.

I've looked at the frames, and listened to the sound files being created part-way through the process and they look and sound fine.

I suspect the input source video is too high quality/framerate so what are the best input format and specs to use please?

Thank you.
« Last Edit: July 26, 2019, 08:23:51 PM by AndyFC »
A1200 in DIY Tower. 3.2 ROMs (softkicking 3.2.2), OS 3.2.2 with ClassicWB, CF card, CD RW and IDE to SD adapter running off the internal IDE port (using the A4000 4-port IDE adapter from Amigakit), Pistorm 32 lite with Pi4/2GB/Emu68 or Blizzard 1230-IV, with 32MB 60ns RAM and 50MHz 68882 FPU. 3COM PCMCIA Network card running with Miami DX.
MorphOS on PowerMac G5 and ATI 9600 pro
 

Offline AndyFCTopic starter

Re: Input video format for Convert2CDXL
« Reply #1 on: July 26, 2019, 08:23:19 PM »
I've been playing with the convert2cdxl script, and actually have started an English translation which is helping me to understand the conversion process.

FFMpeg can handle most video formats thrown at it (my test file is now an MP4 480p video) but it turns out that XLMake can only produce a video that is 12FPS, so as long as the input video is 12FPS, that solves some of the problems.

If I make a HAM6 video at 224 x 126, the playback using XLPlay is perfect; the right speed, colours etc. If I use the same input video and make it a higher resolution eg 320 x 200, the playback slows right down to a couple of frames per second.

I've tried this in WinUAE and on my real A1200 with the same results. I've tried a few different XL players but XLPlay is the only one which runs at all or plays back the video without distortion (Multiview makes it sound like a dial-up modem). I've tried playing the video from SD Card, HD and from RAM with the same results.

Any suggestions of how I can get a higher res output which will play back at a decent speed please?

Thanks.
« Last Edit: July 26, 2019, 08:25:32 PM by AndyFC »
A1200 in DIY Tower. 3.2 ROMs (softkicking 3.2.2), OS 3.2.2 with ClassicWB, CF card, CD RW and IDE to SD adapter running off the internal IDE port (using the A4000 4-port IDE adapter from Amigakit), Pistorm 32 lite with Pi4/2GB/Emu68 or Blizzard 1230-IV, with 32MB 60ns RAM and 50MHz 68882 FPU. 3COM PCMCIA Network card running with Miami DX.
MorphOS on PowerMac G5 and ATI 9600 pro
 

Offline TribbleSmasher

Re: Partly solved: Input video format for Convert2CDXL
« Reply #2 on: July 26, 2019, 11:24:49 PM »
I think the limit is set by the bandwidth. If you want to fit the video into single/double speed CDROM transfer (CDXL was designed for), you have to make some adjustments. XLplay probably is scaling the input down to meet the limits.
 

Offline TribbleSmasher

Re: Partly solved: Input video format for Convert2CDXL
« Reply #3 on: July 27, 2019, 03:33:24 PM »
Another idea:
the framerate for video and the playback speed of the audio is somewhat interlocked, so you must precalculate the exact values.

Try this (via deep translate).
http://cd32-allianz.de/cdxl/erstellen?
Please note the part with the wrong audio rate calculation.
Quote

How to create a movie in CDXL format

a short introduction

CDXL is the name of a format used to merge images and sound into one file and then play it back as a movie on a computer, just like MPG, AVI, QT etc. do. However, CDXL was created at a time when watching movies on one's own computer was still unthinkable, and as is so often the case, another achievement sank into oblivion because it was far too far ahead of its time and hardly found users for it. But thanks to the now cheap mass storage, the simple possibilities to create and copy even large amounts of data quickly, and of course also thanks to such ideas as running your Amiga in your car :o) CDXL has become interesting again today, because it allows us to play movies even on a "stone old" Amiga.


So how do I convert my MPG into CDXL format?

First you should download and install the following:
the CDXL-Toolkit
Directory OPUS 4
MultiRen
mpega
MPG splitter
NetPBM
Play16
ripley
a film in MPG format
GoldEd 5 (if it becomes necessary to reduce the number of frames per second)

I strongly recommend using a PPC turbo card and the corresponding versions of Ripley, Mpega and the NetPbm package. Without these, the conversion can "drag on a bit"...

the DOpus-Config

Split MPG video into audio and video tracks with "splitter":
c:splitter {f} audio burn:mptemp/sound.mp2 video burn:mptemp/video.mpg

Convert sound from MP2 to 8svx with "Mpega" and "Play16":
c:mpega -s -d 2 -A -m -T -o -u burn:mptemp/Ton.mp2 burn:mptemp/Ton.aiff
c:play16 burn:mptemp/Ton.aiff out 8svx
c:Delete burn:mptemp/Ton.aiff
c:Delete burn:mptemp/Ton.mp2

And split the resulting MPG video file into single frames with "Ripley":
c:ripley.elf burning:mptemp/Video.mpg save burning:mptemp/ppm/p.%05d
c:Delete burn:mptemp/Video.mpg

So far for the simple part, from now on manual work is required.
So change to the directory with the pictures, select all files. You have to convert the single images in PPM format to Ilbm with the Netpbm tools: DH1:Prog/picconvert-pbm/bin/ppmtoilbm -ecs -ham6 -fs {fu} >Brenn:mptemp/iff/{o} (for Amigas with AGA you can also use -aga -ham8 to get better images, but you'll need a lot more processing power to play them back later.)

Since the files still have names of the form p.00001.ppm, you have to rename them to p.00001 etc. using MultiRen: So read in the directory of the Ilbm files via "Add

MultiRen Main Window

Use the extension editor to remove the extension .ppm: (ppm may not yet be in the list, so first enter it, then select it and click on "Remove")

MultiRen Extension Editor

Another click on "Rename" in MultiRen and the new file names are ready.

To create the CDXL you have to calculate the audio bytes per image: File size of the 8svx sound file in bytes divided by the number of frames. (The XLToolkit calculates completely wrong values here, so don't use it!)

Calculator

Now Shell or CLI are required to create the CDXL. The just calculated audio bytes/image are entered after -a, in my example 1767 bytes/image
c:XLMAKE -a1767 -bBurn:mptemp/iff/p.00001 -h burn:film.cdxl

Only the file with the sound that has to be inserted into the CDXL is missing:
c:XLAUDIO -a1767 -i Burn:mptemp/Ton.iff burn:film.cdxl

We did it! Congratulations on creating a CDXL movie.

Now you can play it with the help of "cdgsxl", where you specify with the 310 behind xlspeed how many kByte per second the movie should be played, so the number has to be determined for each movie by trying it out:
cdgsxl burning:film.cdxl multipal xlspeed 310 nopointer dosxl lmbabort ham


But if the film doesn't run smoothly...

...then you should be the first to make sure that the conditions are optimal: Do not use FFS! FFS is up to 5 times slower than file systems like PFS3 or SFS! About the filesystem of your hard disk: Compared to PFS3, SFS has the advantage of not breaking into directories with more than 10,000 files. However, the PFS3 is clearly ahead when it comes to stability and playback, since it requires considerably less CPU power and can already be used with a 68000 CPU, i.e. without a turbo card.
Furthermore, the partition with the CDXL should not be too fragmented. It's better not to play CD-Roms on the PCMCIA port or similar crutches.

Likewise we stand before the decision: How high should the quality be? Everyone has to find out for himself how fast his Amiga can still play the CDXLs without jerking. This is true:
For example, the resolution should not exceed Pal LoRes 362 x 283. If the images are larger, e.g. because they come from an SVCD, it is better to calculate them down:

pnmscale: half size
DH1:Prog/Ultraconv/picconvert-pbm/bin/pnmscale -xscale 0.5 -yscale 0.5 <{fu} >brenn:mptemp/ppmkleiner/{o}
or
pnmscale: 80%, then convert to Ilbm
DH1:Prog/Ultraconv/picconvert-pbm/bin/pnmscale -xscale 0.8 -yscale 0.8 <{fu} >ram:ppm
DH1:Prog/Ultraconv/picconvert-pbm/bin/ppmtoilbm -ecs -ham6 -fs ram:ppm >Burn:mptemp/iff/{o}

But under approx. 250 x 220 I would not go, one wants to be able to recognize finally also still something! So we simply reduce the number of frames/s to 17, 15... It is best to do this before you have the single images converted, because you can also save a lot of time.
I recommend a DOpus menu entry in the direction:
ppm's to the list for fps-number
echo DH1:Prog/Ultraconv/picconvert-pbm/bin/ppmtoilbm -ecs -ham6 -fs {fu} ">Burn:mptemp/iff/{o}" >>burn:mptemp/PPM list

Then select all .ppm's and select this menu item. The resulting list will look like this:
dh1:Prog/Ultraconv/picconvert-pbm/bin/ppmtoilbm -ecs -ham6 -fs Brenn:mptemp/ppm/p.00000.ppm >Brenn:mptemp/iff/p.00000.ppm
dh1:Prog/Ultraconv/picconvert-pbm/bin/ppmtoilbm -ecs -ham6 -fs Firing:mptemp/ppm/p.00001.ppm >Firing:mptemp/iff/p.00001.ppm
dh1:Prog/Ultraconv/picconvert-pbm/bin/ppmtoilbm -ecs -ham6 -fs Firing:mptemp/ppm/p.00002.ppm >Firing:mptemp/iff/p.00002.ppm
...

We load them into GoldEd and start its macro function (Shift-F10). Now press the down arrow key and press Shift + Del to delete the contents of the 2nd line. Press Del again to remove the whole line. With Shift-F10 switch off the macro function again, and if you now press F10 again every 2nd line should be deleted. Simply select "Repeat Sequence" in the menu and let it run 5000 times for e.g. 10000 files. Save the shortened list and start the file via "execute" from the shell. (Since I've become much too lazy to do this, I have a ready list for 50,000 files on disk, which I simply execute every time I need to.) In this example you converted only every 2nd image, so you will get 12 images/s later. If you only delete every 3rd line there will be 17 images/s, or every 2nd and the 5th, etc. ...

After the conversion is finished start your MultiRen, load the directory as described above and start from the "Tools" the point "Sort":

MultiRenSort

Click on "Old name" here to sort the list first.

Now use the extension editor as described above to remove the extension .ppm, and then use the tool "File Cleaner" to remove all old numbers and points:

MultiRenClean

If everything worked out, it should just have "p"'s in the list. If you don't just switch the corresponding point again, e.g. "Points" to "Nothing" and again to "Remove", after a second "Clean up" it should fit. Now take the "Numberer" under "Tools":

MultiRenNumberer

and adds a new series of numbers to the file names. Another click on "Rename" in MultiRen, and the new file names of the kind "p.0001" are ready, with which "XlMake" can do something again. Calculate the new number of audio bytes, create the movie, insert the sound, done.

A few names of movies I already converted for my car: Forklift driver Klaus, several Road Runner & Coyote animated movies, Dream Catcher, Ice Age gone Nutty, Lava-Lava, and many more.

I thank them for their attention and wish them a lot of fun with their classic Amiga, extended by a video function.
Andreas Balke
and his Amiga 600 as MP3 player and route planner in the car


Translated with www.DeepL.com/Translator
« Last Edit: July 27, 2019, 03:35:47 PM by TribbleSmasher »
 

Offline AndyFCTopic starter

Re: Partly solved: Input video format for Convert2CDXL
« Reply #4 on: July 27, 2019, 06:37:14 PM »
Thanks Tribblesmasher.

I've also found this http://www.cd32-allianz.de/cdxl/v1? and have realised that the Convert2CDXL script uses a higher audio data rate with larger frames, so I'm playing with the values in the script.

This is a great learning experience and I'm aiming to get a full understanding of making an optimal CDXL video for different circumstances.

XLToolkitGUI I think I've found the theoretical data limit for CDXL and it's now the audio format which I need to work on to optimise.
A1200 in DIY Tower. 3.2 ROMs (softkicking 3.2.2), OS 3.2.2 with ClassicWB, CF card, CD RW and IDE to SD adapter running off the internal IDE port (using the A4000 4-port IDE adapter from Amigakit), Pistorm 32 lite with Pi4/2GB/Emu68 or Blizzard 1230-IV, with 32MB 60ns RAM and 50MHz 68882 FPU. 3COM PCMCIA Network card running with Miami DX.
MorphOS on PowerMac G5 and ATI 9600 pro
 

Offline AndyFCTopic starter

Re: Partly solved: Input video format for Convert2CDXL
« Reply #5 on: July 28, 2019, 09:05:58 PM »
I've been testing the 'Player' script included with Convert2CDXL today and found a happy balance.

If I convert to HAM6, 320 x 200 and set the player value in the script to 350kbp/s I get full screen width, and correct aspect ratio at about the right speed.

Anything which is converted to Ham8 gives a load of artefacts.

I'll continue to work on the English Translation now that I've found a quality which works for me.
A1200 in DIY Tower. 3.2 ROMs (softkicking 3.2.2), OS 3.2.2 with ClassicWB, CF card, CD RW and IDE to SD adapter running off the internal IDE port (using the A4000 4-port IDE adapter from Amigakit), Pistorm 32 lite with Pi4/2GB/Emu68 or Blizzard 1230-IV, with 32MB 60ns RAM and 50MHz 68882 FPU. 3COM PCMCIA Network card running with Miami DX.
MorphOS on PowerMac G5 and ATI 9600 pro