AGAConv MorphOS
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    Hi everybody,

    I was very happy to see AGAConv for MorphOS on Aminet but I can't use it.

    When I tried to launch a simple conversion (ex: agaconv file.mp4 file.cdxl), it only said : "bin:bash: unknown command" (I have the same error when I launch "agaconv" alone).
    It seems to be a Python script, but I have an error if I launch it with "Python agaconv".

    And if I try with agaconv-converter, I had an error too.

    Is it a problem with my "installation" or the way I use it ?

    Hope someone here uses it and could help me ^^
    Proud user of MorphOS since 2003 !
  • »19.03.21 - 09:07
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 608 from 2010/2/10
    From: FRANCE
    Salut

    Essai de remplacer dans le script "agaconv" /bin/bash par sh ou /bin/sh
    ou utilises sh pour lancer le script....


    [ Edité par beworld 19.03.2021 - 10:50 ]

    [ Edité par beworld 19.03.2021 - 11:29 ]
    IMac G5 2.1,PowerBook G4 1.5,MacMini 1.5, PowerMac G5 2.7 died !!!
    My MOS ports
  • »19.03.21 - 09:48
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    Hi BeWordl,

    Thank you for your answer but when I replace "/bin/bash" by "/bin/sh" or "sh", I got an error :
    agaconv[149]: syntax error: `((' unexpected

    Or with only "sh" -> agaconv[149]: syntax error: `(' unexpected (I got the same error if I launch it with sh).

    I tried to send an email to Polluks, but my mail never comes to him.

    Maybe someone uses it and succesfully converts video to CDXL ;) I want to make some CDXL videos for my CD32 and my Amiga 1000 ^^

    Thx
    Proud user of MorphOS since 2003 !
  • »21.03.21 - 20:16
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    Indeed, SDK's shell does not understand this kind of "for" command.
    As a work-a-round you may use agaconv-encode without the wrapper script...
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »22.03.21 - 11:27
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    Hi Polluks,

    Thank for your answer.

    I tried to use encoder directly but it seems it doesn't like me to put "--in=file.mp4", asking for in file anyway...

    If it's possible, can you give me a step by step protocol ?
    I tried to RTFM but I didn't find mention about MorphOS and I can't find examples anywhere.

    Thx
    Proud user of MorphOS since 2003 !
  • »22.03.21 - 18:48
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    For you information
    The script needs ffmpeg to create single images
    https://www.morphos-storage.net/?id=1533165
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »23.03.21 - 06:50
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    ffmpeg is already installed and in my path but it doesn't work.

    If I wrote "agaconv-encode A3000.mp4 --out=text.cdxl", nothing happens.
    If I wrote "agaconv-encode A3000.mp4 --out=text.cdxl", it says : "Error: expected file name, option --in=A3000.mp4 provided."

    Do I need to create single images first ?

    [scratching head] After looking deep in the script, it seems so.[/scratching]

    If I can do something, I'll post an how-to here.
    Proud user of MorphOS since 2003 !
  • »23.03.21 - 19:33
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    OK, multiple success tonight ;)

    Extracting images : OK
    Extracting audio : OK (it seems ^^)
    Converting in CDXL : failed...

    In fact, I can't find how to put all images in the command. If I use a joker, AGAConv-encode says "too many file names on command line" (for agaconv-encode, image0001.png is the infile and image0002.png is the outfile...).

    I copy paste my command lines here.
    They need to be improved for sure... and I'm not sure AGAConv can use this image format...

    Extracting images from .mp4 :
    ffmpeg -i test.mp4 -y -r 15 -s 320x200 -pix_fmt rgb24 test/test%04d.png
    (-r 15 : 15 FPS ; -pix_fmt rgb24 : 8 bit without alpha)
    Tried to follow the command in the script but there are a lot of variables and some ffmpeg MorphOS doesn't know some commands...

    Extracting audio from .mp4 :
    ffmpeg -i test.mp4 -ar 28000 -f u8 -acodec pcm_u8 -ac 1 test/test.raw
    (-ar 28000 : 28Khz ; -ac 1 : mono)
    I have a raw file but I can't listen it... so, not sure it's correct

    Converting in CDXL :
    agaconv-encode --cdxl-encode --fps 15 --pcm-file test/test.raw --gfx-mode lores --cdxl-24bit-colors --frequency 28000 --cdxl-padding-size 4 test/test0001.png test.cdxl --status
    (all options from the script)
    Here, the problem is the "infile". With test/test0001.png, it only takes test0001.png and makes the error described above.
    I tried test/test*.png or test/test#?.png, it says "too many files".
    And I tried just test/, it says "std::exception".

    No more for me tonight ;)
    Proud user of MorphOS since 2003 !
  • »23.03.21 - 21:02
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    @BatteMan
    Thanks for your testing! Here comes a patch for our shell
    Code:
    --- agaconv	2020-05-11 05:05:26 +0200
    +++ dh0:agaconv 2021-03-23 02:24:04 +0100
    @@ -1,4 +1,4 @@
    -#!/bin/bash
    +#!/bin/sh

    ##########################################################################
    # AGAConv - CDXL video converter for Commodore-Amiga computers #
    @@ -146,8 +146,10 @@
    function log2 {
    local val=$1
    local x=0
    - for (( y=$val-1 ; $y > 0; y >>= 1 )) ; do
    + local y=$val
    + while [ $y -gt 1 ] ; do
    let x=$x+1
    + let y/=2
    done
    echo $x
    }
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »24.03.21 - 10:28
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    Thx Polluks, but how can I use it ? ;)

    Do I need to put it in the AGAConv script to replace something ?
    Or it's another script ?

    Thx again.
    Proud user of MorphOS since 2003 !
  • »24.03.21 - 14:47
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    This is a standard diff:
    "-" remove line
    "+" add line

    However I want to upload a new version...
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »25.03.21 - 07:13
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    Thx ! I'll try ;)

    PS : Sorry, I not "aware" of this method (but now, I know ^^ ).
    Proud user of MorphOS since 2003 !
  • »25.03.21 - 11:26
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    Hehe ! I applied the diff with patch command (in GG:bin/) and agaconv almost works now, almost ! ^^

    This is my error message :
    > agaconv --in=A3000.mp4 --out=test.cdxl
    agaconv[430]: [: missing ]
    agaconv[430]: ]: not found
    agaconv[769]: syntax error: `$hamMode=="yes"' missing expression operator

    I looked lines 430 and 769 but not sure what to do.
    Proud user of MorphOS since 2003 !
  • »25.03.21 - 19:31
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    I tried again, with help of Movec on EAB too for using agaconv-encode without the script, but it doesn't work for me...

    Sorry to be like Jim Carrey in Dumb & Dumber ^^

    It seems that ffmpeg MorphOS doesn't recognize -hide_banner and -filter_complex commands.
    Proud user of MorphOS since 2003 !
  • »30.03.21 - 09:49
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    Indeed, Fab's version is from 2009 :-(
    see also here
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »30.03.21 - 14:30
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    Polluks : And you, how do you proceed ?

    Do you have a new version of ffmpeg ? Or did you "just" make the MorphOS port of agaconv without using it ?
    Proud user of MorphOS since 2003 !
  • »30.03.21 - 14:40
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    The latter :-( however I'll try to improve it...
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »03.04.21 - 20:54
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    BeWorld puts his hands in ffmpeg and seems to progress quickly ! We'll have a new version of ffmpeg soon (and maybe ffplay for streaming) ^^

    I'll try his new version of ffmpeg asap ;)
    Proud user of MorphOS since 2003 !
  • »03.04.21 - 21:39
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    Polluks : Tried your last version of agaconv and got those errors :

    Work:Utils/agaconv/bin> agaconv A3000.mp4 text.cdxl
    agaconv[969]: syntax error: `$hamMode=="yes"' missing expression operator

    Work:Utils/agaconv/bin> agaconv A3000.mp4 text.cdxl --color-mode=aga8
    agaconv[901]: 2**8: unexpected `*'

    Work:Utils/agaconv/bin> agaconv A3000.mp4 text.cdxl --color-mode=aga3
    agaconv[901]: 2**3: unexpected `*'
    Proud user of MorphOS since 2003 !
  • »04.04.21 - 21:23
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    Code:
    --- agaconv.bak	2021-04-03 22:28:32 +0200
    +++ agaconv 2021-04-05 20:46:07 +0200
    @@ -885,11 +885,11 @@
    ;;
    aga8|aga7|aga6|aga5|aga4|aga3)
    planes=$(expr substr $colorMode 4 1)
    - maxColors=$((2**$planes)) # number of planes to the power of 2
    + maxColors=$((1<<$planes)) # number of planes to the power of 2
    ;;
    ocs5|ocs4|ocs3)
    planes=$(expr substr $colorMode 4 1)
    - maxColors=$((2**$planes)) # number of planes to the power of 2
    + maxColors=$((1<<$planes)) # number of planes to the power of 2
    agaconvEncodeColorOption="--color-bits 12"
    ;;
    normal)
    @@ -966,14 +966,14 @@

    case $hcQuant in
    wu)
    - if [[ $hamMode=="yes" ]]; then
    + if [[ $hamMode == "yes" ]]; then
    hcQuantOption=quant_wu
    else
    hcQuantOption=
    fi
    ;;
    neuquant)
    - if [[ $hamMode=="yes" ]]; then
    + if [[ $hamMode == "yes" ]]; then
    # for HAM neu_quant is default (and not specified on command line)
    hcQuantOption=
    else


    [ Editiert durch polluks 05.04.2021 - 20:47 ]
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »05.04.21 - 18:40
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    Oh yeah ! It's working !
    BeWorld made port of the last version of ffmpeg (still beta but seems working) and with your last agaconv, I just create a cdxl with my "demo.mp4" file.

    I dont' use the script but command lines from movec

    Now, I'll watch these cdxl file on my CD32 ;)

    Thx everybody !
    Proud user of MorphOS since 2003 !
  • »05.04.21 - 19:19
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 803 from 2007/10/23
    From: Gelsenkirchen,...
    :-) :-)
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »05.04.21 - 19:46
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    beworld
    Posts: 608 from 2010/2/10
    From: FRANCE
    ffmpeg 4.3.2.... so working :-)
    here list of options :
    - Support network with openssl
    - libmodplug
    - libopus
    - libmp3lame
    - libvorbis
    - libtheora
    - libwebp
    - libfreetype
    - zlib shared
    - png shared
    - bzlib
    - lzma shared

    My only limit is ALTIVEC support... when i compiled with it, result is sound/video crappy.
    I will create github, if any interest, someone can check.

    For ffplay, all working with SDL2 but only in software rending.. so is slow.
    IMac G5 2.1,PowerBook G4 1.5,MacMini 1.5, PowerMac G5 2.7 died !!!
    My MOS ports
  • »05.04.21 - 20:17
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    BatteMan
    Posts: 285 from 2003/2/24
    From: France
    Example of a little TikTok video in CDXL format (I convert it 'cause a friend of mine didn't succeed to respect the ratio when he tried with his PC ^^) :

    TikTok-160x180.cdxl
    Proud user of MorphOS since 2003 !
  • »06.04.21 - 23:03
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3108 from 2003/3/5
    From: Canada
    I'm also taking a look at ffplay, since I'm maintaining a port of ffmpeg for Wayfarer anyway...

  • »20.05.21 - 02:17
    Profile Visit Website