0

Hi all I just installed ffmpeg and I'm quite new to it. managed to combine/merge audio and video file, but now I want to combine 2 audio files and one video into one output file. audio files are: .wav video file is: .flv output is: .flv

currently i have this code, what should I add to it:

system("$ffmpegpath -i audio1.wav -i audio2.wav -i video1.flv -y output.flv");

thank you!

Emii Khaos
  • 9,983
  • 3
  • 34
  • 57
bboy
  • 1,357
  • 2
  • 15
  • 31
  • do you get the solution?? – Ahmad Arslan Jul 09 '14 at 06:42
  • hi, to be honest this is a pretty old issue and we didn't get any help. we managed to make it work somehow, but surely not with 2 audio files combined. 1 video + 1 audio. I'll try to get a hold of the files and get back to you. – bboy Jul 09 '14 at 08:11
  • Okay Thanks.. I am trying it more if I am able to get the solution I will share my answer. – Ahmad Arslan Jul 09 '14 at 09:13
  • check out my answer and let me know if it works, maybe I can help – bboy Jul 10 '14 at 17:41

3 Answers3

0

I think you have to use the option -map. Read this link, How to encode multi audio streams with different options at the same time with ffmpeg

Example:

ffmpeg -i merged-vobs.mpeg -map 0:0 -s 640x368 -f ogg -vcodec libtheora -r 25 -b:v 1200k -metadata:s:v:0 title= "Video Title" -acodec libvorbis -ar 48000 -map 0:1 -ac:a:0 6 -b:a:0 192k -metadata:s:a:0 title="Track1 Title" -map 0:4 -ac:a:1 2 -b:a:1 96k -metadata:s:a:1 title="Track2 Title" -async 1 -pass 2 -passlogfile "outputlog" "output.ogv"
Álvaro
  • 2,872
  • 4
  • 20
  • 25
  • Thank you @Álvaro! I will give it a try and get back here. – bboy May 08 '12 at 10:37
  • is this work?? I am trying using this but bnot works: FFMPEG command work fine in the log but didt find the result any hekp ffmpeg -i file1.mp3 -i file2.mp3 mix.mp4 -map 0:0 -map 1:0 -newaudio – Ahmad Arslan Jul 09 '14 at 06:38
0
 ffmpeg -i file1.mp3 -i file2.mp3 mix.mp4 -map 0:0 -map 1:0 -newaudio 
Ahmad Arslan
  • 4,498
  • 8
  • 38
  • 59
0

found the project and this is my solution to it:

<?php
    $ffmpegpath = "ffmpeg.exe"; /////ffmpeg.exe path, I have it in the same folder
    $videoFile = "videoplayback.flv";
    $audioFile = "comment.wav";
    $targetVideo = "output.flv";

    //
    system("$ffmpegpath -i $audioFile -i $videoFile -y $targetVideo");
?>

let me know if it helps!

bboy
  • 1,357
  • 2
  • 15
  • 31
  • I am trying to develop for android 2 audio files which merge into one. Can you tell me whats the command for the ffmeg library? – Ahmad Arslan Jul 11 '14 at 06:26
  • 1
    possible to find your answer here: http://stackoverflow.com/questions/14498539/how-to-overlay-two-audio-files-using-ffmpeg or read here: https://trac.ffmpeg.org/wiki/How%20to%20concatenate%20(join,%20merge)%20media%20files – bboy Jul 11 '14 at 06:54