PDA

View Full Version : Combine Multiple Audio Tracks


dcargol
03-14-2008, 07:25 PM
Hi forgive me if this has been addressed before (I couldn't find it). I have a bunch of .mov files that are made up of a bunch of joined .mov files that I am trying to encode. The joining process produced a file with a bunch of parallel audio tracks instead of merging them. They are spaced appropriately so if you watch the .mov file in quicktime it sounds right. If you're wondering I want to encode one of my VTC cd's to watch on my ipone (yes I own the $90 CD set). I have seen a lot of posts on how to choose which audio track to map, but what if I want it to use all of them. Right now it just encodes the first one and the rest of the resulting movie is silent. Are there any switches I can use to flatten the audio stack? Any help is much appreciated! See the dump below

VideoInfo Tool 3.1
(C) 2007 Red Kawa Inc.
http://www.redkawa.com

64-bit Windows Detected
MediaInfoLib - v0.7.5.2

Container=qt
FileSize=93.5 MiB
VideoCodec=smc
VideoPlayTime=01:57:10.718
VideoBitrate=17 Kbps
VideoWidth=640
VideoHeight=480
VideoAspectRatio=1.333
VideoFrameRate=5.000
VideoFrameCount=35156
AudioCodec=ima4AudioCodec=ima4AudioCodec=ima4Audio Codec=ima4AudioCodec=ima4AudioCodec=ima4AudioCodec =ima4
AudioBitrate=176 KbpsAudioBitrate=176 KbpsAudioBitrate=176 KbpsAudioBitrate=176 KbpsAudioBitrate=176 KbpsAudioBitrate=176 KbpsAudioBitrate=176 Kbps
AudioMode=AudioMode=AudioMode=AudioMode=AudioMode= AudioMode=AudioMode=
AudioChannels=1AudioChannels=1AudioChannels=1Audio Channels=1AudioChannels=1AudioChannels=1AudioChann els=1
AudioSamplingRate=22050AudioSamplingRate=22050Audi oSamplingRate=22050AudioSamplingRate=22050AudioSam plingRate=22050AudioSamplingRate=22050AudioSamplin gRate=22050

DONE
MSG - OS - Version: Microsoft Windows NT 6.0.6000.0
MSG - Converter - Version: 3.07
MSG - Converter - Device: iPhone_1G
MSG - Converter - Profile: Good Mono
MSG - VideoInfo - Length: 7030s
MSG - VideoInfo - Width: 640 pixels
MSG - VideoInfo - Height: 480 pixels
MSG - VideoInfo - Aspect Ratio: 1.333
MSG - VideoInfo - Framerate: 5 fps
MSG - VideoInfo - Frame Count: 35156
MSG - Converter - Automatically Generating Framerate
EXEC: C:\Program Files (x86)\Red Kawa\Video Converter 3\Tools\FFmpeg\ffmpeg.exe -y -i "C:\DVD-Rips\C Programming\03\03.mov" -an -pass 1 -f mp4 -title "03" -timestamp "2008-03-14 04:01:35" -vcodec libx264 -level 30 -b 1500k -bt 1500k -bufsize 2000k -maxrate 768k -g 250 -coder 0 -flags +loop -cmp +chroma -partitions 0 -me umh -subq 1 -trellis 0 -refs 1 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq "blurCplx^(1-qComp)" -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -threads auto "C:\Users\ZZ\Documents\Converted Videos\03.mp4"

FFmpeg version Sherpya-r11050, Copyright (c) 2000-2007 Fabrice Bellard, et al.
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 51.19.0
built on Nov 18 2007 09:00:58, gcc: 4.2.1 [Sherpya]

Seems stream 0 codec frame rate differs from container frame rate: 600.00 (600/1) -> 5.00 (5/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\DVD-Rips\C Programming\03\03.mov':
Duration: 01:57:10.7, start: 0.000000, bitrate: 111 kb/s
Stream #0.0(eng): Video: smc, pal8, 640x480 [PAR 0:1 DAR 0:1], 5.00 tb(r)
Stream #0.1(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.2(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.3(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.4(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.5(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.6(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.7(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Output #0, mp4, to 'C:\Users\ZZ\Documents\Converted Videos\03.mp4':
Stream #0.0(eng): Video: libx264, yuv420p, 640x480 [PAR 0:1 DAR 0:1], q=10-51, pass 1, 1500 kb/s, 5.00 tb(c)
Stream mapping:
Stream #0.0 -> #0.0
[libx264 @ 00A50410]using cpu capabilities: MMX MMXEXT SSE SSE2 SSSE3
[libx264 @ 00A50410]max bitrate less than average bitrate, ignored.
Press [q] to stop encoding
frame= 31 fps= 0 q=10.0 size= 63kB time=5.2 bitrate= 99.5kbits/s

dcargol
03-14-2008, 07:38 PM
FFmpeg version Sherpya-r11050, Copyright (c) 2000-2007 Fabrice Bellard, et al.
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 51.19.0
built on Nov 18 2007 09:00:58, gcc: 4.2.1 [Sherpya]

Seems stream 0 codec frame rate differs from container frame rate: 600.00 (600/1) -> 5.00 (5/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\DVD-Rips\C Programming\03\03.mov':
Duration: 01:57:10.7, start: 0.000000, bitrate: 111 kb/s
Stream #0.0(eng): Video: smc, pal8, 640x480 [PAR 0:1 DAR 0:1], 5.00 tb(r)
Stream #0.1(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.2(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.3(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.4(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.5(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.6(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Stream #0.7(eng): Audio: adpcm_ima_qt, 22050 Hz, mono
Output #0, mp4, to 'C:\Users\ZZ\Documents\Converted Videos\03.mp4':
Stream #0.0(eng): Video: libx264, yuv420p, 640x480 [PAR 0:1 DAR 0:1], q=10-51, pass 2, 1500 kb/s, 5.00 tb(c)
Stream #0.1(eng): Audio: libfaac, 22050 Hz, mono, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
[libx264 @ 00A50410]using cpu capabilities: MMX MMXEXT SSE SSE2 SSSE3
[libx264 @ 00A50410]max bitrate less than average bitrate, ignored.
[libx264 @ 00A50410]Error: 2pass curve failed to converge
[libx264 @ 00A50410]target: 1500.00 kbit/s, expected: 35.44 kbit/s, avg QP: 10.0001
[libx264 @ 00A50410]try reducing target bitrate or reducing qp_min (currently 10)
Press [q] to stop encoding
frame= 33 fps= 0 q=10.0 size= 93kB time=5.6 bitrate= 136.3kbits/s
frame= 66 fps= 65 q=10.0 size= 140kB time=12.2 bitrate= 94.3kbits/s

dcargol
03-15-2008, 06:57 AM
Ok after trying various -map and -newaudio solutions didn't work (maybe somebody better with ffmpeg can help me out?). I found a different way around this problem by exporting the audio from quicktime as an .aif file, deleted all of the tracks from the .mov and then reinserted the .aif audio into the movie. Works great except quictime dosn't actually insert the audio into the file, it creates some kind of strange link between the two files (why can't apple do anything the way one would expect). Regardless as long as the .aif and .mov file are in the same location the movie plays fine so I tried to encode it. It seems to work (console output looks fine, it finds the audio stream, uses the appropriate decoder and maps it correctly to the output. however when I go to play back the newly encoded movie the audio is barely audible and there is a loud irregular pulsing white-noise um noise. I have tried converting the audio to a wav file (lin PCM) and using that which results in the audio being incredibly fast and accompanied by a high pitched ringing. The encoder did pick the right decoder for the audio, whichever format I put it in (That weird quicktime link between files must work.) I just can't get the audio to come out sounding right. It is not just static; I can hear the audio track barely behind all of the noise. Interestingly one of the side-effects of using a .wav or .au export from quicktime is that the encoding quits after it runs out of audio data so a 30 min lecture ends up being like 5 mins or chipmunks and pulsing noise. The .aiff file seems to keep the time correct (no chipmunks) just lots of white noise added to the track.

I know people are going to immediately shout "chipmunk problem.. Check mono to stereo conversion... remember to hit save!!!!!!" but that is not the source of the problem from what I can tell.

Is there any solution to either merge all audio streams to one output in videora or fix the noise problem that shows up in conversions of the linked .mov files? Any ideas are much appreciated.