Questions tagged [ffmpeg]

Only questions about programmatic use of the FFmpeg libraries, API, or tools are on topic. Questions about interactive use of the command line tool should be asked on Super User or Video Production. FFmpeg is a free, open source project that produces libraries and programs for handling multimedia data.

Filter by
Sorted by
Tagged with
1001 votes
14 answers
989k views

Cutting multimedia files based on start and end time using ffmpeg

I tried to cut the video using the start and end time of the video by using the following command: ffmpeg -ss 00:00:03 -t 00:00:08 -i movie.mp4 -acodec copy -vcodec copy -async 1 cut.mp4 By using the ...
Kalaiyarasan's user avatar
  • 12.7k
992 votes
31 answers
1.0m views

How to concatenate two MP4 files using FFmpeg? [closed]

I'm trying to concatenate two mp4 files using ffmpeg. I need this to be an automatic process hence why I chose ffmpeg. I'm converting the two files into .ts files and then concatenating them and ...
Mark L's user avatar
  • 13k
656 votes
13 answers
673k views

How can I extract audio from video with ffmpeg? [closed]

I tried the following command to extract audio from video: ffmpeg -i Sample.avi -vn -ar 44100 -ac 2 -ab 192k -f mp3 Sample.mp3 but I get the following output libavutil 50.15. 1 / 50.15. 1 ...
user1269669's user avatar
  • 6,577
569 votes
16 answers
422k views

Rotating videos with FFmpeg [closed]

I have been trying to figure out how to rotate videos with FFmpeg. I am working with iPhone videos taken in portrait mode. I know how to determine the current degrees of rotation using MediaInfo (...
jocull's user avatar
  • 20.6k
408 votes
39 answers
528k views

How do you convert an entire directory with ffmpeg?

How do you convert an entire directory/folder with ffmpeg via command line or with a batch script?
Eugene's user avatar
  • 11.2k
362 votes
9 answers
865k views

How to create a video from images with FFmpeg? [closed]

ffmpeg -r 1/5 -start_number 2 -i img%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4 This line worked fine but I want to create a video file from images in another folder. Image names in my ...
user3877422's user avatar
  • 3,687
360 votes
7 answers
174k views

FFMPEG (libx264) "height not divisible by 2"

I am trying to encode a .mp4 video from a set of frames using FFMPEG using the libx264 codec. This is the command I am running: /usr/local/bin/ffmpeg -r 24 -i frame_%05d.jpg -vcodec libx264 -y -an ...
Andy Hin's user avatar
  • 30.9k
334 votes
15 answers
467k views

Convert audio files to mp3 using ffmpeg [closed]

I need to convert audio files to mp3 using ffmpeg. When I write the command as ffmpeg -i audio.ogg -acodec mp3 newfile.mp3, I get the error: FFmpeg version 0.5.2, Copyright (c) 2000-2009 Fabrice ...
Hrishikesh Choudhari's user avatar
316 votes
3 answers
215k views

ffmpeg overwrite output file if exists

I ran: ffmpeg -i input.flac output.mp3 This prompts: File 'output.mp3' already exists. Overwrite? [y/N] y How do I automatically say "yes"?
Muhammad Omer Aslam's user avatar
262 votes
10 answers
258k views

How to add a new audio (not mixing) into a video using ffmpeg?

I used a command like: ffmpeg -i video.avi -i audio.mp3 -vcodec codec -acodec codec output_video.avi -newaudio in latest version for adding new audio track to video (not mix). But I updated the ...
Vetalll's user avatar
  • 3,604
260 votes
1 answer
169k views

What are the differences and similarities between ffmpeg, libav, and avconv?

When I run ffmpeg on Ubuntu, it shows: $ ffmpeg ffmpeg version v0.8, Copyright (c) 2000-2011 the Libav developers built on Feb 28 2012 13:27:36 with gcc 4.6.1 This program is not developed anymore ...
why's user avatar
  • 24.4k
233 votes
10 answers
473k views

Fastest way to extract frames using ffmpeg? [closed]

Hi I need to extract frames from videos using ffmpeg.. Is there a faster way to do it than this: ffmpeg -i file.mpg -r 1/1 $filename%03d.jpg ?
Stpn's user avatar
  • 6,344
227 votes
9 answers
322k views

Use ffmpeg to add text subtitles [closed]

I am trying to add text subtitles to an .mp4 container using ffmpeg: ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mp4 When I am trying to run this line, it gives me an error : ...
0-alpha's user avatar
  • 3,431
222 votes
8 answers
214k views

Best approach to real time http streaming to HTML5 video client [closed]

I'm really stuck trying to understand the best way to stream real time output of ffmpeg to a HTML5 client using node.js, as there are a number of variables at play and I don't have a lot of experience ...
deandob's user avatar
  • 5,200
222 votes
10 answers
185k views

FFmpeg on Android

I have got FFmpeg compiled (libffmpeg.so) on Android. Now I have to build either an application like RockPlayer or use existing Android multimedia framework to invoke FFmpeg. Do you have steps / ...
Jag's user avatar
  • 2,221
221 votes
1 answer
117k views

Meaning of ffmpeg output (tbc, tbn, tbr) [closed]

I am using ffmpeg to tell me video info. Specifically: ffmpeg -i video.ext I get the output: Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 704x576 [PAR 12:11 DAR 4:3], 9578 kb/s, 25 tbr, 90k tbn, ...
user7289's user avatar
  • 33.6k
207 votes
1 answer
244k views

ffmpeg - Converting MOV files to MP4 [closed]

I have just installed ffmpeg and I am trying to encode all my uploaded videos to .mp4 file. Most of the users currently upload .mov and I want to convert every video to .mp4. I am running the command ...
user1503606's user avatar
  • 4,012
206 votes
16 answers
475k views

OCI runtime exec failed: exec failed: (...) executable file not found in $PATH": unknown

I have dockerized an app which has ffmpeg installed in it via libav-tools. The app launches without problem, yet the problem occured when fluent-ffmpeg npm module tried to execute ffmpeg command, ...
Uğur Kaya's user avatar
  • 2,407
200 votes
2 answers
190k views

How to extract 1 screenshot for a video with ffmpeg at a given time?

There are many tutorials and stuff showing how to extract multiple screenshots from a video using ffmpeg. You set -r and you can even start a certain amount in. But I just want 1 screenshot at, say ...
Peter Bengtsson's user avatar
195 votes
17 answers
209k views

Fetch frame count with ffmpeg

Does anyone know how to fetch the number of total frames from a video file using ffmpeg? The render output of ffmpeg shows the current frame and I need the frame count to calculate the progress in ...
Hansl's user avatar
  • 1,951
192 votes
6 answers
289k views

What are all codecs and formats supported by FFmpeg? [closed]

I need a list of codecs and formats supported by FFmpeg. Where can I find it?
poobalan's user avatar
  • 1,961
180 votes
17 answers
256k views

ffprobe or avprobe not found. Please install one

I want to add tags to mp3 converted by youtube-dl & ffmpeg: youtube-dl -o '/Output/qpgTC9MDx1o.mp3' qpgTC9MDx1o -f bestaudio --extract-audio --metadata-from-title "%(artist)s - %(title)s&...
Anass's user avatar
  • 2,163
177 votes
3 answers
218k views

How can I extract a good quality JPEG image from a video file with ffmpeg?

Currently I am using this command to extract the images: ffmpeg -i input.mp4 output_%03d.jpeg But how can I improve the JPEG image quality?
Daniel Gartmann's user avatar
164 votes
6 answers
103k views

What does 'Past duration X.XXX too large' mean?

When encoding H.264 using ffmpeg I get the following type of warnings en masse: Past duration 0.603386 too large Past duration 0.614372 too large Past duration 0.606377 too large What do they mean? ...
Erik's user avatar
  • 2,540
163 votes
8 answers
145k views

Convert .flac to .mp3 with ffmpeg, keeping all metadata

How can I convert .flac to .mp3 with ffmpeg, keeping all metadata (that is converting Vorbis comment in .flac files to ID3v2 metadata of .mp3)?
Vito Gentile's user avatar
  • 13.8k
160 votes
6 answers
219k views

webm to mp4 conversion using ffmpeg

When I try to convert a webm file to mp4 the output is very very choppy and it appears as if many frames have been dropped by ffmpeg I used the following commands to convert ffmpeg -i movie.webm ...
Pavan K's user avatar
  • 4,365
143 votes
4 answers
125k views

Creating a video from a single image for a specific duration in ffmpeg [closed]

How do I generate a movie using ffmpeg using a single image (image1.png) for a duration of 15 seconds with a specific resolution so when I play the video, the image will appear on screen for 15 ...
Dharmesh's user avatar
  • 1,976
143 votes
4 answers
101k views

ffmpeg concat: "Unsafe file name"

Trying to convert a bunch of mts-files into a big mp4-file: stephan@rechenmonster:/mnt/backupsystem/archive2/Videos/20151222/PRIVATE/AVCHD/BDMV$ ~/bin/ffmpeg-git-20160817-64bit-static/ffmpeg -v info -...
sers's user avatar
  • 3,309
143 votes
5 answers
75k views

FFmpeg C API documentation/tutorial [closed]

I am trying to find documentation to use the FFmpeg C API. It seems that only command line documentation is available. Is there any good documentation/tutorials/links available?
fvisticot's user avatar
  • 8,246
137 votes
4 answers
99k views

Get ffmpeg information in friendly way

Every time I try to get some information about my video files with ffmpeg, it pukes a lot of useless information mixed with good things. I'm using ffmpeg -i name_of_the_video.mpg. There are any ...
JBernardo's user avatar
  • 32.8k
134 votes
7 answers
280k views

Using ffmpeg to change framerate

I am trying to convert a video clip (MP4, yuv420p) from 30 fps to 24 fps. The number of frames is correct so my output should change from 20 minutes at 30fps to 25 minutes at 24fps. Everything else ...
J Brand's user avatar
  • 1,349
128 votes
4 answers
156k views

Text on video ffmpeg

How can I add text overlay on my video in ffmpeg? i.e. given a video "video1.flv", how can I add "StackOverflow" text during the whole video, positioned in the middle of the screen, with white text ...
Jesper Madsen's user avatar
118 votes
8 answers
84k views

Crop MP3 to first 30 seconds

Original Question I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy style. The new file should only contain the first ...
Cheekysoft's user avatar
  • 35.4k
117 votes
19 answers
161k views

How to extract duration time from ffmpeg output?

To get a lot of information about a media file one can do ffmpeg -i <filename> where it will output a lot of lines, one in particular Duration: 00:08:07.98, start: 0.000000, bitrate: 2080 kb/...
Louise's user avatar
  • 6,463
117 votes
2 answers
259k views

FFMPEG mp4 from http live streaming m3u8 file? [closed]

How Can I extract mp4 from http live streaming m3u8 file? I Tried this command below: ffmpeg -i {input file} -f rawvideo -bsf h264_mp4toannexb -vcodec copy out.mp4 I took this error: [NULL @ ...
thiago.adriano26's user avatar
117 votes
12 answers
169k views

FFmpeg: How to split video efficiently?

I wish to split a large avi video into two smaller consecutive videos. I am using ffmpeg. One way is to run ffmpeg two times: ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:00:00 -t 00:30:00 ...
Antony's user avatar
  • 1,310
113 votes
3 answers
103k views

FFMPEG mux video and audio (from another video) - mapping issue

I would like to place the audio from a video to another video without an audio (in one command): ffmpeg.exe -i video1_noAudio.mov -i video2_wAudio.mov -vcodec copy -acodec copy video1_audioFromVideo2....
Mark's user avatar
  • 1,600
109 votes
5 answers
103k views

Rotate mp4 videos without re-encoding

I'm looking for a way to rotate videos shot with my Nexus 4 on my Debian Wheezy sytem. The videos are shot in portrait mode and I would like to rotate them to landscape mode. Preferably the rotation ...
stedes's user avatar
  • 1,531
108 votes
4 answers
164k views

Using ffmpeg to get video info - why do I need to specify an output file? [closed]

I'm using ffmpeg to get info about a video file and I don't want to save the info into a file. ffmpeg is returning all the video info, but it's returning as an error because I'm not specifying an ...
Redtopia's user avatar
  • 5,047
106 votes
8 answers
220k views

Retrieving and Saving media metadata using FFmpeg

I want to read the metadata in media files and then save that metadata in a text/xml file, so that I can later insert that data in my database. I would prefer to use ffmpeg. Also is the same thing ...
Rahul Patwa's user avatar
  • 2,419
103 votes
4 answers
203k views

Using ffmpeg to encode a high quality video [closed]

I have a set of video frames saved as images in a directory, and I'm trying to encode these to a good quality video, however every setting and every format I try produces very noticeable artifacts. ...
CakeMaster's user avatar
  • 1,817
99 votes
5 answers
368k views

ffmpeg usage to encode a video to H264 codec format

I have a *.mp4 video file(MPEG4 video codec) and I am trying to convert this to a H264 video codec format(raw h.264 format) using ffmpeg on Linux(Version - FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, ...
goldenmean's user avatar
  • 18.7k
98 votes
7 answers
90k views

How to overlay/downmix two audio files using ffmpeg

Can I overlay/downmix two audio mp3 files into one mp3 output file using ffmpeg?
Faisal's user avatar
  • 1,337
97 votes
10 answers
133k views

How can I get the resolution (width and height) for a video file from a linux command line?

I've been digging through the mplayer/mencoder and ffmpeg documentation and I can't seem to come up with anything. I'm not especially picky as to the output format as I can use a regular expression to ...
Jeremy Logan's user avatar
  • 47.3k
97 votes
10 answers
82k views

FFMPEG: Too many packets buffered for output stream 0:1

I want to add a logo to a video using FFMPEG. I encountered this error: "Too many packets buffered for output stream 0:1.", "Conversion Failed.". I tried with diffent pictures and videos, always got ...
Michael's user avatar
  • 1,123
96 votes
5 answers
216k views

FFMPEG- Convert video to images

how can i convert a video to images using ffmpeg? Example am having a video with total duration 60 seconds. I want images between different set of duration like between 2-6 seconds, then between 15-24 ...
hack's user avatar
  • 1,503
95 votes
1 answer
125k views

How to add transparent watermark in center of a video with ffmpeg?

I am currently using these commands: Top left corner ffmpeg –i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=10:10 [out]" outputvideo.flv Top right corner ffmpeg –...
mirza's user avatar
  • 5,715
94 votes
12 answers
109k views

Solid FFmpeg wrapper for C#/.NET [closed]

I have been searching the web for some time for a solid FFmpeg wrapper for C#/.NET. But I have yet to come up with something useful. I have found the following three projects, but all of them apears ...
Jacob Poul Richardt's user avatar
93 votes
3 answers
68k views

ffmpeg.c what are pts and dts ? what does this code block do in ffmpeg.c?

In simple terms what are pts and dts values? Why are they important while transcoding [decode-encode] videos ? What does this code bit do in ffmpeg.c , what is its purpose? 01562 ist->next_pts ...
Aditya P's user avatar
  • 1,912
92 votes
6 answers
104k views

Using ffmpeg to cut audio from/to position

I need to cut parts from an audio file from position to position. When I tried this command ffmpeg -ss 132 -t 139 -i original.mp3 new.mp3 it started at the second 132, and added the next 139 ...
Mike's user avatar
  • 2,181

1
2 3 4 5
523