Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
25th July 2011, 15:45 | #1 | Link |
Registered User
Join Date: May 2007
Posts: 9
|
ffmpeg syntax
Hi,
I am trying to use ffmpeg to remux a transport stream into a mkv with only the video track, and a separate ac3. I can't find the correct syntax, it always assumes the mkv must have an audio track. I have tried -an to disable audio processing in the mkv and then -newaudio to create the new ac3, and also tried manual mapping of tracks, but can't find any combination that works. Can anyone help? ffmpeg -i input.ts -vcodec copy video.mkv -acodec copy audio.ac3 - this produces a mkv with both audio and video and a separate ac3 ffmpeg -i input.ts -vcodec copy -an video.mkv -acodec copy audio.ac3 - this will not make the audio as audio has been disabled globally ffmpeg -i input.ts -vcodec copy -an video.mkv -acodec copy audio.ac3 -newaudio - this does the same as example 1 ffmpeg -i input.ts -vcodec copy video.mkv -acodec copy audio.ac3 -map 0.0 -map 0.1 - this complains that number of stream maps does not match number of output streams as it is assuming the mkv has two streams |
4th August 2011, 04:30 | #4 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
from near incessant googling, i'm coming to the conclusion that there's actually nobody on the internet (ffmpeg/libav devs included) that know how to use ffmpeg and are willing to share their knowledge.
the man pages are absolutely woeful. the guides out there usually only handle the case of transcoding low res crap into avi with mp3 audio... now, this rant is not completely self-indulgent. i'll post any command lines that expand on what's out there as i find them. i think, with the ffmpeg/libav schism, whoever comes up with usable docs first will be the one adopted by the community.
__________________
sucking the life out of your videos since 2004 |
13th August 2011, 08:31 | #5 | Link | |
Registered User
Join Date: Jun 2011
Posts: 7
|
What's the problem?
Quote:
|
|
13th August 2011, 08:32 | #6 | Link | |
Registered User
Join Date: Jun 2011
Posts: 7
|
Quote:
Last edited by blis; 13th August 2011 at 08:36. |
|
24th August 2011, 13:02 | #7 | Link |
Registered User
Join Date: Feb 2002
Location: Borås, Sweden
Posts: 492
|
The number of input streams must match the number of output streams. With -map you select the input streams you want to use for your output.
First test your input stream to find out the stream mapping: Code:
ffmpeg -i input.ts The ac3 file is just one single stream so it should be stream #1.0 (the fist input file includes streams 0.x and second inout 1.x and so on) So maybe something like this will select video stream from first file and audio stream form second file: Code:
ffmpeg -i input.ts -i audio.ac3 -map 0:0 -map 1:0 -vcodec copy -acodec copy output.mkv Code:
ffmpeg -i input.ts -i audio.ac3 -map 0:0 -map 0:1 -map 1:0 -vcodec copy -acodec copy output.mkv Perhaps you need -acodec copy two times when dealing with two audio streams. Do some tests and see what happens.
__________________
Ronny Last edited by ronnylov; 24th August 2011 at 13:05. |
2nd September 2011, 04:27 | #8 | Link | |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
Quote:
it's very difficult penetrating the manuals - i almost always resort to opening a terminal and just spamming it with every combination i can think of until either it works or i conclude (possibly erroneously) that ffmpeg is unable to do it. avconv's new syntax looks promising, and also helped me infer some of the mysteries of ffmpeg's syntax. my gripe is that people who know ffmpeg intimately (such as yourself) seem unable to communicate their knowledge. you could prove me wrong by solving the OP's problem, though.
__________________
sucking the life out of your videos since 2004 |
|
6th September 2011, 08:38 | #9 | Link |
Registered User
Join Date: Dec 2005
Location: Slovenia
Posts: 55
|
Using libav / avconv (http://libav.org/), this works for me...
avconv -i a.ts -c copy -map 0:0 video.mkv -map 0:1 audio.mp2 Some info on CLI can be seen on the front page of libav, under news |
Tags |
ffmpeg |
|
|