I have a Video, and i want to add FADE OUT & FADE IN filter at the starting and Ending without re-encoding video in FFMPEG...
Is this possible guys ?
"I already tried Split video into three parts and add FADE to black filter through Avidmux, and then join all parts...
But every time i facing problem with different encoding parameters and it take a lot of time."
+ Reply to Thread
Results 1 to 5 of 5
What different parameter?
Same fps, same resolution (width x height) , same codec.
Encode only the videostream, then remux audio.
Do this with both start and end cuttings.
FFMpeg works for me on a regular basis doing this.
1. Cut the 5 seconds from front and end as ProWo suggested.. Bear in mind cutting is usually on a keyframe basis so if you 5 second endpoint of the start or the Start point of your end cut is not a keyframe, a glithch will arise when you join them (Frozen frame, Play speed, etc.)
2. Reencode the 5 seconds at first and the 5 seconds at the end with the fade in/out effects. At this point they may be different as far as format, level, profile or # ref frames but this should be not a factor if you used the same codec and kept the same size size. They can also be set diffenently if you wish through FFmpeg.
3. concat losslessly by using the scripts:
ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts ffmpeg -i input3.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts" -c copy -bsf:a aac_adtstoasc output.mp4