Hot answers tagged

108

Install ffmpeg Make sure you download a recent version of ffmpeg, and don't use the one that comes with your distribution (e.g. Ubuntu). Packaged versions from various distributions are often outdated and do not behave as expected. Or compile it yourself. How to cut a video, without re-encoding Use this to cut video from [start] for [duration]: ffmpeg -...


38

You can try using something such as ffmpeg or mencoder to reencode it with a lower bitrate, e.g.: Calculate the bitrate you need by dividing 1 GB by the video length in seconds. So, for a video of length 16:40 (1000 seconds), use a bitrate of 1000000 bytes/sec: ffmpeg -i input.mp4 -b 1000000 output.mp4 Additional options that might be worth considering ...


28

I can get a greenscreen effect with Adobe Visual Communicator 3 most reliably -- it has pro level chroma keying that actually works, unlike the other toy software out there. I tried 3 or 4, none of them even really worked. However, I cannot figure out any way to pipe this excellent greenscreen in real time through Skype. The ManyCam suggested by ...


27

I just learned that the timecode_frame_start does not work like this. The only way to start at specific frames is to convert a number of frames to ss.ms syntax, or hh:mm:ss.ms. So, if your video is at 25 fps, and you want to start at 133 frames, you would need 133 / 25 = 5.32 So, run ffmpeg -ss 5.32 -i input.mp4 -c:v libx264 -c:a libfaac out.mp4 ...


23

Cropping with FFmpeg With FFmpeg, cropping works as follows, using the crop filter: ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4 Where the options are as follows: out_w is the width of the output rectangle out_h is the height of the output rectangle x and y specify the top left corner of the output rectangle So, for example, to crop a 640&...


20

On Windows, VirtualDub should be able to do this. Check out this guide for in-depth guide on how to split videos. The creatively named Easy Video Splitter can apparently do the job easier, but I have never used it so i would not know first hand.


16

mpg files are the easiest to join. you can actually copy them together. in windows you use copy/b file1.mpg+file2.mpg+file3.mpg newfile.mpg in linux, I use cat cat file1.mpg file2.mpg file3.mpg >> newfile.mpg


16

Ok, since I cannot find much about melt command line usage, here are some notes.. (and after this, see this answer Using process substitution to trick programs expecting files, with specific extensions as argument? - Unix & Linux Stack Exchange for a script example via bash) To begin with - there is a Ubuntu/Debian package for melt (I have Ubuntu 11.04 ...


15

Try mencoder or ffmpeg, both free, both good. Mencoder mencoder -oac copy -ovc copy -o output.avi input1.avi input2.avi FFmpeg From the FFmpeg Wiki article on how to concatenate (join, merge) media files: Create a file "mylist.txt" with all the files you want to have concatenated in the following form ( Lines starting with a dash are ignored ) : # ...


15

Yes, there is, try use the app called "melt", more info: http://mltframework.org/twiki/bin/view/MLT/MltMelt If you uses a debian derived distro: apt-get install melt


15

Well, you still can use the trim filter for that. Here is an example, lets assume that you want to cut out segments 30-40 sec (10 sec) and 50-80 sec (30 sec): ffmpeg -i in.ts -filter_complex \ "[0:v]trim=duration=30[a]; \ [0:v]trim=start=40:end=50,setpts=PTS-STARTPTS[b]; \ [a][b]concat[c]; \ [0:v]trim=start=80,setpts=PTS-STARTPTS[d]; \ [c][d]concat[out1]...


14

Cutting video with ffmpeg You can accurately cut videos with FFmpeg. Since version 2.5 it's very easy. This would for example cut 10 seconds, starting from 0 minutes, 3 seconds and 123 milliseconds. ffmpeg -ss -ss 00:00:03.123 -i input.mp4 -t 10 -c:v libx264 -c:a aac -strict experimental out.mp4 The position and the time may be either in seconds or in hh:...


13

A free, cross-platform solution with FFmpeg, which does bitstream copy and therefore doesn't take more than a few seconds, even for large files: ffmpeg -i input.mp4 -i subtitles.srt -c:s mov_text -c:v copy -c:a copy output.mp4 This works for MP4. Be aware that some subtitle formats might not automatically be compatible with the chosen output formats, so ...


11

Newer versions of ffmpeg deprecate the "padtop" and "padbottom" options. To do it with the new version, use the same basic logic above. In my case, my original video was 720x404, but I wanted to encode 720x480 - padding the top and bottom. So per-above: (480-404) / 2 = 38 i.e. Pad 38 pixels to both the top and bottom. The "pad" command wants the size of ...


11

If you're not afraid of the command line ffmpeg is the tool to use. It's a bit complicated, but most free tools are based on ffmpeg because it's the most powerful one out there. This is a sample of a command to split out 30 seconds of a video. ffmpeg -i input.avi -vcodec copy -ss 00:00:10:15 -t 00:00:30:00 output.avi If you're on windows, it's a little ...


10

It isn't very well documented, but FFmpeg has a -vol switch which will allow you to increase volume output. Example: ffmpeg -i vid.mkv -vol 512 -vcodec copy output.mkv Some things to take note of: the -vol switch uses "byte percent", so you can't just specify a 200% volume increase, 100% = 256 so specifying 256 would leave the volume as is, 512 would ...


10

I ended up using ffmpeg from the command-line to do the needful clipping. After doing some research on this site and trying a few simpler commands I came up with the following command: ffmpeg -ss 00:01:00 -i input.mp4 -ss 00:02:00 -c copy -to 00:05:10 \ output.mp4 As I understand it, with this command ffmpeg basically copies a portion of the clip ...


9

This is a standard feature on the PhotoBooth application in OSX Leopard your using a Mac. You can create your own static color background and then record the video or change it on the fly. I am not sure of Windows application thought. I never use a Webcam in Windows.


9

On Windows, you can use VirtualDub. On Linux, there is a very similar program called AviDemux2


9

Do you really not want to compile yourself? It's pretty easy. Follow the guides here to install the latest version of FFmpeg. It takes a few minutes. You can also download a static build from their download page, which you just have to extract and you're ready to go. I'd really advise you to go for the latest, as the versions shipped with Ubuntu (Mint) are ...


9

The best actual, mathematically lossless format I know of is huffyuv, but that will produce hilariously huge files, and wouldn't be compatible with much. For the record, ffmpeg can do it with: ffmpeg -i input -c:v huffyuv -c:a libmp3lame -b:a 320k output.avi X264, the open-source h.264 encoder, has a lossless mode. This can go inside an MP4 container, and ...


8

You can non-destructively edit the file to clip out portions you don't want (take 1m off the beginning, 30s off the middle, 4m off the end). Other than that, you're going to have to re-encode the mp4 as a smaller file. Try Handbrake. Decrease the resolution from the Mino's native 1280x720 to something smaller, just preserve the aspect ratio. Decrease the ...


8

This is for FFmpeg (see here for Windows versions). First, prepare your images so they are named image-001.jpg, image-002.jpg, et cetera. Put them into one folder. Now, use the following command: ffmpeg -y -loop 1 -f image2 -r 0.5 -i image-%03d.jpg -s:v 1280x720 -b:v 1M \ -i soundtrack.mp3 -t 01:05:00 -map 0:0 -map 1:0 out.avi You can of course ...


8

Ogg Video Tools seems to do what you are looking for. Short description: Sometimes it would be nice to concatenate (join) two or more video files. For that you can use oggCat, which creates a continuous Ogg video file from the given files. # oggCat newFile.ogv file1.ogv file2.ogv [ file3.ogv [...] ] Note: The video files must correspond in ...


8

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 ...


8

Here are two PowerShell scripts to split long videos into smaller chapters by black scenes . Save them as Detect_black.ps1 and Cut_black.ps1. Download ffmpeg for Windows and tell the script the path to your ffmpeg.exe and your video folder under the option section. Both scripts won't touch existing video files, they remain untouched. However, you will ...


8

I suggest to do that way: Create black background with the same duration and resolution as output video should be Add alpha channel to each video Add fade to alpha effect to each video Use overlay on each video with black background So the command for adding crossfade to 2 video (5 sec) each should be: ffmpeg -i 1.mp4 -i 2.mp4 -f lavfi -i color=black -...


7

The tool for the job is mpgtx (if not installed try, e.g., sudo apt-get install mpgtx). Let's suppose your file is called input.mpg and you want to create output.mpg Here are some common tasks Select segments from a mpeg movie, create a new mpeg movie out of them //Grabs seconds 10-20, 42 through 52, then 1:23 through 1:33 and make a new mpeg movie ...


7

Without a doubt, VirtualDub is the way to go. Open the first AVi in VirtualDub Select "Direct Stream Copy" for both video and audio In the file menu, choose Append AVI Segment (or similarly named) File -> Save As and give your avi a new name Bingo! I have done this many times. The only gotcha is to be aware that the dimensions, codecs, bitrates, etc. all ...


7

This can be done in ffmpeg. Before you begin, read this great resource on understanding the math: http://www.doom9.org/index.html?/aspectratios.htm First, calculate the top and bottom padding values. long=width of original, skinny=height of orginal totalPadding = .75*long - skinny top padding = bottom padding = totalPadding / 2 NOTE: if the top and ...



Only top voted, non community-wiki answers of a minimum length are eligible