Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Converting a 5.1 audio source into a stereo one (Read 4990 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Converting a 5.1 audio source into a stereo one

Hello!
I'm trying to create an automated script (in BASH) in order to convert videos for my Android device, which supports video x264 (800x480) and audio AAC (stereo only).

The script by far converts via ffmpeg the entire film into a 800x480 video with the original audio (converted in case in AAC if it isn't). I'm not "stereo-ing" it in the first step because I want to have at least a converted "working" video+audio file (the original ones may be of several GBs).

Now: I can't downmix directly via ffmpeg 'cause it doesn't support this feature atm, and the problem is that I tried to use FAAD2 to separately downmix the channels, but it fails: it converts the audio stream into a stereo file, but it misses the channels to mix. I hear the voices on my right and the environment on the left (thus I think the channels are mixed front => right and back => left). There are no options in faad2 to select the channels, so I'm a little bit confused. How can I correctly downmix the channels?

I have to downmix from the converted video file, because it's not sure the source is in AAC (ofc).

Any help would be appreciated

Thanks

Converting a 5.1 audio source into a stereo one

Reply #1
Quote
I can't downmix directly via ffmpeg 'cause it doesn't support this feature atm



for me works...

Code: [Select]
ffmpeg.exe -i sample.vob -vn -acodec libfaac -ac 2 -ab 128k audio_stereo.mp4

_

Converting a 5.1 audio source into a stereo one

Reply #2
You might try Handbrake.  It seems to be what "everybody uses" to make H.264 files for the iPod.

Here's the Handbrake Surround Sound Guide[/color].


Converting a 5.1 audio source into a stereo one

Reply #3
Thanks you both!
@DVDdoug: I prefere a bash script with no GUI because of no needing of a desktop environment

I've noticed that the converted video has the front/back issue just using the libfaac codec. The original audio is in two different formats, dca and ac3. I've tried converting thus the original audio directly in aac or MP3, but it seems to have a bad distortion (like a metallic sound... weird)...

Code: [Select]
ffmpeg -i MyVideo.mkv
FFmpeg version 0.5.1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --prefix=/opt/local --disable-vhook --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-avfilter-lavf --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac --enable-libfaad --enable-libxvid --enable-libx264 --enable-nonfree --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    1. 4. 0 /  1. 4. 0
  libswscale     1. 7. 1 /  1. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on May 17 2010 19:18:13, gcc: 4.2.1 (Apple Inc. build 5659)

Seems stream 0 codec frame rate differs from container frame rate: 47.95 (48000/1001) -> 23.98 (24000/1001)
Input #0, matroska, from 'MyVideo.mkv':
  Duration: 02:41:41.72, start: 0.000000, bitrate: N/A
    Stream #0.0(ita): Video: h264, yuv420p, 1920x1080, PAR 1:1 DAR 16:9, 23.98 tbr, 1k tbn, 47.95 tbc
    Stream #0.1(ita): Audio: dca, 48000 Hz, 5.1, s16
    Stream #0.2(ita): Subtitle: 0x0000
    Stream #0.3(ita): Subtitle: 0x0000
    Stream #0.4(ita): Audio: ac3, 48000 Hz, 5.1, s16
At least one output file must be specified


I don't know what dca is, but on VLC the AC3 track works great...

Converting a 5.1 audio source into a stereo one

Reply #4
dca is for DTS...use "-map" command to select the desired audio track...
_