mix audio with h264 mp4 video with ffmpeg

4

I have 2 files :

Input #0, wav, from '105426_1.wav':
  Duration: 00:00:09.98, bitrate: 1312 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 41000 Hz, stereo, s16, 1312 kb/s

and:

Duration: 00:00:41.29, start: 0.000000, bitrate: 1313 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 1211 kb/s, 24.42 fps, 25 tbr, 90k tbn, 48 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 99 kb/s
    Metadata:
      handler_name    : SoundHandler

I want to insert first audio file into video in special place (for example in 10 secunde of video) and mix it with audio stream of video file.

I try to

 /usr/local/bin/ffmpeg  -i 105426_1.wav -i 105426.mp4 -map 0:0 -map 1:1 -map 1:0  video_finale.mp4

but result is :

  Duration: 00:00:41.31, start: 0.046440, bitrate: 755 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 588 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler

I need only one audio stream and first stream play not from beginig but from 10 sec

user2362912

Posted 2013-05-08T15:09:33.677

Reputation:

Please show the complete ffmpeg console output that results from your ffmpeg command. – llogan – 2013-05-08T18:51:42.343

Answers

0

I think that would be strange if ffmpeg was able to do such a thing. You should demux audio stream and mix your audio into it (e.g., using audacity) then mux.

The second way, I guess, is to shift the second audio stream using the option -itsoffset, then try to play both streams simultaneously using media player with appropriate splitter (in this case I suggest to try out MPC-HC + ffdshow + Haali Media Splitter).

said

Posted 2013-05-08T15:09:33.677

Reputation: 1