HydrogenAudio

Lossless Audio Compression => WavPack => Topic started by: BearcatSandor on 2012-05-31 23:08:10

Title: Wavpack hybrid rate playback and sweet spot?
Post by: BearcatSandor on 2012-05-31 23:08:10
I have my music collection ripped to wavpack lossless.  I just got myself an Android (Galaxy Note for what it matters) and found the Neutron player which plays wavpack very nicely. Now, i want to move some wavpack files to my android and i have all these large lossless wavpack files.  I'd like to convert them to hybrid files with correction.  The wavpack site states the following about the -c option:

"When WvUnpack is used to restore the .wav file, it will attempt to find the .wvc file in the same directory as the .wv file. If it is found then the decompression will be lossless and will be reported as such, otherwise lossy decompression will be reported (assuming that any information was actually discarded during the original compression)"

1) That tells me that the correction file is used when wvunpack is done. I thought that i could keep the wv and wvc files on my pc for lossless playback and just move the wv files over to the android for lossy playback. Is this so?

2) I've seen some threads of people using -b5 for lossy. The manpage for -bn states a range of 2.0 - 23.9 so that seems really low.  Where is the sweet spot as far as the -bn switch that will not produce any artifacts and still remain portable? I know it's a "depends" question (and i'm avoiding talk of subjective sound quality here) but what are you folks using as command lines for this purpose?

3) I'll be writing a bash script to process all these files (about 10k or so). I assume it's not possible to convert wavpack lossless directly to lossy. I'll have to unpack them to wav and then repack them to wavpack hybrid and reapply all tags. Right?

Thanks all, and thank you Bryant for an awsome file type!
Title: Wavpack hybrid rate playback and sweet spot?
Post by: db1989 on 2012-05-31 23:13:51
1) That tells me that the correction file is used when wvunpack is done. I thought that i could keep the wv and wvc files on my pc for lossless playback and just move the wv files over to the android for lossy playback. Is this so?
Right on!

Quote
3) I'll be writing a bash script to process all these files (about 10k or so). I assume it's not possible to convert wavpack lossless directly to lossy. I'll have to unpack them to wav and then repack them to wavpack hybrid and reapply all tags. Right?
I think you’re correct that there is no way to ‘peel’ fully lossless files to lossy+correction, short of de/re-encoding. From there, if you have access to Windows, maybe this will help: http://www.hydrogenaudio.org/forums/index....showtopic=83294 (http://www.hydrogenaudio.org/forums/index.php?showtopic=83294)
Title: Wavpack hybrid rate playback and sweet spot?
Post by: BearcatSandor on 2012-06-01 00:26:14
Copytags, huh? I'll check that out. Thank you. I might be able to run it under Wine.  As to the first part i think i posed the question in a confusing manner.  What i meant was: Can i leave the wv files and wvc files on my pc and get lossless *playback* on it, and just move the wv files over to the android for lossy playback. The website *seems* to suggest that the wcv file is used when decoding back to wav and not for playback.
Title: Wavpack hybrid rate playback and sweet spot?
Post by: shadowking on 2012-06-01 03:21:03
I would start with -b4 and try to avoid high modes. I think thats the sweetspot.

Generally, -b4x is fast works well. If you have more time, for more security:  -b4x4.. If space isn't a big concern :  -b5x


Title: Wavpack hybrid rate playback and sweet spot?
Post by: bryant on 2012-06-01 04:59:45
Regarding PC playback and correction files, see here (http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=94749&view=findpost&p=794375).

I agree with shadowking on the use of -b that 4 bits per sample is the sweet spot and you'll probably never hear any artifact. The parameter goes up to [almost] 24 bits, but that's just for completeness...anything over 5.0 is kind of silly, especially with a correction file (the idea is that if you have the correction files somewhere, you might be a little more tolerant of an occasional benign artifact on the portable).

I actually use 384 kbps (which is the equivalent to -b4.35) for archiving stuff in pure lossy mode (no correction file) and have never been sorry.

Title: Wavpack hybrid rate playback and sweet spot?
Post by: BearcatSandor on 2012-06-01 08:48:23
Thanks again Bryant, i'll take your advice and use around 4-5.

(to the forum i apologise for asking the same question twice in the same month. I've been exhausted lately and forgot i'd read that)
Title: Wavpack hybrid rate playback and sweet spot?
Post by: skamp on 2012-06-01 09:54:32
3) I'll be writing a bash script to process all these files (about 10k or so). I assume it's not possible to convert wavpack lossless directly to lossy. I'll have to unpack them to wav and then repack them to wavpack hybrid and reapply all tags. Right?


caudec (http://caudec.googlecode.com/) can do that for you if you're running linux:
Code: [Select]
$ caudec -c wvh -q hx1 -b 384 /data/music/artist/album/*.wv


That command will transcode your WavPack files to WavPack Hybrid at 384 kbps with correction files, in parallel (if you have a multi-core CPU and enough RAM), while copying all the tags over. Currently there's a limitation
Title: Wavpack hybrid rate playback and sweet spot?
Post by: BearcatSandor on 2012-06-07 08:47:33
Thanks. Caudec looks great and i'm working with your example script that you cited to create my own script. However, testing it on one directory i'm seeing:

2 ER 01-rain_on_the_scarecrow.wv
4 ER 03-small_town.wv
3 OK 02-grandma's_theme.wv
1 ER 04-minutes_to_memories.wv
2 ER 05-lonely_ol'_night.wv
4 ER 06-the_face_of_the_nation.wv
3 ER 07-justice_and_independence_'85.wv
1 ER 08-between_a_laugh_and_a_tear.wv
2 ER 09-rumbleseat.wv
3 ER 11-r.o.c.k._in_the_u.s.a._a_salute_to_60's_rock.wv
1 ER 12-the_kind_of_fella_i_am.wv
4 OK 10-you've_got_to_stand_for_somethin.wv

How do i determine what the errors were so i can fix them? Prowling around the wiki and help file i don't see the definition of those codes.

Here's the script:

Code: [Select]
find * -type f -name '*.wv' -exec dirname '{}' ';' | sort -u | while read d;
do
    echo "$d"
    mkdir -p "/mnt/backup/tmp/audio/${d}/artwork"
    cp -a "$d"/*.{jpg,png,gif} "/mnt/backup/tmp/audio/${d}"
    cp -a "$d"/artwork/*.{jpg,png,gif} "/mnt/backup/tmp/audio/${d}"/artwork/
    caudec -o "/mnt/backup/tmp/audio/${d}"  -c wvh -q hx1 -b 384 "$d"/*.wv
done


Thanks!

note: it's not creating the directories correctly, but i'm not asking for help with script debugging. I know this isn't the forum for that.
Title: Wavpack hybrid rate playback and sweet spot?
Post by: skamp on 2012-06-07 09:16:14
Those aren't error codes: the number is just the number of the process, and "ER" simply means an error occured while encoding ("DC" would mean an error occured while decoding).

One limitation caudec has, is that it doesn't work on files that have tag entries that span multiple lines (https://code.google.com/p/caudec/issues/detail?id=1).
If that's not the case with the files that are causing errors, could you please upload one of them somewhere (Dropbox or whatever) and PM me the URL?

Edit: the multiline bug occurs when transcoding from FLAC to FLAC and WavPack to WavPack. A quick fix is available in svn, which prevents caudec from failing, but multiline tags are still not copied over properly.
Title: Wavpack hybrid rate playback and sweet spot?
Post by: skamp on 2012-06-07 09:19:26
note: it's not creating the directories correctly, but i'm not asking for help with script debugging. I know this isn't the forum for that.


Swing by #hydrogenaudio on Freenode (IRC), I can help you with that. I might not be immediately available during the next couple of days though.
Title: Wavpack hybrid rate playback and sweet spot?
Post by: skamp on 2012-06-07 18:18:16
I don't know if that was your problem, but the multi-line bug should be fixed in svn, though I need to do some more testing to make sure. You can get the latest svn revision with the following command:
Code: [Select]
svn checkout http://caudec.googlecode.com/svn/trunk/ caudec-read-only
Title: Wavpack hybrid rate playback and sweet spot?
Post by: BearcatSandor on 2012-06-07 20:28:19
I removed the lyrics (multiline) tags from these files and still get the same error, even with your svn version. I'll PM you with more info.  Thanks for all the help!
Title: Wavpack hybrid rate playback and sweet spot?
Post by: shadowking on 2012-09-28 10:13:04
I did some more tests lately. I actually find bps in increments of 0.5 more convenient over MPEG bitrates. -b3..3.5..4..4.5  are very useful options when wanting to adjust quality . Bitrates are : 270..310..350..390

Using very high compression settings allow one to use much lower bitrate. I tried -hhx5 and had good results on critical samples using -b3.5 . -b3 was inferior but is expected to perform well when not caring for such samples.

Also the -l switch is pretty useful as it runs wavpack in low priority if you want a slow setting.
Title: Wavpack hybrid rate playback and sweet spot?
Post by: shadowking on 2015-12-05 12:18:37
This is something to consider if using hybrid LOSSLESS mode on the PC / notebook. The most dramatic increases are from 200k ~ 300k.  For portable playback you may face a dilemma. Going too high (384 + k) you will enter a gray area between lossy and lossless compression and the portability aspect can diminish somewhat. Going too 'low' <=250k may diminish quality for some listeners.  300k IMO presents a spot where filesize is still comparable to typical 256~320 encodings and quality is usually perfect on normal music like the other encoders.  Also quality / compression can be improved without affecting decoding speed using: -b300x4c
Title: Wavpack hybrid rate playback and sweet spot?
Post by: DARcode on 2015-12-25 08:58:10
When we have David and shadowking talking about WV lossy you know I have to chime in ;-] .

I don't have their champagne hearing, but following their advice both I've been super happy with -b384hx6c both at home on PC/media player and out and about on DAP/Android smartphone for years.