[FFmpeg-user] Can I use ffmpeg to combine audio streams in .ts file?

Anatol anatol2002 at gmail.com
Tue Sep 30 15:12:45 CEST 2014


ffmpeg -i SOURCE.mov -i LOGO.png -c:v libx264  -subq 7 -qcomp 0.6 -qmin 10
-qmax 50 -qdiff 4 -bf 16 -coder 1 -refs 6 -x264opts
b-pyramid:weightb:mixed-refs:8x8dct:no-fast-pskip=0:nal-hrd=cbr -vprofile
high -force_key_frames expr:'gte(t,n_forced*2)' -pix_fmt yuv420p -b:v 550k
-s 640x360 -r 29.97 -g 60 -filter_complex
'[0:v][1:v]overlay=main_w-overlay_w-100:10' -c:a libfdk_aac -b:a 64k -ar
44100 -ac 2 -filter_complex
'[0:1][0:2]amix=inputs=2[aflt];[aflt]aresample=async=1:min_hard_comp=0.100000:first_pts=0'
-map_chapters -1 -map_metadata -1  -f mp4 -flags +loop+mv4 -cmp 256
-partitions +parti4x4+partp8x8+partb8x8 -trellis 1 -refs 1 -me_range 16
-keyint_min 20 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 600k
-bufsize 1200k -rc_eq 'blurCplx^(1-qComp)' -level 30  -vsync 1 OUTPUT.mp4

Sample 'real-life' command line with 'filter_complex' for mixing audio
streams and adding burned-in logo ...

On Tue, Sep 30, 2014 at 3:49 PM, <skyscanner at gmx.ca> wrote:

>
> On Tue, 30 Sep 2014 10:45:37 +0200, barsnick at gmx.net wrote:
>
> > Since you have already built an understanding of what you want to
> > combine in which way, this page should give you some hints and examples
> > of how to achieve that:
>
> > https://trac.ffmpeg.org/wiki/AudioChannelManipulation
>
> > Note that it goes beyond pure mapping, using e.g. the amerge and pan
> > filters.
>
> Thank you, but I actually found that page a couple of days ago and it was
> not at all helpful to me for a couple of reasons. First, I am REALLY new to
> ffmpeg and don't yet understand how all the options work and interrelate,
> in fact I have the nagging feeling that the way I did use the options was
> probably not the best way, but ffmpeg is a VERY complex program and it's
> hard to figure out the "correct" way to do something like this.
>
> But also, all of the examples on that page are for a single stream. Every
> single example only mentions "stream 0" - there is no reference anywhere to
> a "stream 1", "stream 2", etc. That is why I am beginning to wonder if
> ffmpeg even has the capability to merge streams. I have looked at a lot of
> pages on ffmpeg, some of which make some sense to me and many which didn't,
> but the common thread is that I could not find a single example anywhere of
> multiple streams being mixed down to a single stream or to fewer streams.
> The channel mapping is only a secondary concern to me and it's not going to
> bother me that much if I never get true 5.1, but not being able able to
> hear all the audio is the big issue now.
>
> Also that page seems to be dealing with audio files only, not video, and
> even in the example for "2 × stereo → stereo" is talking about starting
> with two .wav files and converting them to a single .mp3 file. Once again,
> nothing at all is said about merging multiple audio streams from the same
> .ts file. So if you know of any examples of merging audio streams in files
> with video and audio present, that's what I really need to see right now.
>
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list