IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Adjust volume while decoding to wav
Big_Berny
post May 10 2013, 11:43
Post #1





Group: Members
Posts: 242
Joined: 9-February 03
Member No.: 4921



Hi
I use the solution from subsonic.org to stream my music to my smartphone and tablet. It's really a great tool, as ypu can decide how your source files should be recoded. I recode my 256 Kbit/s AAC to 112 KBit/s AAC by using qaac with following two steps:

I use this transcoding command:
Step 1: ffmpeg -i %s -f wav -
Step 2: qaac -a %bk --adts - -o -

This works great but replaygain get's lost. Now I'm looking for a solution to change the volume when decoding the files in step 1. FLAC has this feature called "--apply-replaygain-which-is-not-lossless" which is exactly what I want (remember, it's only for streaming!). Does someone know a decoder which supports that too but for decoding aac (and possibly mp3)?

Thanks in advance!
Go to the top of the page
+Quote Post
extrabigmehdi
post May 10 2013, 12:21
Post #2





Group: Members
Posts: 408
Joined: 15-August 09
Member No.: 72330



QUOTE (Big_Berny @ May 10 2013, 11:43) *
I recode my 256 Kbit/s AAC to 112 KBit/s AAC by using qaac
[...]
. FLAC has this feature called "--apply-replaygain-which-is-not-lossless" which is exactly what I want


There's the tool xrecode, that allows a direct conversion to aac or mp3, and adjust the volume on the fly too (in a lossy way, if you wish).

This post has been edited by extrabigmehdi: May 10 2013, 12:22
Go to the top of the page
+Quote Post
lvqcl
post May 10 2013, 12:33
Post #3





Group: Developer
Posts: 3371
Joined: 2-December 07
Member No.: 49183



AFAIK OP wants streaming, not converting to a file.
Go to the top of the page
+Quote Post
phofman
post May 10 2013, 13:04
Post #4





Group: Members
Posts: 300
Joined: 14-February 12
Member No.: 97162



If you can find a command-line tool to list AAC tags, calculating the volume parameter for ffmpeg is simple http://ffmpeg.org/pipermail/ffmpeg-user/20...ary/005015.html . Since subsonic supports "scripting" the transcoding command http://www.subsonic.org/pages/transcoding.jsp , writing the scripts should not be complicated.
Go to the top of the page
+Quote Post
nu774
post May 10 2013, 13:36
Post #5





Group: Developer
Posts: 525
Joined: 22-November 10
From: Japan
Member No.: 85902



neroaactag can read and print m4a tags, but you need to use awk or something to extract the gain value for later application.
As for gain application, you can also pipe ffmpeg output to sox and use vol effect of sox. Since sox accepts dB form, you can omit dB->amplitude calculation.
Go to the top of the page
+Quote Post
Big_Berny
post May 10 2013, 14:28
Post #6





Group: Members
Posts: 242
Joined: 9-February 03
Member No.: 4921



Thanks for your help!
@exxtrabigmehdi: I need a codec/tool which supports stdout (as lvqcl mentioned) and I don't know if xrecode supports that. But I contacted the developer.

@lvqcl: Correct, thanks for pointing that out! Since xrecode can be run by commandline it's maybe possible that it supports stdout? As I said I asked the developer.

@phofman: Thanks for the link. This might be a solution. I'll try to script something as soon as I find some time.

@nu774: Thanks for that. This might be a solution too.
Go to the top of the page
+Quote Post
phofman
post May 10 2013, 15:07
Post #7





Group: Members
Posts: 300
Joined: 14-February 12
Member No.: 97162



Big_Berny, what OS do you use? I assume windows due to qaac and xrecode...
Go to the top of the page
+Quote Post
Big_Berny
post May 10 2013, 18:21
Post #8





Group: Members
Posts: 242
Joined: 9-February 03
Member No.: 4921



Yes, I use windows.
Go to the top of the page
+Quote Post
phofman
post May 10 2013, 20:34
Post #9





Group: Members
Posts: 300
Joined: 14-February 12
Member No.: 97162



I thought it would be simple - just making a named pipe in place of the file and reading the pipe to stdout of the script. Oops, no named pipes of that type in your OS huh.gif

Depending how much time and effort you want to put into solution, you might want to play with tail -f of http://sourceforge.net/projects/unxutils/ and background processes in cmd scripts http://stackoverflow.com/questions/1449188...-asynchronously .
Go to the top of the page
+Quote Post
Big_Berny
post May 11 2013, 12:41
Post #10





Group: Members
Posts: 242
Joined: 9-February 03
Member No.: 4921



Uff... Looks more complicated as I expected. So there is no easy way to script in windowS?
Go to the top of the page
+Quote Post
extrabigmehdi
post Jun 9 2013, 13:30
Post #11





Group: Members
Posts: 408
Joined: 15-August 09
Member No.: 72330



I've just noticed that xrecode now support stdout according to the changelog (well, this feature was added a month ago) . If you have other feature request, don't hesitate to contact the developper again, they are often considered.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 2nd September 2014 - 14:11