Skip to main content

Easily Join / Merge Rotate Two or more video files without encoding or convert videos using ffmpeg in Windows (Or any other OS Mac OS, Linux) for free.

ffmpeg is a pretty handy tool for format transcoding, basic editing (trimming and concatenation), video scaling, video post-production effects, and standards compliance (SMPTE, ITU).
One of the basic requirement of merging or combining two or more videos is a task that can be easily accomplished by using ffmpeg. ffmpeg is a free and open source as well. And the performance is easily on par if not better than most paid software solutions.


In order to merge two or more videos follow the steps:- 


  • First copy all video files into a folder. (Make sure you have checked "File name extensions".







  • Next you need to download ffmpeg for Windows from their website. Choose 64bit unless you are using 32 bit version of Windows and select Static.







  • Download the file. It should be a compressed file.



  • Now open the file. And Go to "Bin", there you will find three files. You need to copy ffmpeg to the folder containing video files.






  • Next open Command Prompt. And navigate to the folder containing video files.





  • Next type the following command to generate a list of files.



(for %i in (*.mp4) do @echo file '%i') > mylist.txt

Note:- If your video files have different extension like .mkv than replace .mp4 with .mkv in abbove command




  • You will see a file has been created inside the folder containing video files named "myist.txt".





  • If you open this file, you will find the name of all files inside the folder.





  • Next you type concat command to merge all files into a single file. This command will not encode the whole video so the process will be lot faster. But if you to convert files from one codec to another codec than this will not work.



ffmpeg -f concat -i mylist.txt -c copy output.mp4
Note:- Replace .mp4 with extension of your video files, if your input video format is not .mp4






  • Now you will find a new video file with name output.mp4 in the same folder where you stored previous video files. 


Bonus:  You can also convert video files from one format to another format with a simple command like


ffmpeg -i video.mp4 output.mkv

You can also easily rotate videos using a simple command


ffmpeg -i input.mp4 -vf "transpose=1" output.mp4

Here: 

  • 0 = 90CounterCLockwise and Vertical Flip (default)
  • 1 = 90Clockwise
  • 2 = 90CounterClockwise
  • 3 = 90Clockwise and Vertical Flip

Above method is slow as it will re-encode your whole video. Also you can use

ffmpeg -i input.m4v -metadata:s:v rotate="90" -codec copy output.m4v

This will be lot faster as this will just edit the metadata and most modern video players will rotate your video automatically.

Here video.mp4 is the name of an existing file and output.mkv is the new file which we want to create.

ffmpeg is a cross Platform tool and above commands will work in Linux or Mac OS as well with little or no modification.

This is just one of the many useful functions ffmpeg offers for free. If you want to learn more about these features here.

Comments

Popular posts from this blog

SHORT CUT TO REMOVE PENDRIVE

Rather than clicking on the task bar and then safely removing the pendrive you can eaily do so creating a shortcut: The Steps are:- 1)Create shortcut on your desktop by right click and selecting new shortcut from the menu. 2)Type "RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll" click next and then finish. shortcut is created and now you can assign a shortcut key to it. just right click on it and select properties-> Click on Shortcut Tab -> Assign a Shortcut key to it(it will take Ctrl+Alt by default)eg: if you press 1 shortcut will be Ctrl+Alt+1.

Decrapify / Debloat Windows 10 with a Powershell Script

Windows 10 is a decent OS from Microsoft after the disaster known as Windows 8 and 8.1. Although Windows is still better with no Modern UI crap, no ads, minimal telemetry, no Edge to bug you. But Windows 10 is a decent compromise if you want a stable OS with modern features like DirectX 12. Earlier OEMs used to bundle PCs and Laptops with crapware, with Windows 10, now Microsoft themselves bundle crapware. Welcome to Software as a Service (SaaS) model. On top of that we have OEM crapware on top of Microsoft crapware. As a result trying to Debloat or DeCrapify Windows 10 is getting absurd and as a system admin it is disheartening to see all that performance go to waste on the messed up attempt by Microsoft to do an Appstore and its apps. Fortunately a kind soul who goes by name  Sycne x has worked painstakingly to provide us a simple solution that works considerably well. Let's Begin To download the script visit  here , and click Clone or Download and Click Download as Zip.