gnump3d-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnump3d-users] Using downsampling to recode .ogg to .mp3


From: amaya
Subject: Re: [Gnump3d-users] Using downsampling to recode .ogg to .mp3
Date: Tue, 8 Nov 2005 15:45:20 -0500 (EST)

Many thanks for the replies. I've had a little bit of time to work on this today, and I've found a few things out.

First, the thought that the standard redirection operators don't work in the gnump3d.conf file isn't right. For example, here is one of the default ogg downsample lines:

   downsample_medium_ogg = \
     sox -t ogg $FILENAME -t raw - | \
     oggenc --raw --downmix -b 64 -

This line works perfectly. As does the following line, for flac files:

   downsample_medium_flac= \
     /usr/bin/flac --decode --stdout $FILENAME | \
     /usr/bin/lame -b 64 - -

Since these lines both work, it doesn't seem too farfetched to expect a line decoding an ogg file to stdout and piping it in to lame would work.

Turns out, it does. Gnump3d does exactly what it ought to--the line in the config file causes all ogg files to be perfectly transcoded to mp3 files. My problem appears to be in a completely different program--XMMS. My impression so far is that XMMS doesn't like getting an mp3 file when it expects an mp3 file. Using mpg123 works perfectly.

I believe Chris Hendrickson already pointed out that finding a way to change the extension of the file when Gnump3d sends it to the client may be the key.

Many thanks,
Austin

On Tue, 8 Nov 2005, Chris Hendrickson wrote:

 oops, I sent this with address that is not in the mailing list (they end
 up filtering to the same place) so I'm going to send this again just to
 be sure since I have not seen it appear on the list.

 If you get multiple copies, my apologies.

 you could write a one or two line script and call THAT along the
 lines of

# !/bin/bash
# downsample_ogg.sh
 /usr/bin/oggdec --raw -b 16 -e 1 -o - $1 |  /usr/bin/lame -r -s 44.1
 - - -m j -b 64 - -

 the $1 variable is the first parameter passed to the command, $2 the
 second, etc. $0 would then be the entire command

 set the execute bit
 chmod +x downsample_ogg.sh

 and then set
 downsample_medium_ogg = /usr/local/bin/downsample_ogg.sh $FILENAME

 you could then also set it up to pass other options such as the bit
 rate to encode to by turning them into parameters to the script as
 such as below

# !/bin/bash
# downsample_ogg.sh
 /usr/bin/oggdec --raw -b 16 -e 1 -o - $1 |  /usr/bin/lame -r -s 44.1
 - - -m j -b $2 - -

 and then

 downsample_medium_ogg = /usr/local/bin/downsample_ogg.sh $FILENAME 64
 downsample_high_ogg = /usr/local/bin/downsample_ogg.sh $FILENAME 128
 etc

 $1 would be $FILENAME, $2 would be the second parameter, the desired
 bitrate, etc.
 so you write one script and then pass it whatever parameters it needs.



 koan wrote:

>  I believe your problem is that you are assuming the line you are
>  giving the downsampler is being executed by a shell which I doubt it
>  is. It is most likely a perl .exec() call. Since is it not a shell,
>  the standard redirection operators (for stdout, stdin, stderr) do
>  not work therefore you cannot pipe the output of command 1 into
>  comand 2 - that is a function of the shell.
> > What I might suggest would be something like make the line include a
>  start shell command which in turns executes the command for the
>  downsampling (not sure how well gnump3d would respond to this)..
> > example: > > ownsample_medium_ogg = /bin/bash -c '/usr/bin/oggdec --raw -b 16 -e
>  1 -o - $FILENAME | /usr/bin/lame -r -s 44.1 -m j -b 64 - -'
> > I havn't tested it but what SHOULD be happening is you start a shell
>  with -c which says "execute this command when you start". Thus you
>  have gnump3d -> open shell -> calls your command (which now works
>  because its executed in the context of the shell and the redirection
>  operators are valid).
> > hope that helps :) > > > On 11/7/05, address@hidden <mailto:address@hidden>* <address@hidden
>  <mailto:address@hidden>> wrote:
> > Hello all -- > > I'm trying to persuade gnump3d to recode my ogg files to mp3 when
>  downsampling. Enough of my friends are non-technical enough to
>  make the
>  hassle of recoding the files less than the hassle of explaing
>  what an ogg
>  file is and how to play it. :) That being said, I'm trying
>  something like
>  the following line in gnump3d.conf:
> > downsample_medium_ogg = \
>  /usr/bin/oggdec --raw -b 16 -e 1 -o - $FILENAME | \
>  /usr/bin/lame -r -s 44.1 -m j -b 64 - -
> > I apparently need the --raw flag since I'm writing to stdout (
>  i.e., as
>  opposed to the default .wav output). The flags on /usr/bin/lame
>  tell lame
>  to assume raw pcm data, and give it (what I hope are) all the
>  necessary
>  parameters of the data. These combinations of options come from
>  some time
>  spent hunting through manpages and trial-and-error.
> > My problem is that it isn't working. The command above works
>  just fine on
>  the command line. In gnump3d, however, no ogg file plays, and
>  the error
>  log contains:
> > Error writing to file: Broken pipe
>  Error writing mp3 output
> > which isn't terribly helpful. > > For the record, gnump3d -v gives:
>  gnump3d v2.9.7 [CVS Info: gnump3d2 1.109 (2005/10/28)] on
>  Perl v5.008006
> > If any one can shed some light on this, I'd be mighty appreciative. > > Thanks,
>  Austin
> >
_______________________________________________
>  Gnump3d-users mailing list
>  address@hidden <mailto:address@hidden>
>  http://lists.gnu.org/mailman/listinfo/gnump3d-users
> > > > ---------------------------------------------------------------------- >
_______________________________________________
>  Gnump3d-users mailing list
>  address@hidden
>  http://lists.gnu.org/mailman/listinfo/gnump3d-user
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.1 (MingW32)
 Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

 iD8DBQFDcMFeTYuromfymuQRApF5AKDf3iAfFnPA4FEZNvVy2vsQtmkzdACaAuHx
 x3R7gPWEXVzbebDkZiB2OFg=
 =u9e8
 -----END PGP SIGNATURE-----




 _______________________________________________
 Gnump3d-users mailing list
 address@hidden
 http://lists.gnu.org/mailman/listinfo/gnump3d-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]