date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,326,231,956,000
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 figured out, that some programs depend on libraries that do not come with t...
Look in /usr/lib and /usr/lib64 for those libraries. If you find one of the ones ffmpeg is missing, symlink it so it exists in the other directory. You can also run a find for 'libm.so.6' and see where that file is at. There is a good chance ffmpeg is looking in the same directory for the missing ones. Symlink them o...
How to check if a shared library is installed?
1,326,231,956,000
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. I've no idea what is going on here. Can anyone point me in the right di...
Your question is actually Bash FAQ #89: just add </dev/null to prevent ffmpeg from reading its standard input. I've taken the liberty of fixing up your script for you because it contains a lot of potential errors. A few of the important points: Filenames are tricky to handle, because most filesystems allow them to c...
Strange errors when using ffmpeg in a loop
1,326,231,956,000
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 any errors printed on the terminal) sleep 60 How to get my goal?
Try this: for i in *.flac ; do ffmpeg -i "$i" -acodec libmp3lame "$(basename "${i/.flac}")".mp3 sleep 60 done
Bash script to convert all *flac to *.mp3 with FFmpeg?
1,326,231,956,000
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 port to a file.) If not possible, what is my best option for an excelle...
If your HDD allows, you can try to do it this way: First write uncompressed file: ffmpeg -f x11grab -s SZ -r 30 -i :0.0 -qscale 0 -vcodec huffyuv grab.avi here SZ is your display size (e.g. 1920x1080). After that you can compress it at any time you want: ffmpeg -i grab.avi grab.mkv Of course, you can change compre...
How to get near-perfect screen recording quality?
1,326,231,956,000
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 resulting ALAC files are much smaller than the original ones. When using a co...
Ok, I was probably a little quick to ask here but for the sake of future reference here is the answer: One should pass the flag -acodec alac to ffmpeg for a lossless conversion between FLAC and ALAC: ffmpeg -i track.flac -acodec alac track.m4a
Lossless audio conversion from FLAC to ALAC using ffmpeg
1,326,231,956,000
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 video is wider or too short for it, then centre crop the video. If it's...
I'm no ffmpeg guru, but this should do the trick. First of all, you can get the size of input video like this: ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height,width in.mp4 With a reasonably recent ffmpeg, you can resize your video with these options: ffmpeg -i in.mp4 -vf scale=720:480 ou...
Convert a video to a fixed screen size by cropping and resizing
1,326,231,956,000
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 /root/audio.mp4 [...] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f3524000b80] moov atom not found audio.mp4: Invalid data foun...
You can try and use Untrunc to fix the file. Restore a damaged (truncated) mp4, m4v, mov, 3gp video. Provided you have a similar not broken video. you may need to compile it from source, but there is another option to use a Docker container and bind the folder with the file into the container and fix it that way. ...
How to recover a broken mp4 file: moov atom not found
1,326,231,956,000
I have two *.avi files: sequence1.avi sequence2.avi How do I merge these two files using a command-line or GUI?
There's a dedicated tool to do this, avimerge: avimerge -o cd.avi -i cd1.avi cd2.avi If not installed, install transcode: Avimerge is part of transcode package: https://manpages.debian.org/jessie/transcode/avimerge.1.en.html http://manpages.ubuntu.com/manpages/bionic/man1/avimerge.1.html
How do I merge two *.avi files into one
1,326,231,956,000
Currently we're using this command within a shell script to remove silence from audio files: ffmpeg -i $INFILE -af silenceremove=0:0:0:-1:1:${NOISE_TOLERANCE}dB -ac 1 $SILENCED_FILE -y This works fine except that it removes all the silence, causing the remaining audio to be squeezed together. How can this be done whi...
The best way that I've seen is by adding the -l flag to silence as follows: sox in.wav out6.wav silence -l 1 0.1 1% -1 2.0 1% I've copied this command from Example 6 of this very useful blog post called The Sox of Silence
Remove silence from audio files while leaving gaps
1,326,231,956,000
Subtitle files come in a variety of formats, from .srt to .sub to .ass and so on and so forth. Is there a way to tell mpv to search for subtitle files alongwith the media files and if it does to start playing the file automatically. Currently I have to do something like this which can be pretty long depending on the f...
As seen in man mpv: --sub-auto=<no|exact|fuzzy|all>, --no-sub-auto Load additional subtitle files matching the video filename. The parameter specifies how external subtitle files are matched. exact is enabled by default. no Don't automatically load external subtitle file...
Play subtitles automatically with mpv
1,326,231,956,000
I would like to copy the file creation date of an mp4 file into the file's metadata. I'm pretty sure this can be done with ffmpeg and some nifty Linux commands.
You can set metadata with FFmpeg via the -metadata parameter MP4s support the year attribute according to this, but I only got it to work with the "date" field which is shown in VLC (if it is only a year) and in MPlayer and Winamp without a problem as full date. I found the date attribute by setting the year via VLC a...
Copy file creation date to metadata in ffmpeg
1,326,231,956,000
Here is a Linux audio MP3 puzzle that has been bugging me for awhile: How to trim the beginning few seconds off an MP3 audio file? (I can't get ffmpeg -ss to work with either 00:01 or 1.000 format) So far, to do what I want, I resort doing it in a GUI manner which is maybe slower for a single file, and definitely slow...
For editing mp3's under linux, I'd recommend sox. It has a simple to use trim effect that will do what you ask for (see man sox for datails - search (press/) for "trim start"). Example: sox input.mp3 output.mp3 trim 1 5 You didn't mention it, but if your aim is just to remove the silence at the beginning of files, yo...
How can you trim mp3 files using `ffmpeg`?
1,326,231,956,000
I have a bunch of videos which I want to check if they are complete or not. Some of them may be downloaded partially, but they are not faulty. How can I efficiently check if these video are completely downloaded? If I had the links, I would have checked the size of them, but I don't. I tried to use ffprobe and mediain...
ffmpeg is an OS agnostic tool that is capable of determining if a video file has been completely downloaded. The command below instructs ffmpeg to read the input video and encode the video to nothing. During the encoding process, any errors such as missing frames are output to test.log. ffmpeg -v error -i FILENAME.mp4...
How to check if a video is completely downloaded?
1,326,231,956,000
I'd like to use the new codec x265 (libx265) to encode my video collection. For this I created a lovely bash script under linux which works in general very well! But something is strange: I prohibit the output of ffmpeg to echo on my own way. With x264 (the "old" one) everything works fine. But as soon as I use x265 I...
Solution You need to add an additional parameter -x265-params log-level=xxxxx, as in ffmpeg -i /input/file -c:v libx265 -c:a copy -loglevel quiet -x265-params log-level=quiet \ /output/file.mp4 <>/dev/null 2>&1 Note that, while the FFmpeg option is -loglevel, the x25 option is log-level, with a - between lo...
bash: ffmpeg libx265 prevent output
1,326,231,956,000
I just watched the trailer for the hobbit, and a trailer for the avengers which both feature an increased framerate. A lot of the comments state that this isn't "true" 60fps since it was not shot at 60fps, but actually a lower frame-rate that has been interpolated. If this is the case, is there any way that I can co...
You can try ffmpeg -i source.mp4 -filter:v tblend -r 120 result.mp4 or this from https://superuser.com/users/114058/mulvya ffmpeg -i source.mp4 -filter:v minterpolate -r 120 result.mp4 There are filter for motion blur
FFMPEG - Interpolate frames or add motion blur
1,326,231,956,000
When I use this, the quality doesn't look bad. ffmpeg -same_quant -i video.mp4 video.avi In the ffmpeg documentation is written: "Note that this is NOT SAME QUALITY. Do not use this option unless you know you need it." Do I get with -same_quant the best quality or is there an option that gives the same quality as the...
(adapted from comments above) Depending on the codecs used (some codecs are incompatible with some containers), you could always simply copy the streams (-codec copy). That is the best way to avoid quality changes, as you're not reencoding the streams, just repackaging those in a different container. When dealing with...
How get the best quality when converting from mp4 to avi with ffmpeg?
1,326,231,956,000
I recently needed a single webcam to be shared simultaneously by 3 applications (a web browser, a videoconferencing app, and ffmpeg to save the stream). It's not possible to simply share the /dev/video* stream because as soon as one application is using it, the others cannot, and anything else will get a "device or re...
It's by design. First, let it be said that multiple processes can open the /dev/video0 device, but only one of them will be able to issue certain controls (ioctl()) until streaming starts. Those V4L2 controls define things like bitrate. After you start streaming, the kernel will not let you change them and returns EBU...
Why can multiple consumers access a *single* v4l2-loopback stream from a webcam
1,326,231,956,000
I have two commands, one that lets me record my screen to an AVI video file, and another which lets me stream a video file as a (fake) "webcam". This is really useful in apps that doesn't support selecting one screen to share (I'm looking at you Slack). command #1 (https://askubuntu.com/a/892683/721238): ffmpeg -y -f ...
Solved. Steps to solve: Unload previous v4l2loopback sudo modprobe -r v4l2loopback git clone https://github.com/umlaeute/v4l2loopback/ make && sudo make install (if you're using secure boot, you'll need to sign it first https://ubuntu.com/blog/how-to-sign-things-for-secure-boot) sudo depmod -a Load the videodev drive...
How can I stream my desktop/screen to /dev/video1 as a (fake) "webcam" on Linux?
1,326,231,956,000
Every then and now ffmpeg tells me myfile.avi: Protocol not found Did you mean file:myfile.avi if executing ffmpeg -i myfile.avi -vcodec copy -acodec copy -pix_fmt yuv420p myfile.mp4. Using ffmpeg -i file:myfile.avi -vcodec copy -acodec copy -pix_fmt yuv420p myfile.mp4 then fails: file:myfile.avi: Protocol not found...
The comment of @andcoz lead me onto the right way: the problem exists as long as /usr/lib/chromium-browser/libffmpeg.so is loaded. In my case this happens in some special use case: The libffmpeg.so is used by the Vivaldi browser for showing proprietary video formats (H.264). If I download a file via Vivaldi, and th...
ffmpeg: 'Protocol not found' for normal file name
1,326,231,956,000
Currently, ffmpeg is missing from APT packages when using the stable versions of Debian and Ubuntu. There are numerous resources (example from SuperUser, another one from Debian's documentation and the one from AskUbuntu) which explain how to install it in a different (and more complex) way than a simple apt-get insta...
Why was ffmpeg not available in the repo? For some time there was a so-called "ffmpeg" available after Debian switched to Libav, but it was not from FFmpeg. This can probably be explained best with a a rough timeline of what happened: Libav split from FFmpeg and kept the ffmpeg binary name (it also kept the names of ...
Why was ffmpeg removed from Debian?
1,326,231,956,000
I am trying to convert a VOB file copied from a DVD into an avi in Ubuntu 13.10. I tried dvdrip, which failed due to a frame count error or something. I tried acidrip as well, but it always choose an audio track I did not want to use. I would prefer to have a command line solution to create an avi with the following f...
To get rid of the subtitles I believe you can add the -nosub switch, right after the .VOB file's name. Example $ mencoder Videos/Test/VIDEO_TS/VTS_01_1.VOB -nosub -nosound -ovc x264 \ -x264encopts direct=auto:pass=2:bitrate=900:frameref=5:bframes=1:\ me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto...
How to convert a VOB file to avi?
1,326,231,956,000
I'm told it's possible to embed subtitles (.srt) into video files (.avi) using ffmpeg, but I can't find any mention of it in the man page. Is this possible? What command do I use?
From man ffmpeg: Subtitle options: -scodec codec Force subtitle codec ('copy' to copy stream). -newsubtitle Add a new subtitle stream to the current output stream. -slang code Set the ISO 639 language code (3 letters) of the current subtitle stream. So: ffmpeg -newsubtitle subtitles.srv -i video...
How can I embed subtitles into videos with ffmpeg?
1,326,231,956,000
I want to reduce the size of a video to be able to send it via email and such. I looked at this question: How can I reduce a video's size with ffmpeg? where I got good advice on how to reduce it. Problem is that I need to manually calculate the bitrate. And also when doing this I had to finish of with manual trial and...
@philip-couling's answer is close but missing several pieces: The desired size in MB needs to be multiplied by 8 to get bit rate For bit rates, 1Mb/s = 1000 kb/s = 1000000 b/s; the multipliers aren't 1024 (there is another prefix, KiB/s, which is 1024 B/s, but ffmpeg doesn't appear to use that) Truncating or rounding...
How to reduce the size of a video to a target size?
1,326,231,956,000
I read the following thread, and the solution works if I want to split a video into pieces every two minutes: Split video file into pieces with ffmpeg The problem is that I want to split a video into pieces every 15 seconds. When I use the following command: for i in {00..49} do ffmpeg -i fff.avi -sameq -ss 00:$[ i*...
I found the answer. It turns out I was having problems because I didn't have the proper FFmpeg installed, but a fork of ffmpeg. This code works for me: ffmpeg -i fff.avi -acodec copy -f segment -segment_time 10 -vcodec copy -reset_timestamps 1 -map 0 fff%d.avi fff.avi is the name of the source clip. Change -segment_t...
FFmpeg - Split video multiple parts
1,326,231,956,000
My problem is this. I have access to a server that hosts many video files, most of them are very large and not well compressed. I intend to make a reduced quality smaller size copy of these on my local machine for better access. The problem is that the server does not have ftp access. I can scp the files to my machine...
You can use sshfs to make the remote files appear in a directory on the local machine. You don't say what distro you're using on your client, but this is cribbed from the Ubuntu sshfs documentation: Install the sshfs package (aptitude install sshfs) Add your user to the fuse group (sudo gpasswd -a username fuse) Moun...
How to input a network file to ffmpeg
1,326,231,956,000
I got a new drive and I can copy files fine with simple cp on the drive. However for some weird reason I get Permission denied with ffmpeg. Permissions seem fine unless I'm missing something > ll /media/manos/6TB/ drwxrwxrwx 13 manos 4096 Apr 16 00:56 ./ drwxr-x---+ 6 manos 4096 Apr 16 00:49 .. -rwxrwxrw...
So after a lot of digging I figured the issue is with snap package manager. Apparently by default, snap can't access the media directory so we need to manually fix this. Check if ffmpeg has access to removable-media like below > snap connections | grep ffmpeg desktop ffmpeg:desktop ...
"Permission denied" with ffmpeg (via snap) on external drive
1,326,231,956,000
How to concatenate (join) multiple MP4 video files into one file interactively? There are a lot of programs that do this for two files from the command line. For instance: ffmpeg avconv MP4Box But we frequently need a solution to do this interactively.
I use MP4Box as work base. The script i suggest reads all the files one by one, verifying each one (weather it's an ordinary file), asks the user for the input filename to create. #!/bin/bash printf "### Concatenate Media files ###\n" fInputCount=0 # Reading input files IFS='' while (true) do let currentNumber=$f...
Interactively concatenate video files
1,326,231,956,000
I've recorded a .gif of the screen with ffmpeg. I've used gifsicle and imagemagick to compress it a bit, but it's still to big. My intent is making it small by removing, say, a frame every 2 frames, so that the total count of frames will be halved. I couldn't find a way to do it, neither with gifsicle nor with imagema...
There is probably a better way to do it, but here is what I would do First, split your animation in frames convert animation.gif +adjoin temp_%02d.gif Then, select one over n frames with a small for-loop in which you loop over all the frames, you check if it is divisible by 2 and if so you copy it in a new temporary ...
Remove nth frames of a gif (remove a frame every n frames)
1,326,231,956,000
I have a dilemma.. I've had a script for a while now that downloads pictures from a webcam every few minutes. The naming convention just does new_image((len(files(dir))+1) + '.jpg') and that's all fine.. until today.. I've had a Python script that loads the images based on creation date and renders them and i take the...
ffmpeg concat same file types You could use a command like this to concatenate the list of files any way you want: ffmpeg -f concat -i <( for f in *.wav; do echo "file '$(pwd)/$f'"; done ) \ output.wav The above can only work if the files you're concatenating are all the same codecs. So they'd all have to be...
ffmpeg -pattern_type glob -- not loading files in correct order
1,326,231,956,000
First part of my question: I read on the ffmpeg documentation (section 3.2 How do I encode single pictures into movies?) the following: To encode single pictures into movies, run the command: ffmpeg -f image2 -i img%d.jpg movie.mpg Notice that `%d' is replaced by the image number: img%03d.jpg means the se...
Part 1: % is not a special character, so the img%d.jpg argument is passed as is to ffmpeg which “does the job” itself. Part 2: Looking at ffmpeg documentation, I don't think there is another way to provide input files, so you may have to use symlinks or wait for the “fix”: If the pattern contains "%d" or "%0Nd", the ...
Who is doing the job: ffmpeg or the shell?
1,326,231,956,000
How do I convert a hdmv_pgs_subtitle (which is image based) to a text based subtitle in a MKV file? I have tried ffmpeg -i in.mkv -c:v copy -c:a copy -c:s mov_text out.mkv but that results with the following error: Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Stream #0:2 -> #0:2 (hdm...
Converting image based subtitles to text is a nontrivial process, as you will need some kind of OCR system to interpret the bitmaps and figure out what the corresponding text is. ffmpeg alone will not do that for you. I am not aware of any app that will do the whole process in one go, for Linux/UNIX. However, this pro...
Convert image based subtitle to text based subtitle inside MKV file
1,326,231,956,000
How to send a ffmpeg stream to the framebuffer /dev/fb0? For instance, how to send the webcam output to the framebuffer? I am looking for an equivalent of this mplayer command but using ffmpeg exclusively: mplayer -ov fbdev2 -tv driver=v4l2 device=/dev/video0 tv:// P. S.: I don't wat to pipe the output of ffmpeg to ...
There is a lot of misinformation on the web about this not being possible, however, it most definitely is possible. Note, you may need to adjust the -i and -pix_fmt a bit for your situation. ffmpeg -i /dev/video0 -pix_fmt bgra -f fbdev /dev/fb0 Also note, the user executing this must have privileges to write to the ...
How to send ffmpeg output to framebuffer?
1,482,854,250,000
I'm trying to covert all m4a to mp3 my code look like this: find . -name '*.m4a' -print0 | while read -d '' -r file; do ffmpeg -i "$file" -n -acodec libmp3lame -ab 128k "${file%.m4a}.mp3"; done but it only work for first mp3 file for next it show error: Parse error, at least 3 arguments were expected, only 1 given ...
When reading a file line by line, if a command inside the loop also reads stdin, it can exhaust the input file. Continue reading here: Bash FAQ 89 So the code should look like this: find . -name '*.m4a' -print0 | while read -d '' -r file; do ffmpeg -i "$file" -n -acodec libmp3lame -ab 128k "${file%.m4a}.mp3" < /de...
Convert all found m4a to mp3
1,482,854,250,000
I'm running Kubuntu. I don't want to install any Windows applications in wine. I would like a (relatively simple) command to convert a flash animation (.SWF file) to an animated GIF. The input .SWF file is only 14.5 KiB and I want to convert the entire thing at best quality. I'm hoping the GIF will be of similar size....
You don't mention in your post if you've tried the most basic command that should accomplish this: ffmpeg -i input.swf output.gif Assuming that works there are going to be quality problems with it, because GIF is a 256-color format. (Imgur recently extended the file format for GIFV which uses WebM video, but that's a...
Command line for converting .SWF to animated GIF
1,482,854,250,000
When running the following command line to convert multiple .mkv files into .mp4 files, things go awry. It's as if the script tries to run all the commands at once or they get entangled in each other somehow, and the output gets messy. I don't know exactly. When I ran this just now, only the first file was converted. ...
ffmpeg reads from standard input as well, consuming data meant for read. Redirect its input from /dev/null: ... | while read f; do ffmpeg -i "$f" -codec copy "${f%.*}.mp4" < /dev/null; done That said, don't read the output from ls like this. A simple for loop will suffice (and remove the original problem). for f in *...
Problem with ffmpeg in bash loop
1,482,854,250,000
I like mencoder for converting video files because it shows me how much time is remaining to the end of the conversion (in opposite to ffmpeg). mencoder file.wmv -ofps 23.976 -ovc lavc -oac copy -o file.avi The problem is that the resulting file is not the same quality as the input file. With ffmpeg there is sameq op...
Ok, first things first... ffmpeg's sameq option doesn't mean same quality, and in many cases will not do anything relevant. This is from the ffmpeg man page: -sameq Use same quantizer as source (implies VBR). This is actually from the ffmpeg online documentation ‘-same_quant’ Use same quantizer as source (impl...
Mencoder with same quality output
1,482,854,250,000
I have found a ffmpeg command to record area of my screen: ffmpeg -video_size 2000x1600 -framerate 25 -f x11grab -i :0.0+2140,280 output.mp4 But to find the correct area, I had to do multiple trial/error runs and it was tedious. Is there some possibility to select area by mouse, and have it recorded by ffmpeg ? If th...
Slop (an application that queries for a selection from the user and prints the region to stdout) appears to be the easiest tool exactly fitting your purpose… since… it provides an example linked to ffmpeg capturing straight in its readme. ;-) slop can be used to create a video recording script in only three lines of ...
ffmpeg: record screen area selected by mouse
1,482,854,250,000
Before upgrade to the latest Ubuntu I used the following command to extract mp3 from an avi file: $ for x in *.avi; do ffmpeg -vol 100 -ab 160k -ar 44100 -i "$x" "`basename "$x" .avi`.mp3"; done This worked. But since Ubuntu 12.04 I get Option sample_rate not found. when I try to execute this command. If I omit -ar 4...
Try with this instead: ffmpeg -i "$x" -vol 100 -ab 160k -ar 44100 "`basename "$x" .avi`.mp3" Before the options were in front of the input file, but it looks like you want to set them for the output file.
mp3 extraction with avconv or ffmpeg doesn't work properly anymore
1,482,854,250,000
So far I have been using the following command to split an audio file from S to E: ffmpeg -i input.mp3 -ss S -to E -c copy output.mp3 Due to the fact that I need to split an audio file into multiple segments, each having a different length, I have to use the above command multiple times for only a single file. So, is...
Sure, just give it more output files: ffmpeg -i input.mp3 -ss S -to E -c copy output1.mp3 -ss S -to E -c copy output2.mp3 … Options after the input file actually pertain to the output file (so the -c, -ss and -to options are for the output file). And you can have multiple output files. (Unlike the segments muxer, you...
Trim an audio file into multiple segments using `ffmpeg` with a single command
1,482,854,250,000
When I run the ./configure command in ffmpeg source directory I get this error: gcc is unable to create an executable file. If gcc is a cross-compiler, use the --enable-cross-compile option. Only do this if you know what cross compiling means. C compiler test failed. If you think configure made a mistake, make sure y...
Your libc installation is incomplete or broken somehow. You should say what OS you use... the easiest fix is probably to reinstall the packages that comprise the libc. Or if you are really interested in finding out exactly which part of it is broken, here are some tips: On a typical glibc installation, the references ...
error while compiling ffmpeg: gcc is unable to create an executable file
1,482,854,250,000
A standard Unixy command line approach to burning a video file to DVD is as follows (assuming) # 1. First use ffmpeg to convert to an mpg file. ffmpeg -i input.m4v -target ntsc-dvd output.mpg # 2. now do the authoring dvdauthor --title -o dvd -f output.mpg dvdauthor -o dvd -T NOTE: --title sets the title of the DV...
The basic approach is to add black borders to your video to make it fit in one of DVD's allowed aspect ratios. TLDR: skip down to In Conclusion. A few definitions First, though, I need to define a couple of different things: An aspect ratio is simply the width of something divided by the height, typically expressed a...
Burning a video file with non-standard aspect ratio to DVD
1,482,854,250,000
I have a set of videos in the folder. I would like to get the info about this videos using ffmpeg -i command and save the output to file. So I wrote the line: find . -type f -exec ffmpeg -i {} \; > log.txt But surprisingly, the log is empty! What am I missing here?
I think what might be happening here is that ffmpeg is sending its output to stderr, in which case what you want is just: find . -type f -exec ffmpeg -i {} \; 2>log.txt I don't have ffmpeg in my distro to test with, but this has been verified with avconv from libav (should still be the same in this respect).
Save find -exec output to text file
1,482,854,250,000
The way I understand man avconv (version 9.16-6:9.16-0ubuntu0.14.04.1), the following command should convert input.ogg to output.mp3 and carry over metadata: avconv -i input.ogg -map_metadata 0 output.mp3 It does not, however; ogginfo clearly shows the information (artist, album, title, ...) in input.ogg and id3info ...
Following this answer on Stack Overflow, I tinkered around and found out that the correct parameter depends on the combination of input and output format/codec. These combinations work as intended: OGG → MP3: -map_metadata 0:s:0 FLAC → MP3: -map_metadata 0:g:0 FLAC → OGG: -map_metadata 0 Using -codec libvorbis. In ...
Mapping metadata with avconv does not work
1,482,854,250,000
I'm trying to extract certain info from ffmpeg output. Sample ffmpeg output: configuration: --enable-memalign-hack --enable-mp3lame --enable-gpl --disable-vhook --disable-ffplay --disable-ffserver --enable-a52 --enable-xvid --enable-faac --enable-faad --enable-amr_nb --enable-amr_wb --enable-pthreads --enable-x264 l...
awk: It's like magic, but better. #!/usr/bin/awk -f /Duration/ {sub(/,/, "", $2); fields["dur"] = $2} /fps/ { fields["fps"] = $3 } /Video/ { sub(/.*Video:/, "", $0); sub(/\W*Apple\W*/, "", $0); split($0, arr, ", ") fields["codec"] = arr[1]; fields["res"] = arr[2]; } END { ...
extracting certain info from output
1,482,854,250,000
I have the following script to convert a big bunch of .MOD and .XM files into Wave format: #!/bin/bash for f in ./XM.* ./MOD.* do xmp $f -d wav -o - | ffmpeg -i - -acodec libmp3lame -ab 320k "$f.mp3" done But it doesn't work as expected. The program just hang up. It creates the .wav file but nothing more.(Do...
Perhaps xmp gets confused because stdin is not a tty? You could try: xmp $f -d wav -o - </dev/null | ffmpeg -i - -acodec libmp3lame -ab 320k "$f.mp3" Also, I would imagine that the order of arguments needs to be xmp -d wav -o - "$f" </dev/null | ffmpeg -i - -acodec libmp3lame -ab 320k "$f.mp3" On Ubuntu 14.04 with ...
Batch conversion of Module files with XMP
1,482,854,250,000
When I try to play audio in chromium (e.g. in google translate or any icecast radio station) it gives this error in terminal [69:97:0711/164208.951104:ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"FFmpegDemuxer: open context failed"} [69:69:0711/164208.951234:ERROR:render_media_log.cc(30)]...
I had the same problem. It happened after the last chromium upgrade. This is the email which described things changed in ~deb9u1. livewire98801 suggests installing a different version of chromium. However installing packages from testing into stable is not advised: Don't make a FrankenDebian Debian Stable should not ...
Chromium "FFmpegDemuxer: open context failed" when playing audio
1,482,854,250,000
There are many audio and video players but I prefer to use one tool for many purposes. And so I thought of using ffplay as both audio and video player. To play a file the command is like this. ffplay path_to_audio_file.mp3 Fine, but how do I play a list of audio files or a list of videos? I tried to use: ffplay *.mp3...
ffplay appears to only support a single input file, so you'll need to use code to loop over a list of input files (and possibly to shuffle them); wildly assuming coreutils (for shuf), perhaps something like: find musicdir -type f -name "*.mp3" | shuf | while read f; do ffplay -autoexit -- "$f"; done This will of cour...
How do I use ffplay to play a list of audio files
1,482,854,250,000
I tried to enable libass for ffmpeg with this --enable-libass in command but it didn't recognise the command. Does anyone know how to enable libass on Linux?
First you need to make sure that your particular version of ffmpeg was built with and supports that switch. You'll also likely need to make sure that the library libass is installed as well. You don't specify your Linux distro but I did notice that libass is available in my stock Fedora 19 repository so it's trivial t...
How to enable libass on Linux?
1,482,854,250,000
What is the ffmpeg command to record screen and internal audio (on Ubuntu 18.04)? I'll omit the many things I tried that did not work and skip to the something close to what I am looking for; V="$(xdpyinfo | grep dimensions | perl -pe 's/.* ([0-9]+x[0-9]+) .*/$1/g')" A="$(pacmd list-sources | grep -PB 1 "analog.*moni...
Framerate applied to both streams, but since ffmpeg documentation examples are scattered I'll leave an answer here A="$(pacmd list-sources | grep -PB 1 "analog.*monitor>" | head -n 1 | perl -pe 's/.* //g')" F="$(date --iso-8601=minutes | perl -pe 's/[^0-9]+//g').mkv" V="$(xdpyinfo | grep dimensions | perl -pe 's/.* ([...
record screen and internal audio with ffmpeg
1,482,854,250,000
Today I learned of a Windows-only product today called the Overwolf Replay HUD, which lets the user press a key to replay the last 20 seconds of happenings on their screen. It's meant for people playing or spectating fast-paced videogames who want to quickly review a hectic moment. I'm trying to duplicate that behavi...
The segment muxer will work. Step 1: ffmpeg -i input force_key_frames expr:gte(t,n_forced*4) -c:v libx264 -c:a aac -f segment -segment_time 4 -segment_wrap 6 -segment_list list.m3u8 -segment_list_size 6 seg%d.ts This will save the recording in segments of 4 seconds. Once 6 segments have been written, the next segment...
How can I record my desktop into a "replay buffer", so I can replay the last x seconds?
1,482,854,250,000
As noted here, we could speedup audio with ffmpeg using: $ ffmpeg -i input.mkv -filter:a "atempo=2.0" -vn output.mkv But on Ubuntu, ffmpeg is replaced by avconv, and the atempo filter is not available in avconv. My question is: Are there any alternatives to the atempo filter to use with avconv, or how to speed up au...
It is possible to circumvent the fact that the atempo filter is not available for avconv(yet the setpts video filter is). Simply use another tool like sox to do the audio part(adjust mapping depending on streams): avconv -i input.mkv -c copy -map 0:0 video.raw #copy raw video stream avconv -i input.m...
Is there any equivalent to the atempo ffmpeg audio filter but for avconv to speed up video & audio?
1,482,854,250,000
When you want to extract two minutes of a video file from minute 2 to minute 4, you will use command ffmpeg -i input.mpg -sameq -ss 00:02:00 -t 00:02:00 output.mpg I'd like to split the video into two minutes chunks. I have an idea to use a bash script, but there are a few errors. for i in seq 50; do ffmpeg -i input....
You forgot to use backticks - or better: $( ) subshell - in the seq invocation. This works: for i in $( seq 50 ); do ffmpeg -i input.mpg -sameq -ss 00:`expr $i \* 2 - 2`:00 -t 00:02:00 output.mpg; done Another thing is that you probably don't want output.mpg to be overwritten in each run, do you? :) Use $i in the out...
Split video file into pieces with ffmpeg
1,482,854,250,000
I'm using avconv for trimming and converting videos. Let's say I want to drop the first 7 and last 2.5 seconds of the video stream and one audio stream of an one-hour mts file: avconv -i input.mts -map 0:0 -map 0:3 -ss 0:0:07 -t 0:59:50.5 out.mov This works so far, but now I want to add two seconds of fading in and o...
I finally found the time to try the answer suggested by @Mario G., but it seemed extremely cumbersome. I need to do this many dozens of times. I read the documentation of ffmpeg and found it much more powerful than avconv, including fading for audio and video, so the solution is ffmpeg -i input.mts -map 0:0 -map 0:3 -...
trim and fade in/out video and audio with avconv (or different tool)
1,482,854,250,000
How can I determine whether the internal microphone of my laptop is used or not in one single command? Example: The output of the command should be different once a ffmpeg capture is run: ffmpeg -f alsa -ac 2 -i plughw:0,0 recording.mp4
Look into /proc/asound/card0/pcm0p/sub0/status; it's either closed or something like state: RUNNING owner_pid : 6371 trigger_time: 51690.093652120 tstamp : 0.000000000 delay : 51156 avail : 210988 avail_max : 229376 ----- hw_ptr : 79916 appl_ptr : 131072
How to know if my microphone is used or not?
1,482,854,250,000
While searching through U&L I noticed a fair amount of questions asking how to script the generation of ffmpeg command lines like these: ffmpeg -i video.mp4 -ss 00:00:00 -t 00:10:00 -c copy 01.mp4 ffmpeg -i video.mp4 -ss 00:10:00 -t 00:10:00 -c copy 02.mp4 ffmpeg -i video.mp4 -ss 00:20:00 -t 00:10:00 -c copy 03.mp4 I...
Is it because the missing -map option, which designates the input streams as a source for the output file. I'm using ffmpeg 2.6.1 and is able to split the video with -segment_times: ffmpeg -i foo.mp4 -segment_times 10,20,30,40 -c copy -map 0 -f segment %03d.mp4 If you need more elaborate splitting, you can use OpenC...
Anyone gotten the switch '-segment_times' working with ffmpeg?
1,482,854,250,000
I am trying to get the duration of a bunch of files in current directory and its sub-directories all ending in .mp4. I'm trying to use ffprobe. To make things simple, I am not using find, but ls. If it only lists durations in seconds, it will be fine, since summing them all up would probably be beyond me! My current...
With exiftool: $ exiftool -ext mp4 -r -n -q -p '${Duration;$_ = ConvertDuration(our $total += $_)}' . | tail -n 1 4 days 22:14:59 The main difference from @don_cristi's answer to a very similar question, being the -r -ext mp4 which lets exiftool look for files with extensions recursively.
How to get the total duration of all video files in current folder and sub-directories [duplicate]
1,482,854,250,000
I want to cut a video into about 10 minute parts like this. ffmpeg -i video.mp4 -ss 00:00:00 -t 00:10:00 -c copy 01.mp4 ffmpeg -i video.mp4 -ss 00:10:00 -t 00:10:00 -c copy 02.mp4 ffmpeg -i video.mp4 -ss 00:20:00 -t 00:10:00 -c copy 03.mp4 With for it will be like this. for i in `seq 10`; do ffmpeg -i video.mp4 -ss 0...
BASH isn't that bad for this problem. You just need to use the very powerful, but underused date command. for i in {1..10}; do hrmin=$(date -u -d@$(($i * 10 * 60)) +"%H:%M") outfile=${hrmin/:/-}.mp4 ffmpeg -i video.mp4 -ss ${hrmin}:00 -t 00:10:00 -c copy ${outfile} done date Command Explained date with a -d fla...
how to convert number to time format in shell script?
1,482,854,250,000
I love VLC's option of slowing down audio playback. Now I want to take my mp3-files to a portable player and play them there. Unfortunately the player does not have a slow down option. How can I convert mp3s so they sound like being played slowly using VLC? I will prefer a command line tool, but will accept other free...
I recommend using SoX like this: sox <input> <output> tempo 0.5 This slows down <input>'s tempo by a factor of 2 and record the result to <output>. You can add option --show-progress to display relevant information and progression percentage. Note that if <input> is for instance normal.wav and <output> is half-tempo....
Slow down mp3 audio
1,482,854,250,000
A ffmpeg webcam capture is running in the background. ffmpeg -f video4linux2 -s vga -i /dev/video0 capture.mp4 (1) I am therefore unable to read it with ffplay since the device /dev/video0 is used: ffplay -f video4linux2 -s vga -i /dev/video0 (2) [...] /dev/video0: Device or resource busy How t...
Do this: sudo modprobe v4l2loopback devices=1 If you get similar error like modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/4.6.0-kali1-amd64, just install v4l2loopback-dkms first, e.g.: sudo apt-get install v4l2loopback-dkms Now run it first (Note that it can't run as background process by ...
How to read a webcam that is already used by a background capture?
1,482,854,250,000
I have a video and I want to extract every 10th frame as I am getting way too many images. ffmpeg -i out1.avi -r 1 -f image2 image-%3d.jpeg How to extract images from video file?
If you want 1/10 of what you have now (when you use -r 1) then use -r 0.1 It will get 1 frame every 10 seconds instead of 1 frame every 1 second. ffmpeg -i out1.avi -r 0.1 -f image2 image-%3d.jpeg EDIT: If you really what every 10th frame from video then you can use select with modulo 10 ffmpeg -i out1.mp4 -vf "s...
How to extract every 10th frame from a video?
1,487,619,657,000
I'm compiling FFMPEG from source using the guide for Ubuntu which I've used before with success. I'm compiling on a Vagrant virtual machine in VirtualBox on Ubuntu server 14.04. You can clone the project and vagrant up, and you'll have FFMPEG installed in the box: github.com/rfkrocktk/vagrant-ffmpeg. I'm using Ansib...
My problem lay in the fact that I never ran ldconfig after installing everything. In order for shared object libraries to be found on Debian, you must run sudo ldconfig to rebuild the shared library cache.
Compiling FFMPEG from source: cannot find shared library
1,487,619,657,000
I hear a mp3 that is extracted from some tv dramas as a English exercise. So in that mp3 there are lot of "silence part" in which no one speaks and there is no background music. Is there a way to remove that silence part by using ffmpeg or some other program from command line?
You could use SoX - Sound eXchange. To remove silence from file: sox input.mp3 output.mp3 silence 1 0.1 1% -1 0.1 1% Also there is a good tutorial: The SoX of Silence | digitalcardboard.com
How to remove silence part from mp3 that is extracted from tv drama
1,487,619,657,000
I have a local video and I want to stream it to a dummy webcam video device from v4l2loopback. I created the dummy device at /dev/video1. How to use ffmpeg to steam that local video trial_video.mp4 to the dummy device?
Based on this AU Q&A titled: Is there any way ffmpeg send video to /dev/video0 on Ubuntu? you can do the following: $ ffmpeg -re -i trial_video.mp4 -map 0:v -f v4l2 /dev/video1
How to stream a local video to webcam using ffmpeg?
1,487,619,657,000
I'm processing a variety of audio files in a bunch of different formats and I'd like to unify their format and configuration using FFMPEG and SoX. There are two steps to my process: Convert the file, whatever it may originally be, to a PCM 16-bit little-endian WAV file: ffmpeg -i input.wav -c:a pcm_s16le output.wav P...
I think sox needs to seek its input if it is to determine the input format from the file's header, and that's incompatible with a pipe. I think ffmpeg can do all you want, though I'm not completely sure. I'm unfamiliar with it and the documentation is clear as mud. ffmpeg -i "$input" -compression_level 9 -ac 2 -ab 441...
Piping Sox and FFMPEG together
1,487,619,657,000
I want to extract frames as images from video and I want each image to be named as InputFileName_number.bmp.  How can I do this? I tried the following command: ffmpeg -i clip.mp4 fr1/$filename%d.jpg -hide_banner but it is not working as I want.  I want to get, for example, clip_1.bmp, but what I get is 1.bmp. I am tr...
$filename is handled as a shell variable. What about ffmpeg -i clip.mp4 fr1/clip_%d.jpg -hide_banner or $mp4filename=clip ffmpeg -i ${mp4filename}.mp4 fr1/${mp4filename}_%d.jpg -hide_banner ? Update: For use with gnu parallel, you can use parallel's -i option: -i Normally the command is passed the argument at the...
How to include input file name in output file name in ffmpeg
1,487,619,657,000
I created a mp4 file from video, audio and .srt file. ffmpeg -i video.mp4 -i audio.m4a -i sub.srt -map 0:0 -metadata:s:v:0:0 language=eng -map 1:0 -metadata:s:a:0:0 language=eng -map 2:0 -metadata:s:s:0:0 language=eng -c copy -scodec mov_text out.mp4 It works fine, but subtitle is not shown by default. Is there way ...
You can use MP4Box 0.6.2-DEV-rev453 (May 2016) or higher to do this: mp4box -add xr.mp4 -add xr.en.srt:txtflags=0xC0000000 -new ya.mp4 This will mark the subtitle stream in the output file as forced. However, this mark will only be recognized starting with VLC 3.0.0-20161101 (Nov 2016). I have seen mentions to this ...
How to set default subtitle with ffmpeg
1,487,619,657,000
I recently installed spotdl (Spotify Downloader) by following the instructions given at GitHub's Installation page. However, when I try to run the tool and execute the commands provided at the project page, Terminal results with the following message: spotdl: command not found. I am rather an inexperienced user with L...
Python 2 and Python 3 can be installed on the same system without conflict. You can install the Python 3 version of pip similar to how you installed the Python 2 version: sudo apt install python3-pip Now, you you should be able to use pip3 to install spotdl: pip3 install spotdl I just tried this on my own system and...
Pop!_OS: Spotify Downloader (spotdl: command not found)
1,487,619,657,000
I want to convert a bunch of Webp images to individual PDFs. I'm able to do it with this command: parallel convert '{} {.}.pdf' ::: *.webp or I can use this FFMPEG command: find ./ -name "*.webp" -exec dwebp {} -o {}.pdf \; However during the process of conversion the Webp files are decoded and the resultant PDFs have...
Why not just use Imagemagick and Ghostscript? convert img.webp img.pdf gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dPDFSETTINGS=/ebook -sOutputFile=img-small.pdf img.pdf In my test with your sample file I got a pdf result of about 3.2 MB. EDIT You could follow these instructions on Ubuntu to make sure that imagemagick wa...
Convert Webp to PDF
1,487,619,657,000
I have some .mkv files that contain 6.1 audio in FLAC format. mediainfo reports the audio track in these files as: Audio ID : 2 Format : FLAC Format/Info : Free Lossless Audio Codec Codec ID : A_FLAC Duration : 2mn 29s Bit rate mode ...
Partial answer (untested): So the main problem seems to be that you are stuck with an optical/coax S/PDIF connection for some reason, which doesn't have enough bandwidth (actually, as you say, it even doesn't even have enough bandwidth for more than two uncompressed audio channels; the 5.1 variant is already compresse...
Convert audio inside MKV to AC3 or DTS preserving 6.1 channels
1,487,619,657,000
I have Slackware installed on my computer, and I install a lot of software from source. Now I want to install ffmpeg from source just to recompile it with some more options. But I already have ffmpeg installed on my computer, so what's gonna happen? Is it going to overwrite my old install or is it going to create new...
If you use the configure, make, make install routine to install software under any Linux distro, then the new version will usually overwrite the previous. The only caveat is that if the newer version happens to change the install location or names of certain files then you may end up with the old version or parts of t...
New source install over existing one
1,487,619,657,000
I am emulating a screen with Xvfb, and I want to capture it with ffmpeg. In order to prevent frame dropping or duplication, I would like to capture at the exact refresh rate of the screen, but it seems that Xvfb does not … have this? xrandr confirms that it's 0.0: $ Xvfb :123 -ac -nolisten tcp -screen 0 1920x1080x24 &...
Frame rate comes from movie projectors, where you have an image in a box ("frame") and it is flashed on the screen for some time, and then blanked, and another frame flashed up for some time, and your persistence of vision makes this look like objects moving in a picture. The first graphical video displays for comput...
What is the "native" frame rate of an Xvfb screen?
1,487,619,657,000
I have a bunch of audio files from each of which I need to cut out the last 1 second. The audio files are of arbitrary lengths. What is the best tool/way to do this? I am somewhat familiar with ffmpeg, but AFAIK, it does not have a direct option to do this (the starting and ending times have to be provided with -ss an...
Inspired by answers to other questions on this site, I was also able to make something up. This command can be passed to find as an exec option ffmpeg -i FILE1.wma -ss 0 -to $(echo $(ffprobe -i FILE1.wma -show_entries format=duration -v quiet -of csv="p=0") - 1 | bc) -c copy FILE2.wma The part in the middle $(echo $(...
Trim last x seconds of audio files
1,487,619,657,000
I have a directory with a bunch of CD quality (16bit 44100Hz) wave-files. How can I batch decode those into different formats (lets say FLAC, OGG and MP3) using ffmpeg? Update: here are the commands one by one as suggested by @StephenHarris ffmpeg -i input.wav output.ogg ffmpeg -i input.wav output.mp3 ffmpeg -i input...
ffmpeg accepts multiple output formats. Set the input file.format with -i followed by the output file.format: ffmpeg -i input.wav output.ogg output.mp3 output.flac Batch conversion: As a simple one liner with putting each format in a separate folder: mkdir mp3 ogg flac; for i in *.wav; do ffmpeg -i "$i" -b:a 320000 "...
Batch convert (decode) audio into multiple formats with ffmpeg
1,487,619,657,000
I have folder with files named like 0001.mp4, 0002.mp4, ... I want to merge all these files to a combined.mp4, and I want it to have an internal chapter marks. It is convenient when playing for example in vlc, as you can see the chapter names in timeline. How can I make such combined.mp4? Preferably, command line scr...
Chapters info is stored in file metadata. Ffmpeg allows to export metadata to file, and load metadata from file. Documentation is here: ffmpeg metadata 1 Now we need to prepare a metadata file, that we will use for combined.mp4. And we can do this in one go, without the need to first make combined file from all files,...
How to merge multiple mp4 files as chapters in a final mp4?
1,487,619,657,000
I combine multiple audio files with FFMPEG as ffmpeg -i 1.mp3 -i 2.mp3 -i 3.mp3 \ -filter_complex '[0:0][1:0][2:0]concat=n=3:v=0:a=1[out]' -map '[out]' out.mp4 Then, I add a still image to the created video as ffmpeg -loop 1 -framerate 1 -i photo.jpg -i out.mp4 -tune stillimage -shortest out2.mp4 How can I add the ...
Use ffmpeg -loop 1 -framerate 1 -i photo.jpg -i 1.mp3 -i 2.mp3 -i 3.mp3 \ -filter_complex 'concat=n=3:v=0:a=1' -tune stillimage -shortest out.mp4
How to add an still image while combining multiple audio files in FFMPEG
1,487,619,657,000
I looked at the following link: Trim audio file using start and stop times But this doesn't completely answer my question. My problem is: I have an audio file such as abc.mp3 or abc.wav. I also have a text file containing start and end timestamps: 0.0 1.0 silence 1.0 5.0 music 6.0 8.0 speech I want to spli...
I've just had a quick go at it, very little in the way of testing so maybe it'll be of help. Below relies on ffmpeg-python, but it wouldn't be a challenge to write with subprocess anyway. At the moment the time input file is just treated as pairs of times, start and end, and then an output name. Missing names are repl...
Split audio into several pieces based on timestamps from a text file with sox or ffmpeg
1,487,619,657,000
If I download a video using youtube-downloader I can watch the part file while downloading (in my case using mpv). Suppose I cannot or don't want to select a format containing both video and audio then the audio in the part file is missing because it is downloaded and merged after the video download is complete. Is th...
Option 1: You can select a video download format that contains a mixed/muxed stream of both video and audio. For example, yt-dlp -F https://youtu.be/3QnD2c4Xovk will list formats to choose, and something like yt-dlp -f 18 https://youtu.be/3QnD2c4Xovk will choose that format. The partial file contains video and audi...
How to watch video while still downloading including audio?
1,487,619,657,000
I was reading Cut part from video file from start position to end position with FFmpeg a few days back and I tried the following and it worked. While the video part was good, I am not sure if the audio could be made better or not. This is how I went about it $ ffmpeg -ss 00:11:50 -i input.mkv -t 165 -c:v libx264 -pres...
No, there is no better way. When you copy the audio stream with -c:a copy, you are not doing any re-encoding, so you are getting the exact same quality in the source. The only way to improve the quality further beyond what the source provides is by using sound editing software to remove noise or use other features. Yo...
ffmpeg: extract audio only from a media file using the best presets (2.0)
1,487,619,657,000
I want to output a video using two videos as input, where these two videos fade (or dissolve) into each other in a smooth and repetitive manner, every second or so. I'm assuming a combination of ffmpeg with melt, mkvmerge, or another similar tool might produce the effect I'm after. Basically, I want to use ffmpeg to c...
Assuming both videos have the same resolution and sample aspect ratio, you can use the blend filter in ffmpeg. A couple of examples, ffmpeg -i videoA -i videoB -filter_complex \ "[0][1]blend=all_expr=if(mod(trunc(T),2),A,B);\ [0]volume=0:enable='mod(trunc(t+1),2)'[a]; [1]volume=0:enable='mod(trunc(t),2...
How to transition smoothly and repeatedly between two videos using command line tools?
1,487,619,657,000
When I run ffmpeg I get the following error: /usr/local/bin/ffmpeg: error while loading shared libraries: libvpx.so.1: cannot open shared object file: No such file or directory Output of ls -l /usr/lib/libvpx*: lrwxrwxrwx 1 root root 15 Nov 2 14:10 /usr/lib/libvpx.so.0 -> libvpx.so.0.0.0 lrwxrwxrwx 1 root root ...
The path is /usr/local So it looks like you compiled and installed ffmpeg manually, instead of package manager. And the problems is that ffmpeg requires a higher minor version of libvpx, recompile ffmpeg will solve this issue.
ffmpeg and libvpx: error while loading shared libraries
1,487,619,657,000
I have a bunch of mp3 files in a folder. They are recorded from cassette tape, and the individual tracks need to be separated out. This is one one the filenames: Gobbolino the Witch's Cat, 10:52 The Hare & Tortoise, 14:52 The Shoe Tree, 24:22 The Emperors New Clothes, 34:11 The Red Nightcaps, 37:07 Aldo in Arcadia (1)...
Use a loop over the file name to match track delimiters using regular expression matching with the =~ conditional expression operator. The regular expression ,\ *([0-9:]+:[0-9][0-9])\ * matches a comma followed by a timestamp with optional spaces around it. $file:e and $file:r extract the file extension through histor...
Extrating timestamps from filename to split mp3s
1,487,619,657,000
I want to record my screen with audio for practice. I saw recommendations to use this command line: ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 25 -s 800x600 -i :0.0+200,100 -c:a pcm_s16le -c:v libx264 -preset ultrafast -crf 0 -threads 4 output.mkv But ffmpeg doesn't recognize the "alsa" format or the "pulse" file. I...
ALSA support isn't inherently built into ffmpeg. You need to have the ALSA development files installed at ./configure time when building ffmpeg. The ffmpeg configure script looks for alsa/asoundlib.h and libasound. If either is missing, it simply won't build ALSA support into the program. This contrasts with other fea...
FFmpeg doesn't recognize my audio sources
1,487,619,657,000
I have put together this script for recording the microphone, the desktop audio and the screen using ffmpeg: DATE=`which date` RESO=2560x1440 FPS=30 PRESET=ultrafast DIRECTORY=$HOME/Video/ FILENAME=videocast`$DATE +%d%m%Y_%H.%M.%S`.mkv ffmpeg -y -vsync 1 \ -f pulse -ac 2 -i alsa_output.pci-0000_00_1b.0.analog-stereo....
Not sure if this will fix it for you, but I have a script that I haven't had problems with. Comparing our two scripts, the only differences I can see are: my filter_complex is just amerge I force the use of 4 threads My audio codec is mp3lame I'm thinking the audio codec change is the most relevant difference. I thi...
Desktop audio falls behind when recording microphone + desktop audio + screen using ffmpeg
1,487,619,657,000
I have an album of 11 .flac audio files. (edit: since this issue has been resolved, it's now clear that the precise names and content of the files are irrelevant, so I've renamed them): > find . -name "*.flac" ./two.flac ./ten.flac ./nine.flac ./eight.flac ./seven.flac ./three.flac ./four.flac ./five.flac ./one.flac ....
Unless you have a directory tree of files (not mentioned, and not shown in your example dataset), you can use a simple loop to process the files for f in *.flac do w="${f%.flac}.wav" ffmpeg -i "$f" -sample_fmt s16 -ar 44100 "$w" done If you really do have a hierarchy of files you can incorporate this into a f...
Bash variable truncated when passed into ffmpeg
1,487,619,657,000
I want to do the following conversion: for f in *.m4a; do ( ffmpeg -i "$f" -f wav - | opusenc --bitrate 38 - "${f%.m4a}.opus" ) & done I know I could use ffmpeg directly to convert to opus, but I want to use opusenc in this case, since it's a newer version. When I run opusenc after the ffmpeg it works fine, bu...
If you use GNU Parallel then this works: parallel 'ffmpeg -i {} -f wav - | opusenc --bitrate 38 - {.}.opus' ::: *m4a Maybe that is good enough? It has the added benefit that it only runs 1 job per cpu thread, so if you have 1000 files you will not overload your machine.
How do I run an on-the-fly ffmpeg (pipe) conversion in parallel?
1,495,379,997,000
I have an IP cam which uploads JPEG pictures to an FTP folder on my Arch Linux box whenever it detects movement in the room it is looking in. It uploads a JPEG every second until all motion activity stops. It names the JPEG files in the following way: Dissected, it means: name-of-camera(inside)_1_YEAR-MONTH-DATE-TIME...
You could generate time stamp from the date and check for span between each file. One issue, as already mentioned in comments, are daylight savings – assuming the date/times are locale specific. Using stat instead of filenames as base could help on this. But, that gain depends on how the files are uploaded (if timesta...
Need script: latest JPEGs to video, then delete old JPEGs
1,495,379,997,000
When I want to run ffmpeg I get the following error: ffmpeg: error while loading shared libraries: libtheoraenc.so.1: cannot open shared object file: No such file or directory This is output of ls \usr\lib -l | grep libtheora: -rw-r--r-- 1 root root 419238 Jan 5 2010 libtheora.a -rw-r--r-- 1 root root ...
I think I'd recommend a reinstall of libtheora0: sudo apt-get install --reinstall libtheora0 And since you have some non-unixey backslashes in your original question, let's be explicit about looking for the libraries: ls -l /usr/lib/libtheoraenc*
ffmpeg: error while loading shared libraries: libtheoraenc.so.1
1,495,379,997,000
I'm trying to record some videos using a USB camera, but I'm having some issues when using ffmpeg. If I run ffmpeg -f video4linux2 -t 00:00:10 -i /dev/video0 out.mpg, the program tries to record at 640x480 resolution and ffmpeg hangs. However, if I add the -s to ffmpeg and record at lower resolutions than 640x480 (e.g...
Figured out the reason: transcoding and raw data volume. Using the command line mentioned in my question I was reading from a raw format (yuv422), and transcoding it to mpeg-1, which was the default encoding for my version of ffmpeg. The data amount being streamed from the camera was simply too much for the processor,...
ffmpeg hangs when trying to record video on higher resolutions
1,495,379,997,000
Context I recently updated my nVidia drivers to 375.26 and recompiled FFmpeg N-83180-gcf3affa and OBS 17.0.2-5-g43e4a2e (sorry if these numbers don't mean anything, I'm not quite sure what version numbers are significant) on my Debian machine. Doing a suspend to RAM will cause OBS to stop working with its only fix to ...
FFmpeg only locks up on CUDA init if an h264_nvenc stream was started (and stopped, but this is not needed) before putting the system into suspend. If OBS never records anything with the h264_nvenc encoder before suspend, it will work fine when you login again. If OBS locks up after logging in, it will become usable b...
CUDA Context for NVENC not found after system suspend
1,495,379,997,000
I have some files Joapira___BERLINA_DEL_HIERRO.mp4 Joapira___EL_BAILE_DEL_VIVO.mp4 Joapira___EL_CONDE_CABRA.mp4 Joapira___FLAIRE.mp4 Joapira___MAZULKA_DEL_HIERRO.mp4 Joapira___MEDA_A_MANOLITO_DIAZ_ARTESANO_TALLISTA.mp4 that I want to convert to some other formats with ffmpeg and GNU parallel. For example to convert ...
Solution is —as suggested by @OleTange in a comment— to update to a newer version of parallel, i.e. GNU parallel 20161122. EVerything works again. And it is better to protect the commands from shell interaction with single quotes, i.e.: parallel --bar 'ffmpeg -i {} -map_metadata 0 {/.}.flac' ::: * and parallel --bar ...
gnu parallel with ffmpeg does not process first file
1,495,379,997,000
In Short: I tried to reinstall ffmpeg: sudo apt install ffmpeg: Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following informatio...
It looks like someone requested libavdevice58 version 7:4.3.1-6~bpo10+1 to be installed. This clashes with Debian's vanilla ffmpeg which depends on libavdevice58 version 7:4.1.6-1~deb10u1. You can explicitly request the old version by specifying the version on the command line: sudo apt install ffmpeg libavdevice58=7:...
Can't reinstall ffmpeg due to unmet dependencies in Debian / why did ffmpeg not use the specified bitrate in video conversions?
1,495,379,997,000
I'd like to use the output of ffmpeg in order to encrypt the video with openssl: I tried to use name pipe without sucess. With the command: mkfifo myfifo ffmpeg -f alsa -ac 2 -i plughw:0,0 -f video4linux2 -s vga -i /dev/video0 myfifo I get the error [NULL @ 0x563c02ce5c00] Unable to find a suitable output format f...
ffmpeg tries to guess the video format based on the filename extension. Either "set options for output format and such" as @alex-stragies states, or use a filename extension for your fifo that ffmpeg knows about. If openssl is to be run detached, also give it the encrypting password on the command line. When using a p...
How to pipe the output ffmpeg?
1,495,379,997,000
I have MOD video file. My LG TV doesn't support MOD. How can I convert MOD video file without loosing quality to modern video format to watch it on different modern TVs?
A typical video file is a container for video data. The video data itself is compressed by some codec. You therefore have to distinguish between the container format and the video codec. For a correct answer you should tell the codec type of the video data in your file. You find lots of information about your video fi...
how to convert MOD video file without loosing quality to modern popular format for TV
1,495,379,997,000
When you convert and create a 320kbps mp3 file, you may execute ffmpeg -i original.wav -b:a 320K out.mp3 But why can -b:a designate the bit rate? I've read man ffmpeg and the official ffmpeg Documentation, but -b:a and even -b aren't described at all, though some examples can be seen in them. Also, it seems the defau...
FFmpeg is made up of multiple libraries, each dedicated to certains parts of the media processing pipeline, and tools, like the ffmpeg binary, which sets up the pipeline and manages its execution. The doc page you linked to relates to the ffmpeg binary. However, bitrate is an option related to encoding, and it is docu...
How to parse ffmpeg's -b:a option?
1,495,379,997,000
I've got a side project going that requires files which are just the samples from uncompressed PCM audio. My plan was to first convert everything to WAV, then use my own scripts to strip off all the segments other than the samples. It occurs to me that converting directly to CDDA ("Red Book" audio) is the same as what...
If you just need a raw bitstream, use ffmpeg -i in.mp3 -ar 44100 -ac 2 -f s16le out.pcm where the output has no headers or other metadata. It is a raw bitstream. The two channels are interleaved i.e. {sample-ch1 sample-ch2 sample-ch1...}
Use ffmpeg to get PCM/Red Book/CDDA without WAV headers?
1,495,379,997,000
I have a Bash script of a thousand lines each containing an ffmpeg command. I start this with source script and it runs just fine. However, when I try to take control of this script in various ways, things go completely awry: If I do Ctrl + Z to pause the whole thing, only the current ffmpeg command is paused, and th...
Try running the script as a script instead of sourcing it: $ bash <scriptname>
Job control over a Bash script
1,495,379,997,000
I have a bash script that look out for files recursively under multi-sub folders, then use ffmpeg to each file. at debug, it works great if i use echo ffmpeg but the thing is, at real work where it actually needs to use ffmpeg and wait for half an hour to finish for each video, the bash script cannot successfully run ...
Instead of piping find into the loop, you could go through an intermediate file. That will ensure that the finding step and the looping step happen in sequence, with no overlap. Something like the following (I altered your expression for brevity): find \( -name '*.mkv' -o -name '*avi' \) >files <files while IFS= read ...
replace `while` with more suitable function so looping would wait for each process to end
1,495,379,997,000
I have a large mp3 file; I want to split it into 480 mp3 files in different time points. I want to know if there is an easy way to do it other than splitting it one by one. Can I provide the different splitting times in a text file and just execute one command in FFmpeg?
Use this script #! /bin/bash x="00:00:00" z=0 filename=$(basename -- "$2") ext="${filename##*.}" filename="${filename%.*}" initcmd="ffmpeg -nostdin -hide_banner -loglevel error -i $2" while read y do initcmd+=" -ss $x -to $y -c copy $filename$z.$ext" let "z=z+1" x=$y done < $1 $initcmd Make it executable with chmod...
Automating the splitting of a large mp3 file with FFmpeg into multiple files in different time points provided in a text file
1,495,379,997,000
I have a Debian Linux server (Debian GNU/Linux 8 (Jessie)) and want to install FFmpeg. I do the following steps: apt update apt install ffmpeg I then get the following error: Reading package lists... Done Building dependency tree Reading state information... Done Package ffmpeg is not available, but is referred to by...
Add the following line to your /etc/apt/sources.list: deb http://archive.debian.org/debian jessie-backports main Then run: sudo apt update sudo apt install -t jessie-backports ffmpeg
Install FFmpeg on Debian with 'apt'
1,495,379,997,000
I want to export all frames from a lot of video files, automatically in a jenkins build job using ffmpeg. This script is running fine when I ssh into the slave and execute it in the same folder: find . -name "*.mp4" -exec ffmpeg -i {} -qscale:v 1 -vf fps=6 {}_exportedFrame_%d.jpg \; It should find all mp4 files and r...
Probably ffmpeg is not in the PATH of the jenkins job. Run type ffmpeg in your terminal to see where ffmpeg is located and echo $PATH in your jenkins job and compare.
find command fails in jenkins, but not in terminal