Questions tagged [ffmpeg]

`ffmpeg` is a free software project aimed at producing tools (libraries and programs) for handling multimedia data.

633 questions
825
votes
12 answers

How can I reduce a video's size with ffmpeg?

How can I use ffmpeg to reduce the size of a video by lowering the quality (as minimally as possible, naturally, because I need it to run on a mobile device that doesn't have much available space)? I forgot to mention that when the video can use…
xralf
  • 16,149
  • 29
  • 101
  • 149
166
votes
10 answers

How can I use ffmpeg to split MPEG video into 10 minute chunks?

There is often a need in the open source or active developer community to publish large video segments online. (Meet-up videos, campouts, tech talks...) Being that I am a developer and not a videographer I have no desire to fork out the extra…
Gabriel
  • 1,763
  • 2
  • 11
  • 8
151
votes
11 answers

How to grep standard error stream (stderr)?

I am using ffmpeg to get the meta info of an audio clip. But I am unable to grep it. $ ffmpeg -i 01-Daemon.mp3 |grep -i Duration FFmpeg version SVN-r15261, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --prefix=/usr…
Andrew-Dufresne
  • 5,663
  • 7
  • 25
  • 19
90
votes
2 answers

Trim audio file using start and stop times

I have an FFmpeg command to trim audio: ffmpeg -ss 01:43:46 -t 00:00:44.30 -i input.mp3 output.mp3 The problem I have with this command is that option -t requires a duration (in seconds) from 01:43:46. I want to trim audio using start/stop times,…
whitewings
  • 2,377
  • 7
  • 32
  • 53
85
votes
8 answers

How do I split an audio file into multiple?

I found something for videos, which looks like this. ffmpeg -i * -c:v libx264 -crf 22 -map 0 -segment_time 1 -g 1 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*9)" -f segment output%03d.mp4 I tried using that for an audio file, but only…
DisplayName
  • 11,468
  • 20
  • 73
  • 115
84
votes
5 answers

Merge two video clips into one, placing them next to each other

I have two video clips. Both are 640x480 and last 10 minutes. One contains background audio, the other one a singing actor. I would like to create a single 10 minute video clip measuring 1280x480 (in other words, I want to place the videos next to…
user
  • 915
  • 7
  • 27
  • 38
63
votes
3 answers

Re-encoding video library in x265 (HEVC) with no quality loss

I am trying to convert my video library to HEVC format to gain space. I ran the following command on all of the video files in my library: #!/bin/bash for i in *.mp4; do #Output new files by prepending "X265" to the names avconv -i "$i"…
shivams
  • 4,505
  • 3
  • 19
  • 36
60
votes
4 answers

Encode with ffmpeg using avi to mp4

What command lines to use to convert from avi to mp4, but without destroying the framesize and making the file small as the original size or a little bit bigger, and same thing with mp4 to avi? Whenever I tried converting it became like 2 gb
dale
  • 757
  • 1
  • 5
  • 9
43
votes
4 answers

How to check if a shared library is installed?

My question originates from my problem in getting ffmpeg started. I have installed ffmpeg and it is displayed as installed: whereis ffmpeg ffmpeg: /usr/bin/ffmpeg /usr/bin/X11/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz Later, I…
Abdul Al Hazred
  • 25,760
  • 23
  • 64
  • 88
39
votes
4 answers

Strange errors when using ffmpeg in a loop

I have a bash script looping through the results of a find and performing an ffmpeg encoding of some FLV files. Whilst the script is running the ffmpeg output seems to be interupted and is outputting some strange looking errors like the one below.…
Mark Williams
  • 723
  • 1
  • 5
  • 10
39
votes
16 answers

Bash script to convert all *flac to *.mp3 with FFmpeg?

I want to convert all *.flac to *.mp3 in the specific folder. This is what I've tried, but not works: # change to the home directory cd ~/music # convert all *.flac files ffmpeg -i *.flac -acodec libmp3lame *.mp3 # (optional: check whether there are…
Kevin Dong
  • 1,139
  • 1
  • 9
  • 18
36
votes
6 answers

How to get near-perfect screen recording quality?

Someone suggested I direct a copy of the unmodified X display to a file and afterwards convert that file to a general purpose video file. What commands would I use to do this on a Kubuntu system? (Edit: He said something about attaching a display…
Oleg Pryadko
  • 2,330
  • 7
  • 25
  • 33
30
votes
2 answers

Lossless audio conversion from FLAC to ALAC using ffmpeg

Both ALAC and FLAC are lossless audio formats and files will usually have more or less the same size when converted from one format to the other. I use ffmpeg -i track.flac track.m4a to convert between these two formats but I notice that the…
Paghillect
  • 917
  • 1
  • 7
  • 14
28
votes
4 answers

Convert a video to a fixed screen size by cropping and resizing

I've tried to figure this out myself, but the myriad of options just baffles me. I want to use ideally either ffmpeg or mencoder (or something else, but those two I know I have working) to convert any incoming video to a fixed screen size. If the…
Andy Jeffries
  • 283
  • 1
  • 3
  • 7
27
votes
2 answers

How to recover a broken mp4 file: moov atom not found

I made a recording with ffmpeg -f alsa -ac 2 -i plughw:0,0 /tmp/audio.mp4 I then moved /tmp/audio.mp4 to another directory (/root/audio.mp4) without stopping ffmpeg leading to a broken .mp4 file: ffplay…
user123456
  • 4,758
  • 11
  • 52
  • 78
1
2 3
42 43