开发者

How do I extract video layers from an AVI?

I have a Fujifilm FinePix Real 3D W3, and it creates something Fujifilm calls 3D-AVI files. There are pograms to split these 3D-AVI files into separate left-and-right movies, but they involve using GUI-based software on Windows.

I would rather use a command-line tool like ffmpeg, so that I can automate the process. Does anybody have any suggestions on how to go about doing this?

I've heard on forums that the 3D-AVI file is simply left and right AVIs on two video layers. I couldn't see anything in 开发者_开发知识库the ffmpeg docs on how to extract these layers.


I was able to do this with this command:

ffmpeg -i nfr.avi -ar 22050 nfr.left.flv -map 0.2 -map 0.1 nfr.right.flv -map 0.0 -map 0.1

And you can do ffprobe on the avi to find out what streams should be mapped.


Thank you - it's still a good starting point 7 years later.

The critical points are the '-map ...' flags! I was able to get the splits done using this command:

ffmpeg -i $1 \
-c:v mpeg4 -vtag xvid \
-qscale:v 3 -ar 48000 -c:a libmp3lame -b:a 128k $1.left-audio.avi -map 0:2 -map 0:1 \
-qscale:v 3 -an $1.right.avi -map 0:0

Where $1 is the input file; and the audio (-c:a xxx) and video (-c:v xxx) codecs can be chosen ad lib.

Only the left file gets the audio stream; I wanted to combine them side-by-side later on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜