New
#11
Thanks very much. Though I am not conversant with command prompt and ffmpeg was also a new thing to me. But with the help of some friends and google, I succeeded and that also very fast. I think now I will be using it very often for splitting and will see that what other things can be done with this. Thanks again
Yes, FFmpeg's command prompt options can be a bit cryptic, but it is powerful open source software and is used by many professionals. It can do ANYTHING you could possibly think of doing to a video. Apart from converting from any known video format to any other, it can crop, scale, rotate or resample to a new frame rate. These days I create a batch file script of FFmpeg commands to do all my video editing.
As it is used by many professionals, you'll find any question you have about how to do something (however obscure) has already been asked and answered on a professional forum somewhere. Just Google it, that's what I do when I's stuck
It also comes with a player that takes the same commands so you can 'test run' your command options. It's called FFplay.
You can dramatically reduce the size of a video file by using higher compression levels. The Constant Rate Factor (CRF) is used to specify compression. In addition, you can specify how much time it spends processing each frame, from 'ultrafast' to 'veryslow'. The longer you take, the better the quality of the compressed video. Typically I use....
ffmpeg -i input.mp4 -crf 28 -preset veryslow output.mp4
...which generally takes about four times as long as the video length (I leave it running over night for long videos).
https://trac.ffmpeg.org/wiki/Encode/H.264The range of the CRF scale is 0–51, where 0 is lossless, 23 is the default, and 51 is worst quality possible. A lower value generally leads to higher quality, and a subjectively sane range is 17–28...
...The range is exponential, so increasing the CRF value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the bitrate...
Each batch file is a list of ffmpeg commands tailored for a specific video, each command specifies the start and stop time for each extract, followed by a FFmpeg command line to join (concatenate) all the extracts into a single complete video. I use Movie Maker purely as a player to locate the exact time of the frame I want as an edit point.
This is a typical batch file. You'll see a few unfamiliar options, like afade (audio fade) and yadif (Yet Another De-Interlace Filter).
The original unedited video was 1.mp4, the intermediate extracted clips (2.mp4, etc.) and the files.txt list of clips can be deleted once the finished video is made.Code:ffmpeg -i 1.mp4 -ss 2.73 -to 1491.73 -vf yadif -aspect 16:9 -c:v mpeg4 -q 2 -b:a 128k 2a.mp4 ffmpeg -i 2a.mp4 -af "afade=t=in:ss=0:d=6" -c:v copy 2.mp4 ffmpeg -i 1.mp4 -ss 1498.07 -to 2737.07 -vf yadif -aspect 16:9 -c:v mpeg4 -q 2 -b:a 128k 3.mp4 ffmpeg -i 1.mp4 -ss 2747.27 -to 4365.23 -vf yadif -aspect 16:9 -c:v mpeg4 -q 2 -b:a 128k 4.mp4 ffmpeg -i 1.mp4 -ss 4370.63 -to 5912.57 -vf yadif -aspect 16:9 -c:v mpeg4 -q 2 -b:a 128k 5.mp4 ffmpeg -i 1.mp4 -ss 5917.90 -to 7884.80 -vf yadif -aspect 16:9 -c:v mpeg4 -q 2 -b:a 128k 6.mp4 echo file '2.mp4' > files.txt echo file '3.mp4' >> files.txt echo file '4.mp4' >> files.txt echo file '5.mp4' >> files.txt echo file '6.mp4' >> files.txt ffmpeg -f concat -i files.txt -crf 28 -tune film -preset veryslow -aspect 16:9 -af "volume=6dB" "My Edited Video.mp4"
Scaling the video down to (say) 320p, and/or using a high CRF of (typically) 28 can significantly reduce the size of the video to be uploaded.
This video may help explain using CRF...
FFmpeg video compression - decrease size, maintain quality - YouTube