Media tool with support for multiple codecs, filters, and containers. Include the full, uncut console output if you have problems with an FFmpeg command.

learn more… | top users | synonyms

5
votes
1answer
4k views

What is the command to cut a portion out of a video and save it using ffmpeg?

I've tried ffmpeg -t in_movie.avi -ss 00:26:20 -t 00:28:24 out_movie.avi but that's giving me: Invalid duration specification for t: in_movie.avi Please advise. UPDATE: Molly, that command ...
5
votes
1answer
749 views

ffmpeg's select-filter generates unwanted black frames

I want to cut a video by frames with ffmpeg. What I came up with so far is ffmpeg -i P2.mp4 -vf "fps,setpts='PTS-STARTPTS',select='gte(n\,20)*lte(n\,30)',crop='600:430:100:650',scale='280:-1'" ...
5
votes
1answer
3k views

ffmpeg - How to copy|extract encoding settings from existing media file?

I wished to be able do this multiple times now so I ask. If I have an existing video or audio file, ffmpeg, mplayer and other media players can detect at least some of it's "propreties" like ...
5
votes
1answer
2k views

Two FFMPEG commands simultaneoulsy

I want to multicast two videos to two different ports of a multicast address. I am able to send one video to one port at a time. But I want a command where both the videos are sent to the ports at the ...
5
votes
1answer
2k views

FFmpeg - unable to play stream

I used the following command to attempt to stream from a file with ffmpeg: ffmpeg -re -i GunGrave\ -\ 03\ -\ Rain.webm -c copy -f asf rtmp://127.0.0.1:8090/test.asf This produced the following ...
5
votes
1answer
1k views

Cut last 30 seconds off ends of videos using ffmpeg in a batch file in Windows

This is what I have so far: for i in *.mp4; do ffprobe -show_format -i "%i" // get duration, then need to somehow subtract 30 seconds, and marry these two commands ffmpeg -ss 0 -i "$i" -t ...
5
votes
2answers
20k views

Using ffmpeg to encode a raw video to H.264 format

On a Ubuntu 10.04, I am trying to encode a raw video (YUV format) to a H.264 encoded video using below ffmpeg commands: ffmpeg -i input.mp4 output.h264 but I get an error saying Unsupported ...
5
votes
1answer
498 views

Split Up a Video Using FFMPEG through Scene Detection

I saw this thread, which almost exactly does what I want, but I'm actually looking for splitting on scene detection. Automatically split large .mov video files into smaller files at black frames ...
5
votes
1answer
1k views

Convert png sequence to x264 with ffmpeg

I am trying to convert a series of pngs into an mp4 video. I am using ffmpeg, and want to encode the video with the H.264 codec. Using the command ffmpeg -y -r 30 -b 1800k -i _tmp%04d.png -vcodec ...
5
votes
1answer
493 views

How to properly concaternate two audio files together?

I ripped two Blu-rays and I'm trying to combine the audio from both into one file. I've decoded it from DTS-HD MA to Wave64, and I used avisynth to remove the black screen audio (4 seconds) from the ...
4
votes
2answers
12k views

Concat two mp4 files with ffmpeg without losing quality

i have now a problem with concatenating of 2 videos using ffmpeg. So, i am encoding the source mp4 files to ts with ffmpeg -i output1.mp4 -scodec copy -vbsf h264_mp4toannexb i0.ts but the file ...
4
votes
2answers
10k views

How many instances of FFmpeg commands can I run in parallel?

I tired running 8 commands in parallel to fully utilize the CPU and speed up Video conversions, something like this: ffmpeg -i input.mp4 -t 60 -f mp4 /mnt/a.mp4 > /dev/null 2>&1 & ...
4
votes
1answer
14k views

How can I convert a series of PNG images to a video for YouTube?

I have a sequence of PNGs (here is one specimen) which I turn into a video with ffmpeg: ffmpeg -r 10 -i image%03d.png -s 1380x720 -c:v libx264 -qscale 10 -r 30 basf_merck_libx264.mp4 With ...
4
votes
1answer
5k views

FFmpeg (MacPorts) - libfaac missing, need new audio encoder

I am so confused. I am trying a quite simple FFMpeg command to transcode a movie file to a x264/AAC mp4 file via the command line (for Vimeo upload). (Mountain Lion/Macports) ffmpeg -i INPUT.AVI ...
4
votes
2answers
11k views

What's the difference between FFmpeg's “-vcodec copy” and “-sameq”?

What is the difference between using -vcodec copy and -sameq with FFmpeg? Do they do the same thing?
4
votes
1answer
9k views

Converting video from 1080p to 720p with smallest qualiti loss using ffmpeg

I stack with my high quality movie: 1080p with 60fps. The trouble is lags while playing. I tried to convert it to 720p with ffmpeg: ffmpeg -i MyMovie.mkv -r 60 -s hd720 MyMovie_720p.mkv But I ...
4
votes
1answer
2k views

What lossy audio formats are more (or less) “efficient”?

This question is related to the answers I got to this question. The bitrate-efficient format (see the question's most voted answers and their comments thereunder) would be one that assures a good ...
4
votes
1answer
2k views

FFmpeg: can't capture audio from microphone

I use FFmpeg under Windows 7 to stream live video. There are no problems with the camera, but for some reason I can't capture sound from the microphone (I've tested it, it works fine). I use the ...
4
votes
3answers
15k views

Live streaming using FFMPEG

This is rather a simple question, but I cannot find the answer. I need to stream from a capture device to a server, and then have FFMPEG on the server re-code the stream suitable for HLS. But how do ...
4
votes
4answers
6k views

Merge two audio channels (stereo) into one (mono) on GSM6.10 using FFMPEG

I would like to know if it is possible to merge stereo audio into mono on a GSM6.10 audio file using FFMPEG. If it is, please provide the command to achieve this. Otherwise, is it possible to convert ...
4
votes
3answers
12k views

Rotate a video file 90 degrees using Ubuntu

I want to use Ubuntu and preferably standard packages such as ffmpeg to rotate a .3gp video file by 90 degrees in any direction. Preferably a command line or Python script. How can I do that?
4
votes
3answers
6k views

Synchronizing audio and video using MP4Box / ffmpeg to concatenate files

I have two H.264 encoded MPEG-4 files that I need to concatenate. I have been using MP4Box for this task by first ensuring the files are encoded identically (even went so far as to compare output from ...
4
votes
1answer
2k views

Convert AVI into H.264 that works inside an HTML5 Video tag

I would like to convert an existing black and white AVI into an H.264 video that works inside an HTML5 video tag. I'm currently using this ffmpeg command: ffmpeg -i file.avi -y -c:v libx264 ...
4
votes
1answer
2k views

Processing YouTube video in ffmpeg

I'm using ffmpeg for taking screenshots from video. Is it possible to take screenshots from YouTube video without downloading video to hard drive?
4
votes
1answer
7k views

Using ffmpeg to make a movie from png files

I have 277 800x600 png files with filenames with the format island_sizes-CSH(II)-###.png where ### is a number starting with 084 and ending at 360. I'm doing ffmpeg -i island_sizes-CSH\(II\)-*.png ...
4
votes
1answer
5k views

How to get time stamp of closest keyframe before a given timestamp with FFmpeg?

I want a FFmpeg seeking command that fast and accurate. I found this. The solution is that we apply -ss for both input (fast seeking) and output (accurate seeking). But: If the input seeking is not ...
4
votes
1answer
4k views

x264 encoding speed, what should my expectations be?

I am running Ubuntu 10.10 (maverick) on an HP Pavillion dv3 with core2duo 2.29 GHz, NVidia Geforce G105M (512MB) with CUDA and 4GB RAM. I have the latest versions of ffmpeg and x264. I recognise that ...
4
votes
1answer
2k views

FFMPEG image sequence with various durations

Let's say I have an mp3 file of 1 minute length. And I have 20 png images. I want to combine these images and an audio into a video file, but I do not want each image to last 3 seconds on screen, I ...
4
votes
2answers
3k views

FFMPEG extract intra-frames I,P,B frames

Is there a way to extract the intra-frames and preserve them as-is from FFMPEG or similar program? I know you can extract frames to a sequence of JPEG images using -f image2. But those are full images ...
4
votes
1answer
4k views

FFmpeg settings for YouTube and Facebook video uploads

Can any FFmpeg experts share their preferred settings for video conversion to both YouTube and Facebook? For Youtube I am following these guidelines and my video size is 480P @ 24 fps Audio Codec: ...
4
votes
1answer
5k views

Use DivX settings to encode to mp4 with ffmpeg

I'm used to use VirtualDub to encode a video to AVI container with DivX-codec (and MP3 for audio). Now I'm planning to use ffmpeg to encode videos to MP4 container with h264-codec. What I've figured ...
4
votes
1answer
3k views

ffmpeg: images to 29.97fps mpeg2, audio not sync

I have spent a lot of time on this issue. Hope someone can help. I want to convert 3147 images + ac3 audio file into an mpeg2 video at 29.97fps (about 1m45s). My command: ~/ffmpeg/ffmpeg/ffmpeg ...
4
votes
1answer
805 views

How can I find out how big my encoded file will be?

I am converting a video using the following command: ffmpeg -i "input.avi" -vcodec mpeg4 -r 15 -sameq "output.avi" However I'm only interested in the file size of output.avi. Is there a command I ...
4
votes
3answers
8k views

Is it possible to use ffmpeg to trim off X seconds from the beginning of a video with an unspecified length?

I need to trim the just the first 1 or 2 seconds off of a series of FLV recordings of varying, unspecified lengths. I've found plenty of resources for extracting a specified duration from a video ...
4
votes
1answer
867 views

How to merge video flv and audio wav file in ffmpeg

I want to merge an audio .wav with a video .flv using ffmpeg Please suggest me how to achieve this. i am using this command on ubuntu 12 : ffmpeg -i recod_audio.wav -i recod_ideo.flv -acodec ...
4
votes
1answer
2k views

Lossless universal video format

I am trying to find the most suitable lossless video format for 1280x720 25fps video. The video has 4 minutes. Sound will be 320 kbps mp3, that is not a big deal. Ideal conditions: Lossless (can be ...
4
votes
1answer
482 views

ffmpeg amix dropping audio levels

I am attempting to take one video file and 2 audio files (.mp3 and .wav, though I could do 2 .mp3's - not limited to specific format) and combine them into one video. I have it working with the amix ...
4
votes
1answer
576 views

FFmpeg corrupts iTunes files

I am trying to create .m4a files to play in my car, which has a USB interface. Files downloaded from this website work fine as is. However for example if I remux them using ffmpeg -i infile.m4a -c ...
4
votes
2answers
4k views

Extracting wav from mp4 while preserving the highest possible quality

I went through the documentation and I can extract a wav file from an mp4 file with the command: ffmpeg -i my_video.mp4 output_audio.wav However, how can I control the quality of the wav file? ...
4
votes
1answer
3k views

Is there a way to disable or hide output thrown by FFmpeg?

I went through the documentation but couldn't find a solution. I'm hoping there is some kind of argument that will tell FFmpeg to not show the output in the console. The output that I'm referring to ...
4
votes
1answer
8k views

ffmpeg open webcam using YUYV but i want MJPEG

I need ffmpeg to open webcam (logitech c910) in MJPEG mode, because the webcam can give ~24 using MJPEG "protocol" and only ~10 fps using the YUYV. Can i choose between them using ffmpeg command line? ...
4
votes
2answers
2k views

Streaming Desktop using FFMPEG in windows

How to stream Desktop using FFMPEG in windows?? I have tried ffmpeg -list_devices true -f dshow -i dummy and after that this to stream ffmpeg -f dshow -i video="Chicony USB 2.0 Camera" -r 30 ...
4
votes
4answers
15k views

How to specify audio and video bitrate

I have a mov file with the following media information: Stream 0 Type: Video Codec: H264-MPEG-4 AVC (part 10)avc1 Language: English Resolution: 1280x720 Frame rate: 24 Stream 1 Type: Audio Codec: ...
4
votes
1answer
1k views

Why does the quality of this video suck when converted with ffmpeg as opposed to mencoder?

Here's the command line that I'm using for both and the output. Any ideas? The bitrate of the two videos is comparable: both around 1500Kbps. ffmpeg command: ffmpeg -y -i aud.mp4 -acodec copy -i ...
4
votes
1answer
7k views

Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

When i tried to merge an avi file with a wav file it shows the error "Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height". I will ...
4
votes
1answer
732 views

Splitting video in multiple episodes with ffmpeg

I need to cut one video into multiple pieces with ffmpeg. When I cut just one episode ffmpeg -i 001.mp4 -vcodec copy -acodec copy -ss 00:00:00.000 -t 00:00:25.500 -strict -2 out1.mp4 or ffmpeg -i ...
4
votes
1answer
936 views

Embedding artwork with FFmpeg during FLAC to ALAC conversion

How does one embed artwork during FLAC → ALAC conversion? ffmpeg -i track.flac -acodec alac track.m4a transfers metadata but not artwork.
4
votes
1answer
646 views

How can I convert an m4v video to a widely viewable format using ffmpeg?

I have a m4v video generated by iMovie. I want to use ffmpeg to generate a widely viewable video on Windows. I cannot assume that the viewer will have VLC (or any other sophisticated viewer). It needs ...
4
votes
2answers
164 views

Re-encoding in FFMPEG using the exact same settings as the input file

I have a use-case where I take a few MPEG-4 files, trim them and concatenate them in to one file. I have a second use-case where one of those files are trimmed and also cropped/scaled, these files ...
4
votes
2answers
4k views

FFMPEG not resizing a video properly

I am trying to use FFMPEG to resize a video using -s 480x272. Unfortunately something is causing FFMPEG to output a video with 483x272. For those curious this is the command I am using: ffmpeg -i ...