+ Reply to Thread
Results 31 to 49 of 49
Last edited by WAusJackBauer; 17th Jun 2021 at 06:37.
I'm willing to pay someone $50 if they can resolve this.
Last edited by WAusJackBauer; 21st Jun 2021 at 21:02.
Raising this to $100
Davexnet has already given you a solution in post #28. You might want to play with the coefficients to get the mix you want.
Attached is your 5.1 audio from post #8 downmixed to stereo using his coefficients. Try uploading it to youtube and see how it sounds.
Last edited by WAusJackBauer; 2nd Jul 2021 at 03:26.
Download ffmpeg. Put a copy of ffmpeg.exe in C:\Windows\System32\.
Start Notepad. Copy/Paste this text into it (slight changes from davexnet's post).
ffmpeg -i %1 -vol 420 -af "pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE" -c:v copy -b:a 224K "stereomix.mp4"
In Explorer drag/drop your video onto the batch file. In a while (depending on the length of your file) you'll have a file called stereomix.mp4.
In the ffmpeg command the "vol=420" means multiply the volume by a factor of 420/256, about 1.64.
The "pan=stereo" arguments specify how the channels should be mixed.
FC is the front center channel
FL is the front left channel
FR is the front right channel
BL is the back left channel
BR ir the back right channel
LFE is the sub channel (Low Frequency Effects)
so "FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE" means the front left channel should be a mix of:
0.5 times the front center channel
plus 0.707 times the front left channel
plus 0.707 times the back left channel
plus 0.5 * the sub channel
"FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE" does the same for the front right channel except right channels are used instead of the left.
An audio codec wasn't specified bus since ffmpeg was told to create an mp4 file it will default to aac. "-b:a 224K" tell it to use an audio bitrate of 224 Kbps.
The standard ATSC downmix is:
ffmpeg -i %1 -af "pan=stereo|FL < 1.0*FL + 0.707*FC + 0.707*BL|FR < 1.0*FR + 0.707*FC + 0.707*BR" -c:v copy -b:a 224K "stereomix.mp4"
ffmpeg -i %1 -c:v copy -ac 2 -b:a 224K "stereomix.mp4"
Some other useful information: https://superuser.com/questions/852400/properly-downmix-5-1-to-stereo-using-ffmpeg
Last edited by jagabo; 2nd Jul 2021 at 10:04.
-vol has been deprecated. Use the volume audio filter instead.
-vol is forwarded to lavfi similarly to -af volume=1.640625.
Any tips on what to do now?
That's just a warning that the "vol" argument is deprecated (it may someday stop working) and they are recommending that you switch to using the audio filter called volume instead. I guess "-af volume=1.640625" is the equivalent of "vol=420". I'm pretty sure you can switch to the volume filter like this:
ffmpeg -i %1 -af "volume=1.640625,pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE" -c:v copy -b:a 224K "stereomix.mp4"
ffmpeg -i %1 -af "pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE,volume=1.640625" -c:v copy -b:a 224K "stereomix.mp4"
I just realised, the steps that I do this in could be important.
Should I use this ffmpeg downmix on the source audio (big 2 - 3gb 5.1 DTS file) and then trim scenes and encode it the old way I normally would and it should be fine since its already been downmixed properly?
Or should I trim the scene and encode the way I normally would and then as the last step, use the ffmpeg downmix on the trimmed scene?
If you do the audio downmix first and save it as uncompressed PCM you can edit with the audio in "copy" mode so there will be no further reencoding of the audio. Or only one at the end when you output your final edit.
With ffmpeg you can save as uncompressed PCM in MOV:
ffmpeg -i %1 -af "pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE,volume=1.640625" -c:v copy -c:a pcm_s16le "stereomix.mov"
A/V editors usually have a "copy" mode for the audio. In VirtualDub it's selected with Audio -> Direct Stream Copy (it's the default). Or you can just set the editor to output uncompressed PCM -- that's essentially a "copy".
I just realised though, the volume=1.640625 is essentially amplifying the audio. So isn't this what's making my volume louder rather than the downmixing to stereo?
I believe Youtube supports 5.1 so couldn't I just keep it at 5.1 and use volume=1.640625 by itself if ffmpeg allows it? That way people with 5.1 setups can enjoy true 5.1 sound?
Last edited by WAusJackBauer; 28th Sep 2021 at 11:25.
You'll have to try both. I suspect the way youtube downmixes 5.1 may reduce the overall volume. So downmixing yourself may work better.
Last edited by WAusJackBauer; 5th Oct 2021 at 01:40.
What's your entire command line? What container did you use? MP4 doesn't support PCM. Use MOV or MKV instead.
I'm back again lol. Long story short, I have a stereo source file but it's still slightly quiet when uploading to youtube. What would be the command line in ffmpeg to only increase the volume?
Would it be ffmpeg -i "volume=1.3" -c:v copy -c:a pcm_s16le "stereomix new.mov"