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
123
votes
7 answers

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 should remain the same. Try as I might everything I…
J Brand
  • 1,239
  • 2
  • 9
  • 4
119
votes
4 answers

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 and a border?
Jesper Madsen
  • 1,201
  • 2
  • 10
  • 5
117
votes
8 answers

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 n seconds of the track. Now, I know I could just…
Cheekysoft
  • 35,194
  • 20
  • 73
  • 86
114
votes
12 answers

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 output1.avi ffmpeg -i input.avi -vcodec copy -acodec…
Antony
  • 1,280
  • 2
  • 10
  • 9
112
votes
2 answers

FFMPEG mp4 from http live streaming m3u8 file?

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 @ 0000000002f07060] Packet header is not contained in…
thiago.adriano26
  • 1,491
  • 3
  • 14
  • 19
108
votes
3 answers

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.mov I guess "-map" is the correct way to do it…
Mark
  • 1,540
  • 2
  • 13
  • 21
105
votes
7 answers

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 possible with MediaInfo?? I know I can get the…
Rahul Patwa
  • 2,319
  • 4
  • 18
  • 17
105
votes
5 answers

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 is command-line driven. I have found several…
stedes
  • 1,481
  • 3
  • 13
  • 17
104
votes
19 answers

How to extract duration time from ffmpeg output?

To get a lot of information about a media file one can do ffmpeg -i where it will output a lot of lines, one in particular Duration: 00:08:07.98, start: 0.000000, bitrate: 2080 kb/s I would like to output only 00:08:07.98, so I…
Louise
  • 6,193
  • 13
  • 36
  • 36
103
votes
4 answers

Using ffmpeg to encode a high quality video

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. The basic command is this: ffmpeg -r 25 -i %4d.png…
CakeMaster
  • 1,807
  • 4
  • 16
  • 16
101
votes
4 answers

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

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 output file. The command I'm using is: ffmpeg -i…
Redtopia
  • 4,947
  • 7
  • 45
  • 68
95
votes
9 answers

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 the same error. Google didn't help much either. I…
Der Micha
  • 993
  • 1
  • 7
  • 8
95
votes
12 answers

Solid FFmpeg wrapper for C#/.NET

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 to be dead in early alpha…
Jacob Poul Richardt
  • 3,145
  • 1
  • 26
  • 29
95
votes
7 answers

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
  • 1,307
  • 1
  • 10
  • 16
94
votes
5 answers

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, Copyright (c) 2000-2009 Fabrice Bellard,) using…
goldenmean
  • 18,376
  • 54
  • 154
  • 211