Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a script to encode videos (using mencoder), but is there a way to add a simple "fade out/in to black" from the command line, preferably free (as in open source).

It could be either on Windows or Ubuntu Linux.

share|improve this question
1  
Does mmsuper8 seem to work for you? Please state operating system, etc. –  slhck Feb 4 '12 at 22:12
    
Sorry. Ubuntu or seven. –  Manu Feb 4 '12 at 22:17
    
Make mmsuper8 as your answer, I'll vote you up :) –  Manu Feb 5 '12 at 8:38
add comment

2 Answers

up vote 1 down vote accepted

The only thing I could find – based on the command line – is mmsuper8, a Linux tool.

Specifically, it features the mmsuper8fade tool, which seems like it could be useful for you.

Best would be if you edit this question and supply an example that worked for you!

share|improve this answer
add comment

A recent ffmpeg with the 'fade' video filter can do this. Unfortunately, the ffmpeg in the Ubuntu repos doesn't have filters enabled for some inane reason, so you'll have to get it from somewhere else (see here).

To fade in from black, starting at frame 0, over 50 frames (2 seconds @ 25fps):

ffmpeg -i input.mp4 -filter:v 'fade=in:0:50' \
-c:v libx264 -crf 22 -preset veryfast -c:a copy output.mp4

To fade out starting at frame 21000 (14 minutes @ 25fps), over 50 frames:

ffmpeg -i input.mp4 -filter:v 'fade=out:21000:50' \
-c:v libx264 -crf 22 -preset veryfast -c:a copy output.mp4

You can combine the two into a filterchain:

ffmpeg -i input.mp4 -filter:v 'fade=in:0:50,fade=out:21000:50' \
-c:v libx264 -crf 22 -preset veryfast -c:a copy output.mp4

As you can see from these examples, you have to transcode video when using a video filter. Since ffmpeg and mencoder share many libraries, it should be fairly easy to re-write your scripts to use ffmpeg instead of mencoder & avoid an unnecessary extra encode. I'm pretty sure that you can achieve the same thing in mencoder, but I don't know mencoder syntax.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.