Bug#697144: dir2ogg: Broken sound speed of converted files

2013-03-17 Thread Thomas Orgis
TLDR: Please check with current mpg123 snapshot and think about either
prescribing format and letting mpg123 write really raw data or make
proper use of the improper WAV header.

Hello,

mpg123 upstream here. I really did not intend to break dir2ogg in
various ways. I totally regret touching WAV writing code at all. While
I think that it is a bit bold to pipe something like WAV to stdout and
expect it to work (many programs really are not happy with the
inconsistent headers that this produces, take audacity or even just
libsndfile), there are some that could make use of this. Among those
are oggenc and lame, for that matter.

I do wonder why you have

opts=['-r', '-R', str(mutagen.File(self.song).info.sample_rate)]

for mpg123 output in dir2ogg. Is this already an attempt to fix broken
WAV output by mpg123? If not, I really have to wonder why you do not just use

mpg123 -s input.mp3 | ogggenc -r -R $rate -C $channels -B 16 -o 
output.ogg

or rather

mpg123 -e s24  -s input.mp3 | ogggenc -r -R $rate -C $channels -B 24 -o 
output.ogg

for avoiding extra quality impact from rounding to 16 bit in between
(sadly, oggenc does not seem to support float, which would avoid
integer intermediate altogether).

Note $channels ... current dir2ogg will screw up if the input is a mono
file. It assumes stereo. 

Thing is, you tell mpg123 to write WAV headers and then tell oggenc to
ignore them via -r. That confuses me. If you want raw data, tell mpg123
to deliver raw data to stdout via the -s switch.

But, once we got through this mess with the repeatedly messed up
WAV-to-stdout (which I always recommend to use with caution only ...),
for example using current http://mpg123.org/snapshot, which shall
become mpg123 1.16.0, you can just do that:

src/mpg123 -w - -e s24 input.mp3 | oggenc  -o output.ogg -

and have it magically work. Note that the '-e s24' might not be
available on certain builds of mpg123. If it is supported, it appears in

mpg123 --longhelp

in this line:

 -e  --encoding  force a specific encoding (s16 u16 u8 s8 ulaw alaw 
f32 s32 u32 s24 u24)

I might add a specific switch to ask about that (mpg123
--list-encodings or such) to 1.16.0, if it's desired.

To support all versions of mpg123, you can extend your hack that
inserts the sample rate via mutagen and have it provide the full format
(including channel count) and just pipe the raw data from mpg123 via
-s. The option for s24 format would just reduce the quality loss a
bit ... if you care about that when converting between lossy formats;-)

Using the WAV output of a minimally required mpg123 >= 1.16.0 would
avoid the question of checking which output format is available. People
can make different builds of mpg123 that have different (default)
sample format (floating point, for example).

It's interesting that oggenc and lame are the only tools I found with
some quick tests that are happy with the kind of broken WAV you get via
pipes. But then, if you intend to store such files, you'd better write
them properly.


Alrighty then,

Thomas


signature.asc
Description: PGP signature
___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Re: Bug#697144: dir2ogg: Broken sound speed of converted files

2013-03-03 Thread Julian Andres Klode
Control: reassign -1 mpg123
Control: affects -1 dir2ogg

On Tue, Jan 01, 2013 at 08:07:51PM -0200, Nelson A. de Oliveira wrote:
> Package: dir2ogg
> Version: 0.11.8-1
> Severity: important
> 
> Something is really broken when converting the attached
> decima-quinta.mp3 with a simple "dir2ogg decima-quinta.mp3"
> 

That's true, yes. You used mpg123 as the mp3 decoder, right? It
seems that this creates a different file depending on whether
the output is a file or a pipe. Thus, if you pass dir2ogg the
-P argument to create a temporary file, everything works.

Using another mp3 decoder also works.

(And yes, mpg123 is completely broken now in combination
with dir2ogg without the -P option, as it's handling of
-w/dev/stdout and -w- broke a second time[1]).

[1] I switched dir2ogg 0.11.4 to use -w/dev/stdout instead
of -w- for mpg123, as mpg123 did not understand -w- anymore;
now only -w- works, and -w/dev/stdout is broken.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.


pgpu9gsFEvKtW.pgp
Description: PGP signature
___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Processed: Re: Bug#697144: dir2ogg: Broken sound speed of converted files

2013-03-03 Thread Debian Bug Tracking System
Processing control commands:

> reassign -1 mpg123
Bug #697144 [dir2ogg] dir2ogg: Broken sound speed of converted files
Bug reassigned from package 'dir2ogg' to 'mpg123'.
No longer marked as found in versions dir2ogg/0.11.8-1.
Ignoring request to alter fixed versions of bug #697144 to the same values 
previously set
> affects -1 dir2ogg
Bug #697144 [mpg123] dir2ogg: Broken sound speed of converted files
Added indication that 697144 affects dir2ogg

-- 
697144: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697144
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems

___
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers