• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

CE2mp3

Started by cyber, 2009.06.12, 12:05:45

Previous topic - Next topic

cyber

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.



/*  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

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

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

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

Quote from: jep on 2009.06.16, 08:59:37
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

Quote from: jep on 2009.06.16, 08:59:37
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

Quote from: jep on 2009.06.16, 08:59:37
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

Quote from: Batchheizer on 2009.06.16, 11:53:51
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

Hi,

Quote from: cyber on 2009.06.16, 09:26:58
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

Quote from: Batchheizer on 2009.06.16, 11:53:51
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

Quote from: jep on 2009.06.16, 16:38:41
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 ? :)

Quote from: jep on 2009.06.16, 16:38:41
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 ?  ;)

Quote from: jep on 2009.06.16, 16:38:41
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

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

#10
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 ?

CDRWSel

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

Question for Dr Jep:

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

cyber

#13
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.

jep

Quote from: cyber on 2009.06.17, 15: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. ?

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