Author Topic: FLACs, OGGS and WAVs  (Read 10118 times)

The Blue Warper

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: FLACs, OGGS and WAVs
« Reply #15 on: 2009.05.21, 12:36:56 »
Hi, Ben!

I sincerely apologize for not replying to your post dated 2009.05.12, 07:20:36.  I wasn't at home and I came back today.  I'm very glad, though, that you eventually got your troubles solved, thanks to OS2 World's community!

RobertM

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2034
    • View Profile
    • A.I.BuiltPC - using OS/2 Warp Server & eComStation for Custom Web and Database Solutions
Re: FLACs, OGGS and WAVs
« Reply #16 on: 2009.05.21, 20:04:33 »
A few commans:
ffmpeg -i f:\ogg_tracks\track01.ogg -acodec libmp3lame -ac 2 -ar 22500 -ab 128k -vol 256 g:\var\temp\track01.mp3


And that my friends, can easily be turned into a REXX script. See CDRWs notes below for the important parameters and descriptions...

Then it's simply a REXX script, create an icon and name something like "OGG to MP3" and you are up and running.

You can use things like the substr(), lastpos(), mkdir() and directory() statements to read and change the in/out directories, and so on. You can also have the script pop up a window asking for the sample rate and bitrate before the encoding happens. You can even stick that "asking" in a timed loop that defaults to a certain value. Then, the "execution" string simply becomes something like:

Code: [Select]
'ffmpeg -i 'OGGFILENAME' -acodec libmp3lame -ac 2 -ar 'SAMPLERATE' -ab 'strip(BITRATE)'k -vol 256 'MP3FILENAME
Then simply open the OGG template (create one in the templates folder if you dont have one), and assign the "OGG to MP3" icon to it's pop-up menu.

The whole script can be as simple as:


Code: [Select]
/* OGG to MP3 */
Parse Arg OggFileName

SAMPLERATE=22500    /* CHANGE AS NEEDED */
BITRATE=128    /* CHANGE AS NEEDED */

/* CREATE CODE TO REQUEST SAMPLE RATE AND CHECK FOR KEYBOARD INPUT ON TIMED LOOP - USE DEFAULTS IF NOTHING TYPED BY END OF LOOP */

/* CREATE CODE TO REQUEST BIT RATE AND CHECK FOR KEYBOARD INPUT ON TIMED LOOP - USE DEFAULTS IF NOTHING TYPED BY END OF LOOP */

/* Create MP3 file name by simply changing the extension - this will leave the file name and path identical to original */
/* Note: this won't work if source file is on a DVD or CD. A simple test to determine local disks, match drive letter of source file and change */
/* from CD/DVD to HDD (dont forget to create directories) is really easy to add to this */

MP3FileName=SubStr(OggFileName,1,LastPos(translate(OggFileName),".OGG"))||"mp3"


/* Ensure that ffmpeg's directory is in the PATH statement someplace */

/* Use commands such as Directory and/or MkDir() (<--- important one) to enhance this script for such things as */
/* Creating different output directories such as "\OriginalPath\MP3_File\" or writing to a "Music" folder or whatever */

/* Otherwise, as coded below, MP3 file will be created in same directory */
'ffmpeg -i 'OGGFILENAME' -acodec libmp3lame -ac 2 -ar 'SAMPLERATE' -ab 'strip(BITRATE)'k -vol 256 'MP3FILENAME

The code to change the sample rate is very simple... display choices (ie: (1) 22500, (2) 44100, (3) 48000), create a loop, iterate it x number of times, check for input each time (and IF input detected, assign to a varand leave loop), sleep a second, after loop exit (whether because it has finished iterating or it has reached the "leave" statement) check the var... if it is 1-3, change sample rate accordingly - otherwise, leave sample rate the same (as defined above).

Repeat for bitrate.



Alternatively, one can specify options instead (such as SR44100BR128) in the parameters section for the icon, and have the script parse those as well to set those values.

Or, one can have a bunch of special purpose variants of the script or icons set up such as "OGG to MP3 at 44100/128" and "OGG to MP3 at 22500/128" etc. Then add them all to the OGG template's pop-up menu.




I regularly convert FLV to MPG, and VOB to FLV using the method above

And yes, thusly, this works with any formats that ffMPEG - or mEncoder for that matter, understand - which is mostly any format there is.



« Last Edit: 2009.05.21, 20:11:16 by RobertM »
|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


Ben

  • Sr. Member
  • ****
  • Posts: 367
  • What is really important?
    • View Profile
    • The Self Wrighting Network
Re: FLACs, OGGS and WAVs
« Reply #17 on: 2009.05.22, 04:07:50 »
The Blue Warper; Hey, not a problem... lots of interested parties here with good tips; thanks all.

--

Anyone here having a problem loading the first page of this thread? Or is my machine becoming cantankerous?

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: FLACs, OGGS and WAVs
« Reply #18 on: 2009.05.22, 08:24:01 »
Here both pages load nice, anyway, You people give great ideas, wma is also on supported formats, i Wonder will AMR (SonyErricson recording format) is possible to convert.
« Last Edit: 2009.05.22, 12:01:25 by cyber »

The Blue Warper

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: FLACs, OGGS and WAVs
« Reply #19 on: 2009.05.22, 17:50:30 »
Another choice would be jRipper:
http://dronten.googlepages.com/jripper

From the presentation page:


jRipper is an cd ripper and audio converter made in java (1.5).
jRipper can encode and decode Wav, Flac, MP3, Ogg, AAC(M4A) formats. It can also do transcoding between various formats.
Beware though that every transcoding deteriorate the quality of the audio file.

jRipper works as an frontend to cdda2wav, lame, oggenc/oggdec, flac and faac/faad programs, which does the actually reading/encoding/decoding work. jRipper can load track names for an CD from freedb.org.


Ronald Brill made an OS/2 installable package:
http://www.rbri.org/jripper/jripper.html

Ben

  • Sr. Member
  • ****
  • Posts: 367
  • What is really important?
    • View Profile
    • The Self Wrighting Network
Re: FLACs, OGGS and WAVs
« Reply #20 on: 2009.05.22, 18:28:28 »
Personally speaking, I do not understand with today's high speed Internet and huge disk capacities, why anyone bothers with Audio compression techniques... I mean, how large can an WAV file get?

Not very big.

Huge video files measuring in the gigabytes are transferred as the norm, any non-compressed audio file cannot reach anything, but a fraction of that size, so why bother compressing them? Just use the original WAV format and quality reduction be damned.

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: FLACs, OGGS and WAVs
« Reply #21 on: 2009.05.22, 19:48:48 »
There is also  sox - Sound eXchange : universal sound sample translator !
latest release: http://hobbes.nmsu.edu/download/pub/os2/apps/mmedia/sound/convert/sox-12.17.1.zip

And to Ben: they can be veeery big, mostly when used on system/devices without unlimited storage abbilities, like mp3 devices, smartphones, laptops, netbooks, and for example on sites on internet wich is free of charge.

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: FLACs, OGGS and WAVs
« Reply #22 on: 2009.06.12, 12:00:50 »
You can find convertor to mp3 as CDRWsel and RoberM describe here:
http://www.os2world.com/component/option,com_smf/Itemid,63/topic,1655.msg11385/topicseen,1/#new

Pete

  • Hero Member
  • *****
  • Posts: 865
    • View Profile
Re: FLACs, OGGS and WAVs
« Reply #23 on: 2009.06.12, 15:22:55 »
Hi All


Must admit that I am in total agreement with Ben - but, there again, I am someone who thinks mp3, and other compressed audio formats, are a total waste of time and certainly not capable of producing any form of acceptable audio.

Guess that is the result of being a bit spoilt, I like Linn turntables and Meridian CD players to produce my audio  :-)

Regards

Pete

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: FLACs, OGGS and WAVs
« Reply #24 on: 2009.06.12, 15:57:08 »
I'm the first to disagree with You both.  ;D While other people mostly has sound equipment wich is totaly out of question (active plastic speakers:)) to notice anything, I'm quite well equipped with oldy-goldy Marantz receiver, Visaton 2system transmision speakers, SB AWE32 and real power supply. With such system I really cann't determine what is mp3, and what is real CD audio.  This is for mp3 I produce, created with bladeenc, without using filters and more than 128 kbps and 44.1 KHz.
There is also one side of listening music when I'm not in my room, in public transport system, when I wait for something... I've carry around devices with headphones for, well... 30 years ! :) mp3 rules!  ;D

Andi

  • Sr. Member
  • ****
  • Posts: 264
    • View Profile
Re: FLACs, OGGS and WAVs
« Reply #25 on: 2009.06.12, 19:59:41 »
With proper equipment and right sound, it's quite easy to distinguish original CD (PCM 44.1kHz 2x16bit)  from 128kBit .mp3 (blind test of course and even with original Fraunhofer codec). The difference is quite big for me so I didn't test further. Maybe it's time for retest with 256kBit. But hee, 128kBit is good enough for portable players and for playing in the car radio. But nothing I want to hear on my home equipment.

cyber

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: FLACs, OGGS and WAVs
« Reply #26 on: 2009.06.16, 09:50:13 »
196 is minimum if You want good sound on speakers. Also my personal oppinion is that original Fraunhofer isn't good at all, I now mostly use Lame (with using switch for output quality, vbr, jstereo), and Blade.

rudi

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: FLACs, OGGS and WAVs
« Reply #27 on: 2009.06.16, 10:11:14 »
196 is minimum if You want good sound on speakers.

Yep, that is the lowest rate (192k to be correct) I've found acceptable as well.

Also my personal oppinion is that original Fraunhofer isn't good at all, I now mostly
use Lame (with using switch for output quality, vbr, jstereo), and Blade.

The Fraunhofer encoder and Blade are very similar. That why Fraunhofer/Thomson
sued the author and forced him to shut down the web site. AFAIK, Lame uses it's own
psycho-acoustic model and has some bug fixes over the reference implementation.
Thus it produces better results, especially on lower rates and/or vbr.