oggenc >FILE creates a wrong file
Let me reproduce the bugreport I sent to the Debian bug-tracking system:
Subject: oggenc: --output=FILE and >FILE have different results
Package: vorbis-tools
Version: 1.0rc3-1
Severity: important
oggenc seems to create different files depending on the style of the
commandline, whether it is
$ cat test.raw | oggenc --raw - --output=test-inputpipe.ogg
or
$ cat test.raw | oggenc --raw - > test-pipe.ogg
The big trouble is that the latter method (> FILE) produces a file
that ogg123 can read without any visible error/warning, but ogginfo
says that the integrity test fails, and vorbiscomment doesn't even
recognize the file as a Ogg file.
An example should make this clearer:
================================================================
*** First, we create the files.
$ oggenc --raw test.raw --output=test.ogg
Encoding "test.raw" to
"test.ogg" at quality 3,00
Encoding with VBR
Encoding [ 1m39s so far] -
Done encoding file "test.ogg"
File length: 1m 01,0s
Elapsed time: 1m 40,2s
Rate: 0,6183
Average bitrate: 84,1 kb/s
$ cat test.raw | oggenc --raw - > test-pipe.ogg
Encoding standard input to
standard output at quality 3,00
Encoding [ 1m48s so far] -
Done encoding.
File length: 1m 01,0s
Elapsed time: 1m 49,1s
Rate: 0,5675
Average bitrate: 84,1 kb/s
$ cat test.raw | oggenc --raw - --output=test-inputpipe.ogg
Encoding standard input to
"test-inputpipe.ogg" at quality 3,00
Encoding with VBR
Encoding [ 1m40s so far] -
Done encoding file "test-inputpipe.ogg"
File length: 1m 01,0s
Elapsed time: 1m 41,0s
Rate: 0,6132
Average bitrate: 84,1 kb/s
*** Now, we try these files:
$ ogginfo test.ogg
filename=test.ogg
serial=1963857601
header_integrity=pass
vendor=Xiphophorus libVorbis I 20011231
version=0
channels=2
rate=44100
bitrate_upper=none
bitrate_nominal=112015
bitrate_lower=none
stream_integrity=pass
bitrate_average=83060
length=61.936327
playtime=1:01
stream_truncated=false
total_length=61.936327
total_playtime=1:01
*** No problem for test.ogg.
$ ogginfo test-pipe.ogg
filename=test-pipe.ogg
header_integrity=fail
stream_integrity=fail
stream_truncated=true
serial=1478540987
header_integrity=pass
vendor=Xiphophorus libVorbis I 20011231
version=0
channels=2
rate=44100
bitrate_upper=none
bitrate_nominal=112015
bitrate_lower=none
stream_integrity=pass
bitrate_average=82533
length=61.936327
playtime=1:01
stream_truncated=false
total_length=61.936327
total_playtime=1:01
*** Trouble!
$ ogginfo test-inputpipe.ogg
filename=test-inputpipe.ogg
serial=33960753
header_integrity=pass
vendor=Xiphophorus libVorbis I 20011231
version=0
channels=2
rate=44100
bitrate_upper=none
bitrate_nominal=112015
bitrate_lower=none
stream_integrity=pass
bitrate_average=83060
length=61.936327
playtime=1:01
stream_truncated=false
total_length=61.936327
total_playtime=1:01
*** No problem. Now let's try vorbiscomment:
$ vorbiscomment test.ogg
$ vorbiscomment test-pipe.ogg
Failed to open file as vorbis: Input is not an Ogg bitstream.
$ vorbiscomment test-inputpipe.ogg
$
================================================================
-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux noon.dnsalias.net 2.4.9 #1 sam mar 2 20:48:32 CET 2002 i686
Locale: LANG=fr_FR, LC_CTYPE=fr_FR
Versions of packages vorbis-tools depends on:
ii libao2 0.8.2-1 Cross Platform Audio Output Librar
ii libc6 2.2.5-4 GNU C Library: Shared libraries an
ii libcurl2-ssl 7.9.5-2 Multi-protocol file transfer libra
ii libogg0 1.0rc3-1 Ogg Bitstream Library
ii libvorbis0 1.0rc3-1 The Vorbis General Audio Compressi