LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2015, 10:59 PM   #1
davidvNY
LQ Newbie
 
Registered: Apr 2015
Posts: 25

Rep: Reputation: 0
Using ffmpeg to fade in audio, BUT original audio from video is gone


Hi

I am trying to fade in audio at 39 seconds into the video with existing audio.

It did work, the mp3 file fades in at 39 seconds, however the original audio from the video is silence or removed.

Here is the code I've use.

Code:
ffmpeg -i audio.mp3 -i test.mp4 -c:v copy -strict experimental -shortest -af 'afade=t=in:st=39' test.mp4
How can I fix this? Thanks
 
Old 05-21-2015, 04:15 AM   #2
fsLeg
Member
 
Registered: Dec 2013
Location: Russia, Moscow
Distribution: Slackware, Debian
Posts: 81

Rep: Reputation: Disabled
ffmpeg doesn't merge streams. You specified two input files, so ffmpeg took the first audio track from the audio file and the first video track from the video file. In order to merge two audio tracks you should use some audio editor, like audacity.

If you want the output file to have two audio tracks, use `-map` option, that'll look something like this:
Code:
-map 0:0 -map 1:0 -map 1:1
That'll tell ffmpeg to use the first stream from the first input file and the first two streams from the second input file. Otherwise by default ffmpeg uses one video and one audio track.
 
Old 05-21-2015, 03:50 PM   #3
davidvNY
LQ Newbie
 
Registered: Apr 2015
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by fsLeg View Post
ffmpeg doesn't merge streams. You specified two input files, so ffmpeg took the first audio track from the audio file and the first video track from the video file. In order to merge two audio tracks you should use some audio editor, like audacity.

If you want the output file to have two audio tracks, use `-map` option, that'll look something like this:
Code:
-map 0:0 -map 1:0 -map 1:1
That'll tell ffmpeg to use the first stream from the first input file and the first two streams from the second input file. Otherwise by default ffmpeg uses one video and one audio track.
It didn't work...

I even tried the melt command doing a google search.

I decided to use kdenlive to mix the video and the audio. I appreciate the suggestion above. Thaanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ffmpeg audio/video sync issues earthw0rmjim Linux - Software 3 12-04-2013 08:20 AM
FFmpeg - Replace Audio With Audio From Another Video golmschenk Linux - Software 1 10-17-2012 03:10 PM
ffmpeg mixing audio/video - trying to end vid after video stream completes joejoe99 Linux - Software 2 06-22-2012 12:44 AM
Using FFmpeg to record from TV Card - Video is OK but no audio linux-freak Linux - General 1 01-07-2012 01:55 PM
ffmpeg grabbing audio and video glvorange Linux - Newbie 2 10-01-2011 10:56 AM


All times are GMT -5. The time now is 02:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration