xiph / opus-tools

A set of tools to encode, inspect, and decode audio in the Opus format.
https://opus-codec.org/
Other
218 stars 79 forks source link

flac Error parsing input file: #15

Closed sigma001 closed 7 years ago

sigma001 commented 7 years ago

i tried first debian sid package, then compiled from this github source 0.1.10 same result Error parsing input file. Is flac support broken, or are debian dev packages wrong?

mark4o commented 7 years ago

FLAC input is working fine for me, using the Debian package or building from source. Support for FLAC input is optional; if you build from source it will only include it if FLAC is installed (flac-dev on Debian). You can verify that your opusenc was built with support for FLAC input using opusenc --help, which will list the supported input formats near the top. You may also want to verify that your input file is actually FLAC; "file path.flac" should report "FLAC audio bitstream data" and "head -c 4 path.flac; echo" should report "fLaC".

sigma001 commented 7 years ago

flac is ok, all tests are fine and playing well, so something must be broken at my install or debian sid?

mark4o commented 7 years ago

It should be working. If you can provide the output from the following commands (substituting the name of the FLAC input file for in.flac) then that may help to diagnose the issue.

opusenc --help | grep AIFF
ldd $(which opusenc)
file in.flac
xxd in.flac | head -3
opusenc in.flac out.opus
sigma001 commented 7 years ago

opusenc --help | grep AIFF: The input format can be Wave, AIFF, FLAC, Ogg/FLAC, or raw PCM.linux-

ldd $(which opusenc): gate.so.1 (0xb77ad000) libopus.so.0 => /usr/lib/i386-linux-gnu/libopus.so.0 (0xb770f000) libFLAC.so.8 => /usr/lib/i386-linux-gnu/libFLAC.so.8 (0xb76b0000) libogg.so.0 => /usr/lib/i386-linux-gnu/libogg.so.0 (0xb76a7000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb7652000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb749b000) /lib/ld-linux.so.2 (0x8005d000)

file Roxy.flac Roxy.flac: Audio file with ID3 version 2.4.0, contains: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 5937624 samples

xxd Roxy.flac | head -3 00000000: 4944 3304 0000 000d 0960 5449 5432 0000 ID3......`TIT2.. 00000010: 0015 0000 0342 616e 6e65 6420 4672 6f6d .....Banned From 00000020: 2074 6865 2052 6f78 7954 5045 3100 0000 the RoxyTPE1...

opusenc Roxy.flac out.opus Error parsing input file: Roxy.flac

thank you for the help

mark4o commented 7 years ago

Ah, your file has ID3 headers on FLAC. opusenc does not support that. opusenc does support standard FLAC metadata. Normally ID3 is used with MP3 and some other formats that don't have their own standard for metadata.

sigma001 commented 7 years ago

ah, never had problems with that. Thank you very much

vlakoff commented 6 years ago

On a related note, I just tried the official Windows binaries (at this time, opus-tools-0.1.10-win64.zip and opus-tools-test-1.3-rc.zip), and they don't support FLAC input. Same with the RareWares builds.

This would be very, very convenient, as it would let me convert my FLAC library to Opus for portable player, in one step, while keeping the metadata.

omeletteo commented 6 years ago

Hi. I'm trying to encode ogg->opus, ogg files having been produced using 'Sound Converter', and am getting the same "Error parsing..." error. The output from the above commands are as follows;

opusenc --help | grep AIFF It can read the WAV, AIFF, FLAC, Ogg/FLAC, or raw files.

ldd $(which opusenc) linux-gate.so.1 => (0xb774c000) libopus.so.0 => /usr/lib/i386-linux-gnu/libopus.so.0 (0xb76d2000) libFLAC.so.8 => /usr/lib/i386-linux-gnu/libFLAC.so.8 (0xb769e000) libogg.so.0 => /usr/lib/i386-linux-gnu/libogg.so.0 (0xb7695000) libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb764f000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb749e000) /lib/ld-linux.so.2 (0xb774e000)

file SSTAE-01.ogg SSTAE-01.ogg: Ogg data, Vorbis audio, mono, 24000 Hz, ~45111 bps

xxd SSTAE-01.ogg | head -3 0000000: 4f67 6753 0002 0000 0000 0000 0000 987d OggS...........} 0000010: 1a40 0000 0000 51f0 a873 011e 0176 6f72 .@....Q..s...vor 0000020: 6269 7300 0000 0001 c05d 0000 0000 0000 bis......]......

opusenc SSTAE-01.ogg test.opus Error parsing input file: SSTAE-01.ogg

I'm curious as to what is causing the error. Can anyone help?

mark4o commented 5 years ago

@omeletteo opusenc can read uncompressed and lossless formats WAV, AIFF, FLAC, Ogg/FLAC, or raw PCM. Your input file is Ogg Vorbis, which is another lossy format. If you want to convert Ogg Vorbis to Opus then you'll need to decode the Ogg Vorbis file first, using another program such as oggdec, and then encode that with opusenc. However if you have the original uncompressed or lossless version then it is better to start with that.