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.

Questions about interactive use of the ffmpeg command line tool are off-topic. Please ask them on the Super User or Video Production sites.

Questions here should relate to automating or integrating FFmpeg, or usage of the libav* libraries or API. See also: , , .

FFmpeg is a free, open source project that produces libraries and programs for handling multimedia data. The most notable components are:

  • libavcodec – an audio/video/subtitle codec library used by many other projects.
  • libavformat – an audio/video/subtitle container (de)muxing library.
  • ffmpeg – a command line program for transcoding multimedia files.
  • ffprobe – a command line program for viewing detailed information about multimedia files.
  • ffplay - a command line program for playing media files. It is mostly used as a testbed for the various FFmpeg APIs.

FFmpeg is published under the GNU Lesser General Public License 2.1+ or GNU General Public License 2+ (depending on which options are enabled).

See the FFmpeg documentation and FFmpeg Wiki for additional information.

26084 questions
54
votes
3 answers

Can FFmpeg be used as a library, instead of a standalone program?

I'd like to add video conversion capabilities to a program I'm writing. FFmpeg's command line interface for doing this is simply ffmpeg -i InputFile OutputFile, but is there a way to make use of it as a library, so I can do something like…
user123003
53
votes
2 answers

ffmpeg - Convert MP4 to WebM, poor results

I am trying to encode a video to webm for playing through a HTML5 video tag. I have these settings... ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:a 128k -b:v 1M -c:a libopus output.webm The results aren't great, video has lost lot's of it's sharpness. …
fightstarr20
  • 11,682
  • 40
  • 154
  • 278
53
votes
4 answers

Extract all video frames as images with FFMPEG

I am trying to convert a MP4 video file into a series of jpg images (out-1.jpg, out-2.jpg etc.) using FFMPEG with, mkdir frames ffmpeg -i "%1" -r 1 frames/out-%03d.jpg However I keep getting errors like, [image2 @ 00000037f5a811a0] Could not open…
user780756
  • 1,376
  • 3
  • 19
  • 31
53
votes
2 answers

Fastest way to extract a specific frame from a video (PHP/ffmpeg/anything)

I have a web page, which (among other things) needs to extract a specific frame from a user-uploaded video. The user seeks to a particular part of a .mp4 in the player, then clicks a button, and an ajax call gets fired off to a php script which…
DanM
  • 7,037
  • 11
  • 51
  • 86
52
votes
2 answers

How to generate gif from avi using ffmpeg?

I'm trying to extract a part of a video into an animated gif using the following command: ffmpeg -i video.avi -t 5 out.gif It generates an animated gif but the quality is insane. However when I generate gif image using: ffmpeg -i video.avi -t 10…
Marconi
  • 3,601
  • 4
  • 46
  • 72
52
votes
6 answers

How to extract time-accurate video segments with ffmpeg?

This is not a particularly new question area around here, but I've tried what's been suggested there without much luck. So, my story: I've got a hunk of 15 seconds of straight-from-the-camera.mov video out of which I want to extract a specific…
Jim Miller
  • 3,291
  • 4
  • 39
  • 57
52
votes
4 answers

How can we transcode live rtmp stream to live hls stream using ffmpeg?

I am trying to convert a live rtmp stream to hls stream on real time. I got some idea after reading http://sonnati.wordpress.com/2011/08/30/ffmpeg-%E2%80%93-the-swiss-army-knife-of-internet-streaming-%E2%80%93-part-iv/ i am able to convert the live…
Kiran
  • 868
  • 1
  • 13
  • 23
52
votes
3 answers

ffmpeg unable to find encoder libvpx

when i run ffmpeg -y -i test.mov -threads 8 -f webm -aspect 16:9 -vcodec libvpx -deinterlace -g 120 -level 216 -profile 0 -qmax 42 -qmin 10 -rc_buf_aggressivity 0.95 -vb 2M -acodec libvorbis -aq 90 -ac 2 OUTPUT_FILE.webm it returns an error saying…
Wiz
  • 4,595
  • 9
  • 34
  • 51
51
votes
1 answer

How to use hardware acceleration with ffmpeg

I need to have ffmpeg decode my video(e.g. h264) using hardware acceleration. I'm using the usual way of decoding frames: read packet -> decode frame. And I'd like to have ffmpeg speed up decoding. So I've built it with --enable-vaapi and…
ixSci
  • 13,100
  • 5
  • 45
  • 79
51
votes
4 answers

Can ffmpeg convert audio from raw PCM to WAV?

I can convert wav file to pcm ffmpeg -i file.wav -f s16le -acodec pcm_s16le file.pcm How can I revert this operation?
xXx_CodeMonkey_xXx
  • 800
  • 1
  • 7
  • 14
50
votes
1 answer

How to Merge two videos without re-encoding

I am trying to Merge two video without re-encoding them. Currently i use a approach which is too much time consuming and resource as well. I just want to merge without re-encoding them. Currently i am using exec ( "cpulimit -l 90 ffmpeg -i…
Yogesh Agarwal
  • 631
  • 1
  • 6
  • 8
50
votes
4 answers

Android: How to configure FFMPEG latest version in android studio?

I want to configure FFMPEG in android studio but i cant get any document or link for that. Github on many FFMPEG lib available for android but that all are with old version. And how to run command in android? and i want to know after configure…
Ravi Vaghela
  • 3,420
  • 2
  • 23
  • 51
50
votes
2 answers

ffmpeg Error: Pattern type 'glob' was selected but globbing is not support ed by this libavformat build

I'm trying to convert group of ".jpg" files acting as individual frames into 1 single mpeg video ".mp4" Example parameters i used: frame duration = 2 secs frame rate = 30 fps encoder = libx264 (mpeg) input pattern = "*.jpg" output…
cyber101
  • 2,822
  • 14
  • 50
  • 93
50
votes
1 answer

Frame Number Overlay With FFmpeg

I need to overlay the frame number to each frame of a video file using ffmpeg for windows. I succeeded in overlaying a timecode stamp with the drawtext filter using this code: ffmpeg -i video.mov -vcodec r210 -vf "drawtext=fontfile=Arial.ttf:…
Kobi Versano
  • 537
  • 1
  • 5
  • 9
50
votes
3 answers

errors when decode H.264 frames using ffmpeg

I am getting the following errors when decoding H.264 frames received from the remote end of a H.264 based SIP video call. Appreciate any help in understanding there errors. non-existing PPS 0 referenced decode_slice_header error non-existing PPS 0…
John Qualis
  • 1,663
  • 4
  • 33
  • 52