Author Topic: CE2mp3  (Read 38823 times)

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
CE2mp3
« on: 2009.06.12, 11:05:45 »
Something happen with old thread so here is end.  >:(

1.
start CE2mp3 with source file for converting as argument, like
CE2mp3 d:\path\nice song.wma
CE2mp3 will first prompt for samplerate, bitrate and stream remap (important when
source file have more than one audio stream), You can enter values, or simply
press ENTER without any other input for using default values.
2.
start CE2mp3 with directory with source files as argument, like
CE2mp3 d:\path
CE2mp3 will go for converting all files from this directory, without any prompt.
Default values will be used.

In both cases, CE2mp3 will create target files with same name as source files
except for extension in directory where is started.


Code: [Select]
/*  Convert everything to MP3 by Cyber v0.03  */
/*        using FFmpeg as convertor  */
/*     You need to change default values !!!!   */

/* Default values :  */
SAMPLERATE=44100                      /* CHANGE AS NEEDED */
BITRATE=64                            /* CHANGE AS NEEDED */
FFmpeg_pth="ffmpeg.exe" /* CHANGE AS NEEDED */
/*
 path where is FFmpeg: if ffmpeg is in PATH or in same direcory with this
 convertor use FFmpeg_pth="ffmpeg.exe" else, You need to enter full path
 to program.
*/

/* end of configuration !!!!   */
call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
call SysLoadFuncs
Say ""
CALL WhiteCol; CALL CHAROUT , "  ŰŰŰ  ŰŰŰ   Ű  Ű  Ű   Ű ŰŰŰŰ ŰŰŰ  ŰŰŰ          everything to mp3";
say
CALL WhiteCol; CALL CHAROUT , " Ű    Ű   Ű  ŰŰ Ű  Ű   Ű Ű    Ű  Ű  Ű"
call LblueCol; CALL CHAROUT , "  for www.os2world.com ";CALL GreenCol; CALL CHAROUT , "written by Cyber ";
say
CALL WhiteCol; CALL CHAROUT , " Ű    Ű   Ű  Ű ŰŰ  Ű   Ű ŰŰ   ŰŰŰ   Ű "
say
CALL WhiteCol; CALL CHAROUT , " Ű    Ű   Ű  Ű  Ű   Ű Ű  Ű    Ű Ű   Ű"
Call RedCol;CALL CHAROUT , "      Code by RobertM and Jep, "
say
CALL WhiteCol; CALL CHAROUT , "  ŰŰŰ  ŰŰŰ   Ű  Ű    Ű   ŰŰŰŰ Ű  Ű  Ű    "
CALL yellowCol; CALL CHAROUT , "     Thanks to WarpCafe "

call YellowCol

CALL SysSleep 1
Parse Arg v1ideost
if v1ideost="" then call nofile  /* if no argumet go to exit */
filebytes = stream(v1ideost, C, 'query size') /* determine is it file or dir */
IF filebytes = 0 then call ProcDir  /* if dir jump to ProcDir else continue */

Call GreenCol
FFmpeg_pth" -i "v1ideost
Call WhiteCol
say "Enter samplerate (enter for default to "SAMPLERATE")"
Call GreenCol
tsample=LINEIN()
If tsample="" then tsample=SAMPLERATE
Call WhiteCol
say "Enter bitrate (enter for default to "BITRATE")"
Call GreenCol
tbit=LINEIN()
If tbit="" then tbit=BITRATE
Call WhiteCol
say "Enter stream mapping [-map 1:0] (enter for default to no mapping at all)"
Call GreenCol
tmap=LINEIN()

PARSE VALUE REVERSE( FILESPEC( "N", v1ideost ) ) WITH ."."fname
fname = REVERSE( fname )
gname="'"fname".mp3'"
FFmpeg_pth' -i 'v1ideost tmap' -acodec libmp3lame -ac 2 -ar 'tsample' -ab 'strip(tbit)'k -vol 256 'gname

call WhiteCol
Say "conversion complete"
exit

RedCol:
CALL CHAROUT ,"1B"x||'[1m'||"1B"x||'['||31||'m'
return

GreenCol:
CALL CHAROUT ,"1B"x||'[1m'||"1B"x||'['||32||'m'
return

WhiteCol:
CALL CHAROUT ,"1B"x||'[1m'||"1B"x||'['||37||'m'
return

LblueCol:
CALL CHAROUT ,"1B"x||'[1m'||"1B"x||'['||36||'m'
return

YellowCol:
CALL CHAROUT ,"1B"x||'[1m'||"1B"x||'['||33||'m'
return

GreyCol:
CALL CHAROUT ,"1B"x||'[1m'||"1B"x||'['||30||'m'
return

BlueCol:
CALL CHAROUT ,"1B"x||'[1m'||"1B"x||'['||4||'m'
return

YellGreyCol:
CALL CHAROUT ,"1B"x||'[1m'||"1B"x||'['||5||'m'
return

YellRedCol:
CALL CHAROUT ,"1B"x||'[1m'||"1B"x||'['||41||'m'
return

cYellRedCol:
CALL CHAROUT ,"1B"x||'[1m'||"1B"x||'['||40||'m'
return

ProcDir:
Call SysFileTree ARG(1)||v1ideost"\*", "files", "FO"
do i = 1 to files.0
 say files.i
v1ideost="'"files.i"'"
PARSE VALUE REVERSE( FILESPEC( "N", v1ideost ) ) WITH ."."fname
fname = REVERSE( fname )
gname="'"fname".mp3'"

FFmpeg_pth' -i 'v1ideost' -acodec libmp3lame -ac 2 -ar 'SAMPLERATE' -ab 'strip(BITRATE)'k -vol 256 'gname
end

call WhiteCol
Say "conversion complete"
exit

nofile:
say
call YellRedCol
say
say" Must have source file or source directory as argument"
call cYellRedCol

say ""
say "exiting..."
pause
exit


Batchheizer

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: CE2mp3
« Reply #1 on: 2009.06.15, 17:34:50 »
CE2mp3 works fine. Thanks for this fine small program. Three remarks:
1. Is it possible to convert the Vorbis-Tags (from ogg-files) to ID3 tags? Now the tags are lost. ID3V2 (on hobbes, handles ID3 up too 2.3.0) and VorbisComment from Ogg-Package maybe useful for this.
2. Is it possible to write the tags to the EAs? On eCS with the CW-Classes Title, Artist etc. can be written to the EAs. It should be possible to implement this with REXX.
3. Maybe a WarpIN-Package could help to create WPS-Objects and associations (to OGG etc.).

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: CE2mp3
« Reply #2 on: 2009.06.15, 23:36:56 »
For questions 1,2, I think that this can be easy done, but maybe in next release. I'm now busy on updating something else. But in few days I could try something with that. I was considering possibility of creating target name from tag data too. Nice suggestions. Thanks.
3. I'm not a programer, and I do not have enough time to learn all that about WarpIn and WPS objects. This simple script was finished because other people help me.

4. GUI version is next release.

jep

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 421
    • View Profile
Re: CE2mp3
« Reply #3 on: 2009.06.16, 07:59:37 »
Batchheizer and Cyber,

CE2mp3 seem to grow rapidly now.  ;)

Very good suggestions Batchheizer...

We'll help you to deal with obstacles that you may encounter cyber, just mention what you're looking for.

I have rexx code (as functions) for you that deal with question 3, auto configuration, wps object creation with file association etc. that rexx does so very good on its own. (Similar to code used in MPlayer configration, ClamAV... etc.)

//Jan-Erik


cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: CE2mp3
« Reply #4 on: 2009.06.16, 08:26:58 »
CE2mp3 seem to grow rapidly now.  ;)

  Im affraid of that.  It make mp3 files as result. But it can convert to any format FFmpeg support, so It may become CE2Anything in future ?  :o

We'll help you to deal with obstacles that you may encounter cyber, just mention what you're looking for.

I have rexx code (as functions) for you that deal with question 3, auto configuration, wps object creation with file association etc. that rexx does so very good on its own. (Similar to code used in MPlayer configration, ClamAV... etc.)

Well... If You help anytime I stuck like till now... I can write even OpenOS/2.  ;D

Batchheizer

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: CE2mp3
« Reply #5 on: 2009.06.16, 10:53:51 »
I have rexx code (as functions) for you that deal with question 3, auto configuration, wps object creation with file association etc. that rexx does so very good on its own. (Similar to code used in MPlayer configration, ClamAV... etc.)
//Jan-Erik
I prefer WarpIN, because of easy (De-)Installation and Upgrade. If nobody of the programers could handle it, I could create the WIS-script and the WPI-Package. Please tell me, what associations are useful for CE2mp3.

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: CE2mp3
« Reply #6 on: 2009.06.16, 15:04:33 »
Please tell me, what associations are useful for CE2mp3.

To many... almost all of existing audio formats and every video format (container) that can carry audio file supported by FFmpeg, but mostly we are interested in: ogg, wav, mp2, mp3, wma, amr ... avi, mp4, mpeg, vob, wmv, flc, 3gp, flash...
You can try `FFMPEG -formats' (or with >format.txt ) on command line, and AFAIK all listed with D can be source file and with E can be target file.


jep

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 421
    • View Profile
Re: CE2mp3
« Reply #7 on: 2009.06.16, 15:38:41 »
Hi,

Well... If You help anytime I stuck like till now... I can write even OpenOS/2.  ;D

cyber, I may take your word for it...  ;) when can we expect you to deliver OpenOS/2?!  ;D

I prefer WarpIN, because of easy (De-)Installation and Upgrade. If nobody of the programers could handle it, I could create the WIS-script and the WPI-Package. Please tell me, what associations are useful for CE2mp3.

Yes, you're quite right, though while it's rexx only it's very well suited for the task.

Why I never got WarpIn do do anything useful was probably due the fact that it's not possible to use the promising gui to create wpi packages.

//Jan-Erik

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: CE2mp3
« Reply #8 on: 2009.06.16, 16:19:45 »
cyber, I may take your word for it...  ;) when can we expect you to deliver OpenOS/2?!  ;D

Ahem... How should I start writing ?  Some loop ? :)

Yes, you're quite right, though while it's rexx only it's very well suited for the task.

Wich language is better than Rexx ?  ;)

Why I never got WarpIn do do anything useful was probably due the fact that it's not possible to use the promising gui to create wpi packages.

Update:
It is probably waste space to paste 'code' here, so it is zipped, VREXX GUI version; very same to nonGUI but with wIndoZes to chose bitrate/samplerate/mapping... and if started without paramethar, file selection window -- no multiple files or directorys, or I do not know how.  Using directory name as paramethar work as before. Please test... If anyone need, there is VREXX -> files that is need to run.

CDRWSel

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
Re: CE2mp3
« Reply #9 on: 2009.06.17, 11:48:30 »
Hi,
I have ffmpeg audio conversion integrated into my cdrwsel gui as well as video and I can make my current build available if needed. Just send me an email to r.dodin to the mail server "free.fr" .
I couldn't take as long time as planned on my gui development and it is in a "beta" build. I should have a few vacancies in a near time and plan to take time updating my interface (new first menu mutch more friendly...)
If you would like use it for audio/video conversion, just start cdrwsel with the flag enabling internal filemanager only.

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: CE2mp3
« Reply #10 on: 2009.06.17, 12:10:49 »
CDRWSel do conversion of audio files in internal filemanager ? 
Don't got me wrong, I really value Your work and how You help me earlier, but this is kinda bloatware...  ;D
BTW any multisession now in CDRWSel ?
« Last Edit: 2009.06.17, 12:15:03 by cyber »

CDRWSel

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
Re: CE2mp3
« Reply #11 on: 2009.06.17, 14:14:16 »
First, I did CDRWSel GUI to manage more than one CD/DVD/BD burner using RSJ but rapidly,
* RSJ was made optional
* Added mkisofs and DVDDAO support
* Added some cdrtools options used for CD-AUDIO and to burn CD ISO images
Due to the need to put some own AVI files out of my camera on DVD:
* I added ffmpeg and dvdauthor support to create my DVD in one drag/drop from an AVI or FLV etc... file.
For the same raison about some personnal mp3 audio records to CD-AUDIO : 
* I added lame + sox support (my prefered tool) but due to format limitation, I enable audio conversion available though ffmpeg (including  WMA, FLAC etc format).
Of course, I do not need burn a CD or DVD each time and both video/audio conversion can be used out of the burning process through the internal filemanager. this one can be started without the burning menu
 
But all of these options are currently available under the build I have at home and audio conversion part isn't available on the build downloaded from my server by a few users.
 
My next step is to make the first menu more friendly like I told. That is, using quick path through a few icons :
1/ CD/DVD/BR to ISO image file (icon)
2/ CD/DVD/BR clone (icon)
3/ ISO to CD/DVD/BR (icon)
4/ Create CD-AUDIO (icon)
5/ Create DVD-VIDEO (icon)
6/ Create DATA CD/DVD/BR (icon)
7/ AUDIO to AUDIO (icon) using ffmpeg   
8/ VIDEO to VIDEO (icon) using ffmpeg

note: BR = Blu-ray (I use it a lot for my system backup, data only due to missing compatible UDF for the VIDEO while the curretn UDF or CDFS are those needed for datas)
As you can see, I plan to have more work to do (just after my system upgrade  ;) )

My knowledge is limited but I try to do my best and I wrote it using drdialog.
Cheers/2
Remy
   

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: CE2mp3
« Reply #12 on: 2009.06.17, 14:20:24 »
Question for Dr Jep:

How to delete one last caracter from string.
For example Artist.Name-Song.1 to become Artist.Name-Song. ?

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: CE2mp3
« Reply #13 on: 2009.06.17, 14:31:22 »
To CDRWSel:

I know... all started simple and easy lot years ago, and then suddenly I was lost in bunch of options and possibilities CDRWSel give two years ago (in non public releases). As I mostly need only sixt option (6/), and then was no multisession support built in, I wrote my own script for that (if You remember Napalm), and give up with CDRWSel. :) 
More friendly meny will for sure help. CDRWSel is now more like set of applications related to burn and manipulate audio/video files.
« Last Edit: 2009.06.17, 14:34:34 by cyber »

jep

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 421
    • View Profile
Re: CE2mp3
« Reply #14 on: 2009.06.17, 15:48:31 »
Question for Dr Jep:

How to delete one last caracter from string.
For example Artist.Name-Song.1 to become Artist.Name-Song. ?

Alt. 1
fname = REVERSE( SUBSTR( REVERSE( fname ), 2 ) )

Advantage: Robust even if fname doesn't contain any characters, less sensetive to problems/errors
Disadvantage: Has to reverse the text twice

Alt. 2
fname = SUBSTR( fname, 1, LENGTH( fname ) - 1 )

Advantage: ?
Disadvantage: May cause halt/stop/crash if length( fname ) = 0, need a check before usage
if length( fname ) > 0 then
  fname = SUBSTR( fname, 1, LENGTH( fname ) - 1 )

//Jan-Erik