date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,495,379,997,000
I'd like to run ffmpeg -x11grab for a specified amount of time, sneding the output to a file. (This is on a Debian system, ffmpeg 7:4.0.2-1) I have already tried the -t switch, as below: ffmpeg -f x11grab -y -r 60 -video_size 1920x1080 -i :0.0 -t 10 -vf format=gray -pix_fmt yuv420p myfile but it won't stop after 10...
I would like to suggest the timeout command. I use it with ffmpeg to record a live HTTP stream. $ timeout --help Usage: timeout [OPTION] DURATION COMMAND [ARG]... Start COMMAND, and kill it if still running after DURATION. DURATION is a floating point number with an optional suffix: 's' for seconds (the default), 'm'...
Can I run ffmpeg -f x11grab for a specified amount of time?
1,495,379,997,000
I installed a package (don't remember which one but that shouldn't be too important) and needed "the real" ffmpeg so I purged the debian package for ffmpeg and installed the other version manually. The problem is that I now can't install or update any packages without aptitude telling me that xyz package requires ffmp...
It is not recommended to install random packages with dpkg. Read the whole answer before taking any action Apt is having an issue because it has not associated with your install of ffmpeg. As far as it is concerned you do not have ffmpeg installed and is giving you the above error because of this. Your output of apt-c...
How do I tell aptitude that a package was installed manually?
1,495,379,997,000
I have a couple of radio plays of various series. Some are already single-track, some are multi-track. I want all to be single-track. I don't mind re-encoding; in fact I want to transfer them to my mobile device and prefer opus output. From inside a folder of a single audiobook, this seems to do the trick, converting ...
You have demonstrated multiple anti-patterns in your code which could be improved. See Why you shouldn't parse the output of ls(1). You don't need to parse the output of ls command and avoid using multiple shell pipe-lines with tr command and find. It is recommended better to use the glob options provided by the nativ...
How can I convert a folder of audio files into a single file (iterate over many folders)?
1,495,379,997,000
I'm trying to convert an AAC file into WAV in order to pipe the output into LAME. I'm looking to do this, specifically: find . -maxdepth 1 -type f -iname "*.m4a" | sort | while read file; do ffmpeg -i "$file" -acodec pcm_s16le -ac 2 - | lame -b 256 -m s -q 0 - output.mp3 done I get the following error: Unable to ...
Thanks to the prompt from Miati's answer, I figured it out: ffmpeg -i file.m4a -f wav -acodec pcm_s16le -ac 2 - | \ lame -m s -b 320 -q 0 --replaygain-accurate - file.mp3 The format needs to be set when outputting to stdout.
Convert to WAV using FFMPEG for pipe into LAME?
1,495,379,997,000
I have several video files in a directory and I want to convert all of them into other video formats. Is there any way that I can convert all of them in just one go using FFMPEG. I mean without having to make a shell script for doing so.
The easiest way would be to use a for loop of your shell of choice. This task is so simple, you can just use the prompt, there's no need to create a shell script. Here is the one-liner as an example for the widely-used bash (and compatible): for i in *.mkv; do ffmpeg -i "$i" … ;done
How to convert a group of video files using FFMPEG?
1,495,379,997,000
I'm using a program which continuously writes MPEG-TS video data to a file while it's running. I'm expecting it to run continuously for many days. I want to use ffmpeg to transcode this video data live. So that the .mts file doesn't grow continuously until I run out of hard drive space, I'm trying to get the first pro...
Simply open that fifo for writing (and keep it open) from another place, too. Example: In a window: mkfifo /tmp/test.mts exec 7<>/tmp/test.mts ffmpeg -i /tmp/test.mts out.mp4 In another window: cat ... >/tmp/test.mts cat ... >/tmp/test.mts The idea is that a reader won't receive an EOF from a pipe until all processe...
How can I stop ffmpeg from quitting when it reaches the end of a named pipe?
1,495,379,997,000
I am trying to download the ffmpeg package and all of its dependencies into a directory on my computer. I use this code to do it sudo apt-get download $(apt-rdepends ffmpeg|grep -v "^ ") It works for the most part until it runs into this: W: Can't drop privileges for downloading as file '/home/daslab/compression/d...
You’re not missing a permission, you’re giving apt-get too much privilege; drop the sudo: apt-get download $(apt-rdepends ffmpeg|grep -v "^ ") apt-get download runs fine as a normal user. (Technically, you could give the _apt user access to the target directory, but it’s simpler and better to drop sudo.)
What permission am I missing here?
1,495,379,997,000
I'm running: ffmpeg -i rtmp://localhost/test -crf 20 -t 00:10:00 ./video/hq/1503411993750.mp4 >> out.log 2>>error.log And expecting >> out.log 2>>error.log to result in stdout to out.log and stderr to error.log. When I tail both of these files during the process I get unexpected results. The contents of error.log see...
Apparently all diagnostics messages in ffmpeg are sent to stderr, so the problem isn't syntax. -A normally running ffmpeg task seems to send all it's output (even when there are no errors) to STDERR even with no errors. This depends on what you mean with "output": ffmpeg sends all diagnostic messages (the "console ...
ffmpeg command >> out.log 2>>error.log
1,495,379,997,000
I want to convert DAV format video clips from CCTV recorders to AVI using command as below (convert test - 1.dav to test - 1.avi) ffmpeg -y -i test\ -\ 1.dav -vcodec copy -movflags +faststart test\ -\ 1.avi It works properly on x86_64 Linux with ffmpeg ver 2.4.13 and Synology with ffmpeg ver 2.0.2. File after convert...
Newer ffmpeg version refuses to mux H.264 encoded video without startcodes to AVI. You should use -bsf:v h264_mp4toannexb as it is indicated in ffmpeg output. This will not reencode your video.
DAV to AVI conversion failed
1,495,379,997,000
When trying to convert either an mp3 or flac file to ogg, the output ogg file is actually a flac file with a large file size. For instance: running for file in *.mp3; do ffmpeg -i "${file}" "${file/%mp3/ogg}"; done and then checking the file with mediainfo output.ogg gives: General Complete name ...
As you can see in the output, you encoded your audio into Format : FLAC. This is a format with lossless compression. ogg is just a container, and can hold different formats. To keep a similar size and quality as your mp3 you can choose the more usual vorbis format explicitly: ffmpeg -i in.mp3 -c libvorbis out.ogg The...
Converting files to OGG with FFMPEG produces an extremely large file
1,495,379,997,000
I am working on a project in which the user can upload videos. Is there any way with FFmpeg I can take some images from the video and create a GIF out of it? As the project is in Java, I have a way to get an image from a video, but to create a GIF requires multiple images, and it's proving costly. The server is runni...
I do scene extracting from videos using vlc for linux. If you don't have it, use apt-get install vlc to install it. Once installed, you can use a variance of the following command line to extract frame(s) out of your video. The default image format is png and it is good for my purpose. If you insist on gif images, I ...
FFMpeg : Converting a video file to a gif with multiple images from video
1,495,379,997,000
I have various video files as MKV, including some high-def (1080p) with FLAC audio. These can be played fine on a several-years-old PC with a mid-range graphics card (using mpv/ffmpeg), but when I tried to play them on a Kindle Fire HD8 (using VLC for Android) it caused it to choke. How can I reencode them such that t...
I ended up doing something like: ffmpeg -i input-file.mkv -vcodec h264 -s:v 1280x800 -acodec copy output-file.mkv Of note: using -vcodec copy doesn't work, since that bypasses the decode/encode altogether and thus doesn't allow applying filters. Downscaling the video to this degree ended up shrinking the files dramat...
How best to reencode video for lower-performance playback?
1,495,379,997,000
I wish i can find ffmpeg help here at stackexchange. I'd been re-encoding old videos to libx264 to save up some storage space, as I thought it should be working based on documentation seems failing to me. I'd been using the snippet below to re encode all files: ffmpeg -i "$file" -y -acodec copy -vcodec libx264 -scodec...
ERROR: type should be string, got "\nhttps://trac.ffmpeg.org/wiki/How%20to%20use%20-map%20option#Example4\n-map 0 would map all the streams, then keep them as it is then just state which codec to re-encode.\ni should read more.\n"
ffmpeg -acodec copy does not copy all audio stream to the new container
1,422,617,062,000
I want to generate a video with the exact same settings as an existing video. I can run: ffmpeg -i original.mp4 To get human-readable info about the contents: Duration: 00:05:32.32, start: 0.000000, bitrate: 474 kb/s Stream #0.0(und): Video: h264, yuv420p, 480x360, 25 tbr, 25 tbn, 50 tbc Stream #0.1(und): Audio:...
There is no built-in option to do this, so you would need to write a program to do it. You need to parse the output of ffmpeg -i. Then you need to build a string containing all of the relevant information, formatted as a command line. It would need to know how to handle any properties that concern you. As Graeme noted...
Can I get the ffmpeg command-line from an existing video?
1,422,617,062,000
I'm struggling with ffmpeg. My webcam can do 720p at 30fps, but only when using the MJPEG codec: ~> v4l2-ctl --list-formats-ext ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'YUYV' Name : YUV 4:2:2 (YUYV) -- cut -- Size: Disc...
You don't say what options you're using but I did find these 2 examples. Do these work for you? ffmpeg -i <input_file> -vcodec mjpeg -qmin 1 -qmax 1 -o <output_file.avi> ffmpeg -i <input_file> -vcodec mjpeg -qscale 1 <output_file.avi> For the second example, I found a note that mentioned that the -qscale ... switch m...
Recording a webcam using ffmpeg
1,422,617,062,000
I have a mix of MP4 files some of them only have audio data while the others have video and audio data. I want to find a way to convert the ones that don't have any video data to MP3 without checking each file one by one.
Run on an input to check if it has video ffmpeg -i INPUT -map v -vframes 1 -c copy -f null - The exit code will be 0, if it has video.
How to tell if a MP4 has video data and then convert it to an MP3 if there is only audio data in the file
1,422,617,062,000
I need to split wav files into multiple 10-second-long wav files, but each resulting wav file must be exactly 10 seconds in length, adding silence if needed – so if a wav file's duration in seconds isn't a multiple of 10, the last wav file should be padded with silence. I've seen some answers (1, 2, 3) which show how ...
Split the files, inspect the resulting files (for i in *wav), if (length < 10 seconds), pad them. To get the wave file length: sox --info -D file.wav To pad the wave file: https://superuser.com/questions/579008/add-1-second-of-silence-to-audio-through-ffmpeg Maybe do some calculations :-)
split wav file into parts of equal duration, padding with silence if needed
1,422,617,062,000
Now I am writing a script for a long time, but lately this problem has drives me crazy. I tried everything but couldn't solve it. find . -iname "*.mp4" -type f -exec ffmpeg -i "{}" -c:a "$ACODEC" -c:v "$VCODEC" -vf \ "subtitles={}.$SUBEXTE:'force_style=fontsize=$FSIZE,fontname=$FNAME'" \ "{}.$EXTE" -hide_banner \;...
A single quoted string can never contain a single quote. A solution to this conundrum would in your case be to replace each internal ' in your in-line sh -c script with '\'' (or '"'"'). What this does is to temporarily break out of the single quoted string (the first ' in '\'' ends the single quoted string), insert ...
Single quote problem in "sh -c" script launched from "find"
1,422,617,062,000
I have loads of videos named different things and different extensions (some mp4 some wmv etc). I would like to run the command below but on every video in a specific directory and then save that in another directory, no overwrites of original files. Some videos maybe duplicates, if that happens it should pause the sc...
You can process every file in a directory using the find command with the -execdir flag. Example: find /home/videos/unprocessed -type f \ -execdir ffmpeg -i '{}' -f mp4 -vcodec libx264 -preset fast \ -profile:v main -acodec aac -movflags +faststart '/home/videos/processed/{}.mp4' \; -type f indicates that you w...
ffmpeg mass transcode videos in directory
1,422,617,062,000
I'm having trouble trying to build a static binary of ffmpeg - I've got almost the whole build working, with the exception of two libs - libvorbis and libmp3lame. These two libs are failing during ./configure, specifically on undefined functions from the math.h / libm: libvorbis: gcc -L/vol/build/lib -static -static-...
Well, I managed to solve it - googling the mangled symbols such as _ZGVbN2v_cos led me to this patch mentioning vector math, and in combination with ldd's output during dynamic linking mentioning libmvec, I realized that I might have to link that in as well. For libmp3lame, it has to be linked in before libm: gcc -L/v...
Error during static build of libvorbis and libmp3lame
1,422,617,062,000
I've got an embedded device running without monitor, running Debian Jessie. Since I don't need a UI, I considered cleaning up the X11 packages. This gave a somewhat unexpected result: sudo -u nobody apt-get remove '^x11' -s This produces the following result: The following packages will be REMOVED: ffmpeg libavd...
I haven't traced the complete dependency tree, but the linked package has at least the following chain of dependencies: ffmpeg depends on libsdl2, which in turn depends on libxss1, which in turn depends on x11-common. Since x11-common matches ^x11, it is removed, breaking a dependency of ffmpeg. Thus, ffmpeg has to be...
Why is ffmpeg removed as part of x11?
1,422,617,062,000
I've been searching for hours now and trying various methods of installing FFMPEG on my CentOS server. This is what I have currently installed on my Ubuntu desktop: FFmpeg version 0.6.2-4:0.6.2-1ubuntu1.1, Copyright (c) 2000-2010 the Libav developers built on Sep 16 2011 17:00:39 with gcc 4.5.2 configuration: --ex...
You can install it from source: svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg cd ffmpeg ./configure make Then as root: make install Check the dependency list of ffmpeg, before you carry out the above steps. Make sure you have all the necessary packages. Alternatively, the dependencies can also be installed f...
Install FFMPEG on RHEL/CentOS
1,422,617,062,000
I have little background in programming and need to create a batch to extract the audio of multiple video files. Execution is done through the context menu in Nautilus/Gnome Files, stored in Nautilus' scripts folder as a bash .sh. The following code works for 1 file, but when selecting multiple files it doesn't. Could...
Use this script, cannot test it with ffmpeg but it should work. #!/bin/bash { readarray FILENAME <<< "$(echo -e "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | sed -e 's/\r//g')" echo -e "Logs: $(date)\n" > ~/Desktop/data.txt for file in "${FILENAME[@]}"; do file=$(echo "$file" | tr -d $'\n') echo "Current ...
Nautilus Script for multiple files (ffmpeg)
1,422,617,062,000
I have a huge number of images from which I'd like to feed some to ffmpeg time to time. But I only want to feed ones that are alphabetically after certain image (last frame of previous run, name stored in some file). Can I for example find out an order/index number of that one file and then do head/tail using that num...
After sorting, some sed or awk could be used to match from pattern until the end of the stream. I assume that your final ffmpeg command accepts a list of file arguments. I use a printf instead of ffmpeg below. find . -type f -print0 | sort -z | sed -nz '/pattern/,$p' | xargs -r0 printf '%s\n' GNU arguments separation...
Filtering file list to show only files alphabetically after certain file
1,422,617,062,000
I am trying to split a video video.avi (with N being the total number of frames) into contiguous chunks according to a fixed number of frames (say M = 100). Specifically this process should yield: video_0.avi: Frames 0 to M-1 video_1.avi: Frames M to 2M-1 video_2.avi: Frames 2M to 3M-1 ... It is important that each ...
For the first chunk, you should be able to use -vframes M-1 and it will be OK (even for -c copy if I recall). The other chunks are trickier, and I've had no success with: -vf 'select=gte(n\,M)' -- it needs re-encoding anyway, but does strange things with different codecs -- e.g. leaves the preceding duration with a st...
Split video file into chunks using FFMPEG and exact number of frames
1,422,617,062,000
I am still pretty new to linux and have been trying very hard at getting this right. Please help me to get this right. I am trying to merge 2 videos (1 from each folder) multiple times in like a batch process, automatically 1 set after the next. I am trying to do it with ffmpeg and for loop in order to take one file ...
In your first example, ${filename%} doesn't change $filename at all, and as you told ffmpeg to open the .mp4 file with the concat demuxer -f concat, the error message should have been <actual name of $filename>: Invalid data found when processing input, but you recieved No such file or directory, so I suspect the glob...
ffmpeg merge multiple sets of 2 videos in for loop
1,422,617,062,000
I've got a video file with 1.0 FPS (i.e. one frame per second) and would like to re-encode it so that it plays ca 20x faster. A short 1 FPS sample is here: http://s3.aws.nz/cam-1537668742.mp4 I can play it 20x faster using mplayer like this: mplayer -speed 20 cam-1537668742.mp4 How can I save it as a video file at th...
Basic template is ffmpeg -i in -vf "setpts=(PTS-STARTPTS)/20,fps=20" out or ffmpeg -i in -vf "setpts=(PTS-STARTPTS)/20" -r 20 out Without the fps filter or -r option, ffmpeg will assume the framerate of the output stream is still 1 fps and so will drop 19 out of each 20 retimed frames.
How to speed up video to make timelapse?
1,422,617,062,000
With the following command i'm trying to capture 10fps and send them the device driver. Now i want 8 bit gray raw frames (640x480= 307200 bytes per frame) to be send to the device driver. I can't figure out how to set the output with ffmpeg or the intput with v4l2 to this format. ffmpeg -f v4l2 -r 25 -s 640x480 -i /de...
First, check pixel formats are supported by your output device driver: v4l2-ctl --list-formats -d /dev/devicedriver the pixelformat you want to pass to the v4l2-ctl command line is the fourcc shown in the result, eg: Pixel Format : 'YUYV' in this case your command line would be: v4l2-ctl --set-fmt-video-out=width=6...
ffmpeg webcam to device driver , output 8 bit grayscale
1,422,617,062,000
when I get a flash video from YouTube, why is the quality of the audio much worse than the origin video on YouTube? When I downloaded the flash movie, I convert it to avi like this: ffmpeg -i ~/"$2.flv" -sameq -acodec libmp3lame -vol 200 -ar 44100 -aq 300 -ab 2097152 ~/"$2.avi" I already set -aq (audio quality) t...
This is the command line you want: ffmpeg -i ~/test.flv -acodec libmp3lame -qscale 8 test.avi Using the video you suggested as example i have almost the same quality in vlc as original (original has aac encoding). You were specifying a way too high bitrate (2Mb/sec, 192kb/sec is far enough), i don't think it had any...
ffmpeg and libmp3lame produces bad audio quality?
1,422,617,062,000
trying to install opencv on my centos6 and always got this error meesage fatal error: sys/videoio.h: No such file or directory #include <sys/videoio.h> Anybody understand what sys/videoio.h is? where do I get a file like this one?
Here it is a workaround by deselecting WITH_V4L and selecting WITH_LIBV4L in cmake-gui which stop checking for sys/videoio.h.Again,same as other solutions I posted, I do not known why it is working this way.
what is "sys/videoio.h"?
1,479,208,613,000
I'm working on a live stream transcoder application using nginx + ffmpeg. Everything works fine when I use avconv to transcode, but if I use ffmpeg, I get this error: [tcp @ 0xb4e9da0] Failed to resolve hostname fso.dca.XXXX.edgecastcdn.net: System error Any hints? Seems like an application specific firewall.
The problem is with the static build, as @slm mentioned. I've compiled ffmpeg from source and things work fine now.
Application specific DNS problem?
1,479,208,613,000
I'm using ffmpeg's x11grab to do some screencasting. It works pretty well except on 3D stuff. In particular it seems like 3D draw areas flicker in and out. You can see an example of it here. The issue is present even when I capture only the screen (i.e., not adding in all the other fancy stuff and the webcam capture)....
I finally resolved it! The problem was to do with OpenGL as I suspected. To solve the issue, I downloaded VirtualGL. Specifically I grabbed the .deb file from here and installed it with dpkg. Running my applications with vglrun application and then starting the screencast now works perfectly, it even runs more smooth...
x11grab flickers in OpenGL draw areas
1,479,208,613,000
I have many folders in one directory, each containing 2 mp3 files. Hereby I can find the files: first=$(find ./*/* -type f | sort | awk 'NR % 2 == 1') second=$(find ./*/* -type f | sort | awk 'NR % 2 == 0') I want to concatenate the first file with the second one in each folder: ffmpeg -i "concat:$first|$second" -c c...
I think it would be simpler and more robust to not rely on find in this instance. You have a well defined directory structure and there's really no reason to use find to traverse it since you know exactly where your files are. Instead, use a shell loop: for dirpath in files/*/; do set -- "$dirpath"/*.mp3 ffmpe...
Loop through folders and concatenate mp3 files with ffmpeg
1,479,208,613,000
I am trying to convert a GIF to a MP4. I am getting an error while doing that with specific parameters. What am I doing wrong? Any help would be nice. I would like a mp4 video with high quality, size is not a problem. Command and log : ffmpeg -i So_gehts.gif -c:v libvpx -crf 4 -b:v 500K output.mp4 ffmpeg version 2.7.6...
From your error message... codec not currently supported in container I don't think you can use VP8 with an MP4. Try a different codec or container format? I've provided some examples with links to documentation below. MP4 w/ x264: ffmpeg -i So_gehts.gif -c:v libx264 -crf 4 -b:v 500K output.mp4 MP4 w/ x264 (lossle...
FFMpeg : GIF to MP4 conversion throws code error.
1,479,208,613,000
I've an .m4a audio file and wish to take the front 8 secs away and keep the rest of the file intact, then once this first step is done discard the last 8 seconds of the file and keep the rest of the file intact. So in essence the first 8 seconds will be completley discarded / removed from the file, and the file will s...
This will trim the first 8 seconds from the front of the file without re-coding, and retain everything except the first 8 seconds in the output file ffmpeg -ss 8 -i in_file.m4a -c copy out_file.m4a In addition, the below line will trim the last 8 seconds from the end of the audio file. Below line seems convoluted but...
How to trim first 8 secs & last 8 secs from the front and then the end of a m4a audio file and keep the rest of the file
1,479,208,613,000
I am running some commands in bash (basically some ffmpeg commands), that I'm using grep and awk to filter out the results. The command takes some time and continously outputs some results as it progresses through the video. The grep pipe is the same. But the awk pipe waits until the command is completed and prints al...
With standard tools, try ffmpeg -i freeze.mp4 -vf "freezedetect=n=-60dB:d=2" -map 0:v:0 -f null - 2>&1 | stdbuf -o 0 grep freezedetect | stdbuf -o 0 awk '{print $4,$5}' | stdbuf -o 0 tr -d , | stdbuf -o 0 grep lavfi
Pipe and filter bash outputs in realtime
1,479,208,613,000
I'm using ffmpeg combined with tee and mplayer to have a simple video livestream and recorder over SSH. Now, I'd love to embed the current (server) time in the stream. The format doesn't matter much, ideally would be YYYY-MM-DD HH:MM:SS. I've found this how-to suggesting the following command: ffmpeg -f video4linux2 -...
Okay, I've found the solution in the FFmpeg filter documentation. 10.52.2 Text expansion If expansion is set to strftime, the filter recognizes strftime() sequences in the provided text and expands them accordingly. Check the documentation of strftime(). This feature is deprecated. Though it says This feature is...
How to embed current time with ffmpeg?
1,479,208,613,000
Have a script that generates a rtmp stream that runs inside a screen using ffmpeg but this fails for some reason? If it run it directly in the command line it works so I tried to run it by opening > screen , running it and closing the screen with ctrl + d but even so it sometimes closes for reason. Is there a way to ...
Is there a way to log the stderr from ffmpeg inside the script to see why the command fails inside the script but works when run directly? Here you go, forward stream 2, stderr, to a file in tmp. Oh, and because you do not want it to overwrite the tmp file all the time, add the PID to its name: my_command 2> /tmp/...
ffmpeg command fails silently inside script but works when run directely
1,479,208,613,000
I have a videos with low framerates (1 to 3). And I want make video 30 fps from it. I search proper video filter. And this is not motion interpolate, but corresponding pixel to pixel interpolate of two neighboring frames. Thus I want recieve 29 frames which will be provides smooth transition between frames with ffmpeg...
The filter I need is called "framerate". This is very simple and light. With it I can easily make a slideshows. ffmpeg -i in.mp4 -vf framerate='fps=60:interp_start=1:interp_end=254' out.mp4
ffmpeg smooth transition between frames
1,479,208,613,000
I have an app that I built that simply plays an icecast feed from the internet and if the feed is gone, it plays a backup feed or some local audio files. I need a way to show a representation of the playing audio on a dashboard that runs on a nginx server on the same machine. I would like it to be realtime if possible...
The simplest (though definitely not cheapest, CPU-wise) way to do this that I can come up with is to have ffmpeg output an image with a loudness meter every once in a while, in addition to its normal output. You can do this something like this: ffmpeg -i «INPUT» \ -filter_complex '[0:a]ebur128=video=1:meter=18:met...
Using Alsa, How can I get the current levels of audio playing through ffmpeg or mpg123 to display on a web dashboard?
1,479,208,613,000
I have try to use ffmpeg to download youtube media in mp3. ffmpeg -i <url> -f mp3 output.mp3 It's working with other urls, but not with youtube-dl retrived youtube video urls. Ffmpeg returns error 403, forbidden. I can't download also with wget, but from browser and vnc player the url is working. I want to download s...
You forgot to quote the URL given to ffmpeg so the shell's consuming some of the characters as expressions or something else. ffmpeg -i "https://r1---sn-qxo7rn7e.googlevideo.com/videoplayback?signature=021CAFB9066554DD33675D89CC80D6E5FC616A7E.8A6222115FF91416C7F1B639B8F4A86671B40DD2&ipbits=0&sparams=clen%2Cdur%2Cei%2C...
Ffmpeg - youtube-dl
1,479,208,613,000
While trying to solve an issue about loading MPEG videos in Matlab, I found several suggestions to install the FFmpeg plugin for Gstreamer. However, I can't find this functionality on Debian 9 [1]. It was available on Debian 7, though [2]. This is not really an XY question. I'm still looking for alternatives for my is...
It was renamed to gstreamer-libav
What happened to gstreamer-ffmpeg and can I replace it?
1,479,208,613,000
I've already installed FFmpeg according to the ffmpeg Ubuntu compile guide. I can't use aac audio encoding and libx264, which I need. How do I install FFmpeg so that all the option below are enabled in the installation? Do I need to uninstall FFmpeg and start over again, or can I just add to what has already been inst...
I do this on a regular basis since I like to use ffmpeg's bleeding edge features now and then. For libfdk-aac and libx264, you want to install the respective development packages: sudo apt install libfdk-aac-dev libx264-dev Then I configure ffmpeg like this: ./configure --prefix=/opt/ffmpeg-$(cat RELEASE) --enable-gp...
How to add aac and libx264 to FFmpeg installation?
1,479,208,613,000
I had a static installation of ffmpeg but was running into trouble with config files not found so I have since just deleted it. Then I tried re-installing a more current static version just to see if it differs from first one I installed a week ago and it does. The first one had the ffmpeg script which I ended up pla...
Q#1: Is it best to place these scripts in usr/bin, does it matter? Does yum update static versions? No if you download and install the static versions that the FFmpeg project provides on their website will not be managed by yum if you opt to install them into /usr/bin. I would probably not opt to install these to /u...
ffmpeg installation on Linux REHEL/CentOs 6.X
1,479,208,613,000
Running Ubuntu 13.10 with a fully compiled ffmpeg. I know the code for the actual conversion is ffmpeg -i video.mp4 -codec copy video.avi I just need a plain and simple Bash script to do that for, say, forty or fifty of the .mp4 files.
If you have a list of file you can use something like: cat list-of-files.txt | while read file; do ffmpeg -i $file -codec copy ${file%%.mp4}.avi; done or simply cd /path/; ls *.mp4 | while read file; do ffmpeg -i $file -codec copy ${file%%.mp4}.avi; done
Batch Convert .mp4 to .avi with ffmpeg
1,479,208,613,000
I have a number of video files (500+) with lots of audio and subtitle streams for languages that I don't need and would thus like to remove to conserve storage space. I tinkered around with ffmpeg, but removing streams by processing one file after another turned out to very time consuming. Had no luck with scripting e...
You could use the following ffmpeg command line: ffmpeg -i video.mkv -map 0:v -map 0:m:language:eng -codec copy video_2.mkv Explanation: -i video.mkv input file (identified as '0:' in mappings below) -map 0:v map video streams from input to output file -map 0:m:language:eng map streams ...
How to remove unneeded languages from video files using ffmpeg?
1,479,208,613,000
On Linux I have a process (ffmpeg) that writes very slowly (even slower than 1kb / s sometimes) to disk. Ffmpeg can buffer this to 256kb chunks that get written infrequently but ffmpeg hangs occasionally and if I try to detect these hangs by checking that the file is being updated I need to wait a long time between up...
You can use GNU dd for this; it was designed to reblock data when reading/writing tape drives optimally. Pipe the unbuffered output into, for example, dd obs=20k status=progress >/the/file where 20k is the output block size you wish to use for each write to disk. k means kibibytes. With status=progress you get a line...
Create a file for writing with controlled flushing to disk in large chunks
1,479,208,613,000
I have a large music collection. Some of it is lossless files, and some is lossy. I would like to maintain a copy of the collection that consists of the original collection's lossy files, and lossy transcodes of the original collections lossless files. Some assumptions: I know how to use ffmpeg to convert flac to opu...
I don't like Makefiles (I might concur with this guy); however, make does what you want, out of the box: You define a rule, for example, that you want an .opus file for every source .flac file: Makefile, from the top of my head TARGETDIR=/path/to/compressed/library %.opus: %.flac ffmpeg -ffmpegflags -and -stuff -i...
Maintain parallel lossy and lossless music collections
1,479,208,613,000
My node application spawns ffmpeg processes. In htop, there are a bunch of ffmpeg processes I would have expected to have ended but they are still shown in htop. The threads in green are the process that is currently active. The ones in white are shown using memory, and the time column is not incrementing. Are these ...
Yes, they're using resources, though its hard to say how much; could be a very small amount. First thing to check for is just with ps, see if their status is Z (zombie). Which would mean they've exited, but you're not calling wait/waitpid/etc. on them. (Probably not, as I think Node handles this for you). Otherwise, t...
Are these threads in htop using any resources?
1,479,208,613,000
I'm trying to launch a series of FFMPEG commands over SSH. My SSH client is the native openssh (7.7.2.1) client in Windows Server 2019 (ver 1809 build 17763.2114). The command I am trying to run is this: C:\Windows\System32\OpenSSH\ssh.exe -v [email protected] -n -t 'nohup /home/user1/ffmpeg/ffmpeg -f lavfi -i testsrc...
I found the answer quickly. I had to modify my own command by redirecting the console output. C:\Windows\System32\OpenSSH\ssh.exe -v [email protected] -n "nohup /home/user1/ffmpeg/ffmpeg -f lavfi -i testsrc -f null - -nostdin -nostats -hide_banner -loglevel error > /dev/null 2>&1 & " I will be able to replace /dev/...
How do I use SSH to launch a nohup ffmpeg command and leave it running after disconnect?
1,479,208,613,000
ffplay can nicely open e.g. /dev/video0 and monitor the incoming video frames (e.g. you can watch TV on a TV card). Giving /dev/video to ffmpeg also makes it easy to encode the video. Is it possible to do both: get video frames onto the screen while also encoding them at the same time?
There are many ways. I usually copy the raw video stream to a ffplay instance with the help of tee: ffmpeg -hide_banner -loglevel error -f v4l2 -pixel_format yuyv422 -video_size 1280x960 -i /dev/video0 -c:v copy -f rawvideo - |\ tee >(ffplay -f rawvideo -pixel_format yuyv422 -video_size 1280x960 -) |\ ffmpeg -f rawvid...
ffmpeg: monitoring video being encoded from /dev/video* on screen
1,479,208,613,000
I'm trying to use ffmpeg's signature function to perform a duplicate analysis on several thousand video files that are listed in the text file vids.list. I need to have it so that every file is compared with every other file then that line of the list is removed. The following is what I have so far: #!/bin/bash home=...
Sidestepping the exact command, I take it you want something like this (with the obvious four-line input)? $ bash looploop.sh run ffmpeg with arguments 'alpha' and 'beta' run ffmpeg with arguments 'alpha' and 'charlie' run ffmpeg with arguments 'alpha' and 'delta' run ffmpeg with arguments 'beta' and 'charlie' run ff...
Using nested while loops for ffmpeg processing
1,479,208,613,000
I call ffmpeg like this from Mac's terminal: $ find . -type f -name *.webm | while IFS= read -r f; do echo "$f"; ffmpeg -i "$f" "${f%.webm}".mp4 2> ~/Desktop/err; done Only the first file returned by find gets processed: ./artist/Moody Blues/_vid/Nights in white satin_lyrics.webm Excerpt from err: Enter command: |...
You're improperly using find and needlessly creating a shell loop (it hurts to read!), because you can (should) run ffmpeg directly from inside find: find . -type f -name *.webm \ -exec sh -c 'echo "$1"; ffmpeg -nostdin -i "$1" "${1%.webm}".mp4 2>> ~/Desktop/err' sh {} ';' With deference to LordNeckBeard (though mine...
Invoking ffmpeg iteratively
1,479,208,613,000
I wrote a small script that converts HQ video to LQ: ls video/hq | cut -d. -f1 | while read line ; do HQ=./video/hq/$line.mp4 LQ=./video/lq/$line.mp4 ffmpeg -i $HQ -crf 40 $LQ done; When I run ls video/hq | cut -d. f1 I get back: 1502460615677 1502461135975 1502461292963 1502461373947 1502461493936 150246178211...
Apparently ffmpeg reads from standard input, which interferes with the read command. So I'm directing to /dev/null ls video/hq | cut -d. -f1 | while read line ; do HQ=./video/hq/$line.mp4 LQ=./video/lq/$line.mp4 ffmpeg -i $HQ -crf 40 $LQ < /dev/null done;
ffmpeg script only running for first in list?
1,479,208,613,000
To merge two MP4 file, it's necessary to pass by .ts file. ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts input1.ts ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts input2.ts ffmpeg -i "concat:input1.ts|input2.ts" -c copy output.mp4 But, I have this error on first/second command: Codec ...
You're trying to do it using the concat protocol which concatenates at the file level. Do you get better results if you try to concatenate via the demuxer? You would list your input files in a text file (mylist.txt) and then: ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4 The -safe 0 is not required if the...
FFMPEG - Merge two MP4 files
1,479,208,613,000
The most simple slideshow is just a sequence of pictures with each being displayed for the same amount of time. I would also like to make a sequence, but more complicated with respect to the duration: I want the first picture to have a duration of 1 second, the next a little bit less than a second, the next even a lit...
This can be done in a single command. Basic method is to start with a slideshow where each image has the same duration and then use the select filter to trim out greater amounts from the display time of each successive image. ffmpeg -framerate 1 -i img%d.jpg \ -vf fps=25,select='lt(mod(t,1),1-floor(t)/25)',setp...
Is it possible to create with FFMPEG a series of pictures with continuously shorter duration?
1,479,208,613,000
I have an audiobook which consists of over 700 ra files (RealAudio) which I'm trying to batch convert to mp3 using ffmpeg. RA files are named as chapter-verse.ra (e.g. 13-01.ra) I run a script and it gets as far as processing 32 files and then stops. For each file it displays an error, but converts it none the less. H...
Figured this one out. This has already been answered here The ffmpeg line now reads: < /dev/null ffmpeg -i $file -loglevel error -acodec libmp3lame ${outdir}/Chapter${chapter}_Verse${verse}.mp3 And goes all the way till the end.
FFMPEG batch convert quits before processing all files
1,479,208,613,000
I'm looking for a way to convert all alac files in a directory recursively to another format. Problem: alac as well as aac use suffix m4a, so find -name "*.m4a" doesn't work.
You need a tool that can detect the codec in the m4a files. One such tool is avprobe which is available in debian based linuxes in package libav-tools (I use Ubuntu 14.04). Then you can do like this (if there are no newlines in file names..): find . -name \*.m4a | while read file; do avprobe "$file" 2>&1 |grep -q 'Aud...
Find and convert all ALAC files to mp3 / opus / aac
1,371,492,830,000
I have a bash script which starts ffplay in background, looping a short sound sample indefinitely. Then it does some other work, and finally it kills ffplay. foo() { ffplay -loop 0 sound.wav &>/dev/null & trap "kill $!" RETURN (do work...) } I want ffplay to finish playing the currently played sample, an...
You can get continuous statistics or debug output from ffplay which consists of lines ending carriage-return (^M) like this: nan M-A: nan fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 ^M -0.07 M-A: -0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 ^M -0.01 M-A: -0.000 fd= 0 aq= 0KB vq= 0KB sq...
FFPLAY - loop sound until signal received
1,371,492,830,000
I have a batch of sound samples which are too short (2.15 sec), and I want to extend the sustain to a total of about 10 seconds, meaning stretch the last 0.50 second of the file to 10 seconds. I can do this on each single file in audacity with paulstretch but was wondering if there's a way to do so in batch from the c...
It's not possible to have sox stretch a sample by more than a factor of 10x directly. We could take an 0.5s sample and stretch it to 5s and then double that, but it gets complicated. Instead, I've chosen to take the last full second and stretch that. play original.wav trim 0 -1.0 : tempo -m 0.1 You can batch process ...
How to extend sustain in batch wav files?
1,371,492,830,000
I would like to know if there is any difference in the final output between the various command-line tools for encoding FLAC files, like ffmpeg, sox, the “official” flac etc. In some contexts, I have noticed that it's recommended to use flac over the others, but given that FLAC represents lossless encoding, am I corre...
The FLAC encoder has a ton of parameters, so you'll need to consult with the source code of ffmpeg/sox to see how they use the codec but despite all of this does it really matter? FLAC is a lossless encoder, so even if flac, ffmpeg and sox produce different FLAC files, they will all decode bit perfectly. FFmpeg will p...
FLAC encoders – any difference in output between the command-line tools?
1,371,492,830,000
I wish to convert the encoder of some audio files. The problem is that my car can't reproduce audio files encoded with LAME3.99.5; it's an issue with some Volvo cars. The problem is with USB and CD. The encoder needs to be LAME3.95 or less, or another encoder. What command should I use to achieve this? I would like to...
Are you aware of the standalone "lame", which you can choose version to download: https://sourceforge.net/projects/lame/files/lame/3.95/ ... but then you need to compile it ;-p $ uname -a ... 20.04.1-Ubuntu ... x86_64 GNU/Linux $ tar -xvf lame-3.95.tar.gz $ cd lame-3.95/ $ ./configure 2>&1 > log.txt $ make all 2>&1 >...
Convert encode of audio files
1,371,492,830,000
This is the ffmpeg version I am working with on Debian testing - $ ffmpeg -version ffmpeg version 4.4.1-2+b1 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11 (Debian 11.2.0-12) configuration: --prefix=/usr --extra-version=2+b1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include...
The sample you posted looks fine, yet the error message suggests there was an extra 0.0 appended to the start time when you executed the command. This should work: ffmpeg -ss 00:22:20 -t 60 -i 123.mkv 456.mkv
Extracting video via ffmpeg gives incorrect duration
1,371,492,830,000
I'm trying to create a script, which should read a video folder and create a list of video files to be processed by ffprobe to identify the codec. Videos NOT processed with a specific codec (in this case HEVC) should be put in new list for further processing by ffmpeg. I created a very rudimentary script, but hit a br...
Assuming your filenames don't contain newlines, you don't need to mangle them in any way. The output from file has one line per filename, so just store it and loop over the resulting file: > non-hevc.txt # clear the output list find "$vpath" -type f \( -iname "*.mkv" -o -iname "*.mp4" -o -iname "*.avi" \) \ > ...
Problem with utilizing a "while loop" and subsequently processing data in a bash script
1,371,492,830,000
I have a video file which is 20 seconds long. I cut this video file into segments like video_file_0 -> starts at 0:00, ends at 0:02 video_file_1 -> starts at 0:02, ends at 0:04 video_file_2 -> starts at 0:04, ends at 0:06 video_file_3 -> starts at 0:06, ends at 0:08 video_file_4 -> starts at 0:08, ends at 0:10 video_f...
What about mpv --gapless-audio=yes --loop-playlist=inf video_file_* to enable Gapless playback as documented in the manual: --gapless-audio=<no|yes|weak> Try to play consecutive audio files with no silence or disruption at the point of file change. Default: weak. no: Disable gapless audio. yes: The audio device is o...
How to play a playlist continously?
1,371,492,830,000
I used snd-aloop module to create a loopback audio stream. Now I want to somehow mux my desktop audio from pulseaudio and my microphone audio streams into this loopback stream, and while that can be done via ffmpeg, I can't find a way to write the output to the ALSA device.
To achieve this, all I had to do was to specify the format of the output "file" as alsa and set output to hw:[snd-aloop-card],1,0 Example: ffmpeg -i myfile.ogg -f alsa hw:2,1,0
Write audio stream to an ALSA device with ffmpeg
1,371,492,830,000
I am using ffmpeg to take screenshots of twitch streamers using this code: counter = 0 while counter <=5: os.system('ffmpeg -i ' + stream + f' -r 0.5 -f image2 {dir_path}/output_%09d.jpg') counter += 1 It's my first time working with ffmpeg so I thought all I needed was a while loop with a counter to control...
From man ffmpeg -vframes number (output) Set the number of video frames to output. This is an obsolete alias for "-frames:v", which you should use instead. An example based on your existing command: ffmpeg -i <stream> -r 0.5 -frames:v 5 -f image2 output_%05d.jpg -r 0.5 sets the rate, frames per s...
How to run ffmpeg to take x number of screenshots?
1,371,492,830,000
I'm trying to switch from one advertised resolution/framerate to a different one on the fly, preferably while other applications are consuming the v4l2loopback feed. As an example, I feed a 1920x1080 black screen video into /dev/video2, and then open it in vlc. This works fine: $ ffmpeg -f lavfi -i color=c=black:s=192...
as long as the device is opened, it's resolution (and format) are fixed. so the answer to your question is: no, you can't change these settings on the fly. (unless you quit all consumers (in your case: VLC) before starting the new ffmpeg; but that's not what i would call "on the fly") this is a limitation of the V4L2 ...
How do I change the resolution/capabilities of a v4l2loopback device on the fly?
1,371,492,830,000
I can split an aid (or video) file by time, but how do I split it by file size? ffmpeg -i input.mp3 -ss S -to E -c copy output1.mp3 -ss S -to E -c copy output2.mp3 Which is fine if I have time codes, but if I want the output files to be split at 256MB regardless of the time length, what do I do? (What I am doing now i...
The option you are looking for is -fs which limits the file size. here is the official documentation: https://ffmpeg.org/ffmpeg.html#Main-options
Use ffmpeg to split a file output by size
1,371,492,830,000
I'm trying to record lossless videos with ffmpeg of My screen My computer audio My microphone audio using this script: MIC="alsa_input.usb-Logitech_Logitech_USB_Headset-00.mono-fallback" MONITOR="alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo.monitor" AUDIO0=$(pactl list short | grep "$MIC" | grep -...
There are no faster presets for x264 than ultrafast, so you could: Reduce framerate from 60 to cinematic 24 or even 15 since we are talking about screen casting Use a different video codec Use hardware video encoding acceleration if your GPU supports it Add -thread_queue_size 1024 as encoding options. Some people say...
Lossless ffmpeg recordings with low resource usage
1,371,492,830,000
When doing an mp3 → mp3 (or flac → mp3) conversion, -map_metadata can be used to copy metadata from the input file to the output file: ffmpeg -hide_banner -loglevel warning -nostats -i "${source}" -map_metadata 0 -vn -ar 44100 -b:a 256k -f mp3 "${target}" However, when I use this, I notice that it doesn't copy all th...
The front cover is treated as a video stream with a special disposition. Use of -vn will disable its processing. Use ffmpeg -hide_banner -loglevel warning -nostats -i "${source}" -map_metadata 0 -c:v copy -disposition:v:0 attached_pic -ar 44100 -b:a 256k -f mp3 "${target}"
ffmpeg not copying FRONT_COVER image metadata during conversion
1,371,492,830,000
I have a sequence of images, named from 00001.png to 00322.png. I want to create a video from that image sequence, for which I have used the following command: ffmpeg -i %05d.png -c:v libx264 -vf fps=100 -pix_fmt yuv420p triangles.mp4 The video renders correctly, but the length is of 13 seconds (according to vlc or y...
Image sequences have a framerate associated with them. When not specified, a default value of 25 is set. The fps filter converts a stream from its input framerate to the target framerate. However, it aims to preserve sync, so frames are dropped or duplicated while source frames are kept as close as possible to their s...
ffmpeg video at 100 fps with 300 images gives 13 seconds
1,371,492,830,000
From the command line, I'd like to play a audio clip, or random subset of a song, eg, seconds 5 - 10. This does not seem to be a feature of paplay or mpg123, the two programs I've been using. ffmpeg allos me to trim a file (eg, ffmpeg -i file.mkv -ss 20 -to 40 -c copy file-2.mkv), but I'd like to avoid creating a new...
This approach works fine for me. Use force format option -f and select wave, write to stdout then pipe to e.g. aplay like so: ffmpeg -i input -ss 20 -to 40 -f wav - | aplay
How to randomly sample a subset of a song on command line
1,371,492,830,000
I am trying to make this script that loops through video files created between hours 00 and 12, convert them with ffmpeg and then remove them. The script works in terms of finding the files and starting ffpmeg but it seems that it continues to "send" characters from the find -exec after that ffmpeg has started on the...
Thanks to Gordon Davisson I managed to solve the problem. Here is the complete working script if someone happens to stumple upon this issue in the future. #!/bin/bash -e find /videos/. -type f -exec sh -c 'h=$(date -d @$(stat -c %Y "$1") +%-H); [ "$h" -ge 00 ] && [ "$h" -lt 12 ]' sh {} \; -print | while IFS= read -r i...
Creating a for loop with find -exec and while
1,371,492,830,000
I have 4 noname ip-cams and have troubles with capturing rtsp streams. Randomly output file not even created. I'm capturing stream via ffmpeg. Tried on Ubuntu Server 18.04 with snap ffmpeg and Debian 7 with ordinary ffmpeg. The same touble. (/snap/bin/ffmpeg -y -use_wallclock_as_timestamps 1 -hide_banner -loglevel tr...
I've found solution myself. I've got that problem was with packet authenticity. I've tried to add forced tcp connection flag (-rtsp_transport tcp) and it works. No problem anymore.
RTSP via ffmpeg
1,371,492,830,000
I have a large pcm file with about an hour's worth of data. I want to split it up into minute long chunks. Is there a way to ffmpeg to do that pr some other utility? Basically going from 0 - 3600s I want multiple files each going from 0 - 60s, 61-120s etc.
FFmpeg's segment muxer does this. ffmpeg -i in.wav -c copy -f segment -segment_time 60 out%d.wav This will create out0.wav, out1.wav, out2.wav ... , each 60 seconds long. If your input is raw PCM rather than WAV/AIFF, you'll need to manually set the input parameters e.g. ffmpeg -f s16le -channels 2 -ar 48000 -i in.pc...
Splitting up a pcm file into minute using ffmpeg long chunks
1,371,492,830,000
I want to cut video from long-video with ffmpeg, I use this command: ffmpeg -i /home/nantembo/VideoPerl/1.mp4 -f avi -vcodec copy -acodec copy -ss 0:14:47 -t 0:58:55 /home/nantembo/VideoPerl/2.mp4 but I receive video duration 58:55 min with start position 0:14:47 + 0:44:08, but I need to receive video, which: starti...
According to the ffmpeg manual, the -t option is the duration, not the end time. I think you're looking for the -to option: -to position (output) Stop writing the output at position. position must be a time duration specification, see the Time duration section in the ffmpeg-utils(1) manual. ...
How I can to cut line segment video with ffmpeg?
1,371,492,830,000
This is somewhat related to Play subtitles automatically with mpv I am running mpv 0.26.0-3 and trying for the media file to load subtitles but is failing although mediainfo shows that there is en/utf-8 text file for about 80 KB . The media file is in mkv format - Format : Matroska F...
the answer is - either adding --sid=1 or --sid=2 depending if there are one or more subtitles internally. the two flags are also convenient if you have an internal subtitle and an external subtitle and want to choose between the two as well.
unable to get mpv to play embedded subtitles even with config file setting on
1,371,492,830,000
I'm building a Docker image that enables OpenCV with ffmpeg support. My Dockerfile looks like RUN apt-get update && apt-get install -y \ git \ curl \ wget \ unzip \ ffmpeg \ build-essential \ cmake git pkg-config libswscale-dev \ libtbb2 libtbb-dev libj...
The ffmpeg binary package is for the ffmpeg command-line tool. The development headers you need to compile against are in different packages—a fair number. Thankfully, they all come from the ffmpeg source package, so you can get a list relatively easy: On Stretch, which uses actual ffmpeg: (stretch)$ grep-aptavail -s ...
Docker image with OpenCV and FFPMEG
1,371,492,830,000
According to this article I used successfully the command $ ffmpeg -vf "select='eq(pict_type,I)'" -i somevideo.mp4 -vsync 0 -f image2 /tmp/thumbnails-%02d.jpg I tried the second command: $ ffmpeg -vf "select='gt(scene\,0.9)'" -i somevideo.mp4 -vsync 0 -f image2 /tmp/thumbnails-%02d.jpg but ended with error: Undefine...
First of all, -vf needs to be specified after the input in order to affect it, and it seems to be the only reason avconv worked for the second command: it must have discarded your filter without even parsing it. If you move the argument after -i, it will result in the same error as ffmpeg gave you. Newer versions of f...
Incorrect scene change detection with avconv
1,371,492,830,000
I have movie split in many parts with duration 10-30 seconds. All movies are MPEG TS files. I want to merge them. I try to make following: ffmpeg -f concat -i join.txt OUTPUT.TS and ffmpeg -i "concat:INPUT-1|INPUT-2" -c copy OUTPUT.TS both methods do the job, but resulting movie has issue if click somewhere forwar...
What parameters should be passed to make result movie smooth with the same quality ? You probably need to regenerate the timestamps. Each clip has a separate timestamp stream, so when you concatenate them, the player perceives time as going backwards whenever it jumps from one part of the stream into a different one...
FFMPEG glue MPEG TS
1,371,492,830,000
I'm trying to build ffmpeg with NVENC support so I can then build obs-studio with NVENC support, using this as a guide. I've sorted out every dependency after a bit of headache, and am now to the point where I should be able to compile ffmpeg with the edits to its rules file just fine. However, my trusty terminal sp...
I could build it without any issue in an LXC Ubuntu 16.04 container. vi /etc/apt/sources.list added source & backports repositories: deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse deb http://secur...
Help compiling ffmpeg with NVENC support under Linux
1,371,492,830,000
I use the following code to convert WAV to ALAC (bash, macOS 10.12.1): find . -type f -iname "*.wav" | while read fn; do ffmpeg -i "$fn" -acodec alac "${fn%.wav}.m4a"; done But there seems to be a mistake since it prints warnings like this: n---8085/03_Part_III.wav: No such file or directory The correct path would b...
Your file names are not actually being truncated. Here, ffmpeg is trying to read commands from its input stream. Unfortunately, this is the same stream read is using to determine filenames, so it appears that parts of these filenames are not being read. To fix this, you should tell ffmpeg to disable interaction on ...
Problems converting WAV to ALAC by a batch job
1,371,492,830,000
I'm on a dedicated server with Root access. not familiar with servers. Im trying to install FFMpeg on my server. I'm getting errors can't figure out how to solve it. So any light on this will be very appreciated. [root@ns335004 ~]# yum update base ...
That's the old DAG repository, which is essentially obsolete. You should remove it, either by removing the repository setup package you installed originally, or by setting enabled=0 in the repository's file in /etc/yum.repos.d. The EL7 repo at ATrpms has builds of FFmpeg. They're pretty old, but probably suitable for ...
Mirror not found when trying to install FFMPEG on CENTOS7
1,371,492,830,000
Source Community I've been trying to figure out an ffmpeg command with following requirements while converting 'avi' to 'mp4' with H264 video codecs. One command I tried was generic one like this which is recommended on most forums. ffmpeg -I input.avi -acodec copy -vcodec copy output.mp4 But this copies same video c...
Let us enumerate the parameters to ffmpeg then. -acodec is better written -c:a (menmonic codec for audio) -vcodec is better written -c:v (same mnemonic) -i is the input file (not -I) ffmpeg does a pretty good guesswork based on file extensions, therefore doing: ffmpeg -i file.wem file.mp4 Will convert things, but p...
Building Requirements-Specific Command For 'ffmpeg' Tool
1,436,039,802,000
I have ffmpeg with x11grab on my local machine, but I want to capture the screen of an X server on 12.34.56.78. How can I do that? The following doesn't work: ffmpeg -f x11grab -r 25 -s 800x600 -i 12.34.56.78:0.0 screen.avi
The remote X server must give you permission to contact him. The simplest solution were: xhost + ..given on the remote side. But warn, it enabled this grab thing for everybody & everywhere, which you probably won't. In this case a better solution were a xhost +1.2.3.4 ...where 1.2.3.4 is the ip from which you the re...
x11grab from another display server
1,436,039,802,000
I encode a video file by using ffmpeg like this. $ ffmpeg -i input.avi -pass 1 -an output.mp4 $ ffmpeg -i input.avi -pass 2 -ab 128k -y output.mp4 So I typing always 2 times, is there way to encode a video by 2-pass at once? I change a options often and of course input and output file name is different each times.
Instead of running these as 2 separate commands you can run them on one command line like so: $ ffmpeg -i input.avi -pass 1 -an output.mp4 && \ ffmpeg -i input.avi -pass 2 -ab 128k -y output.mp4 The difference is the && notation which will run the second command (the 2nd pass) only if the first command was succes...
2pass encoding by ffmpeg at once
1,436,039,802,000
When installing ZoneMinder 1.25.0 in CentOS 6.4 (64-bit) the following error pops up when executing make: zm_ffmpeg_camera.cpp:105:44: error: missing binary operator before token "(" Full log: zm_ffmpeg_camera.cpp:105:44: error: missing binary operator before token "(" In file included from zm_ffmpeg_camera.cpp:24: ...
Turns out the latest stable release of ffmpeg (1.2.2) does not go along with ZoneMinder 1.25.0. Installing the 0.9 version of ffmpeg solved this issue. wget http://www.ffmpeg.org/releases/ffmpeg-0.9.tar.gz tar -xzvf ffmpeg-0.9.tar.gz cd ffmpeg-0.9 ./configure --enable-gpl --enable-shared --enable-pthreads make make in...
ZoneMinder compiling error: "missing binary operator before token "(""
1,436,039,802,000
When I want to convert a video with the following command: ffmpeg -i file.wmv -sameq file.mpg it ends with this error message: FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.1, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --extra-version=4:0.5.1-1ubuntu1.1 --prefix=/usr --enable-avfilter --enable-avfi...
The problem lies here Audio: 0x0162 It's the audio format identifier called TwoCC, looking up there we find 0x0162 Windows Media Audio Professional V9 This codec is just not supported by your version of ffmpeg, according to the ffmpeg home page the WMA pro decoder was added in ffmpeg version 0.6, check it out....
ffmpeg could not open file.mpg
1,436,039,802,000
I have some Bluray disks I am attempting to rip video from. Normally I'd use ffmpeg and select a playlist to rip and be done with it. With these discs, however, the videos make use of the alternate camera angles feature. My understanding is that both camera angles are encoded into a single video stream. The video ...
Use an up-to-date version of bluray_copy. Version 1.9 is working for me. The program I had been using to rip my blurays, bluray_copy from the bluray_info project was version 1.3, which as of today is still the latest unstable ebuild available in the gentoo repository. With version 1.3, I failed to rip anything other...
Ripping multi-angle bluray video
1,436,039,802,000
I am streaming the desktop over rtp using ffmpeg from computer A. Here is my ffmpeg code: ffmpeg -f x11grab -framerate 25 -video_size 1920x1080 -i :1.0 -c:v libx264 -preset fast -pix_fmt bgr0 -b:v 3M -g 25 -an -f rtp_mpegts rtp://230.0.0.1:5005 I can play the live stream in vlc in the computer A in "rtp://@230.0.0.1:...
Why can't receive rtp stream on Ubuntu? Because you are using a multicast address 230.0.0.1 and your current setup does not have a multicast path between the two hosts. So, one way to solve the problem right now is to use unicast transmission. Just change the 230.0.0.1 with the ip address of the host you are going t...
Why can't receive rtp stream on Ubuntu?
1,436,039,802,000
I record math lectures for my students using quicktime (audio and video). Quicktime does not offer much control over the input audio gain. I would like to make sure that all my recordings have the same output volume level. Is there a simple way to achieve this using ffmpeg?
This will require audio re-encoding: https://trac.ffmpeg.org/wiki/AudioVolume Also check: https://superuser.com/questions/323119/how-can-i-normalize-audio-using-ffmpeg Lastly normalization does not always help because you may have a relatively quiet audio track with peaks which will make normalization impossible. In t...
Use ffmpeg to achieve uniform output volume levels across different video recordings
1,436,039,802,000
My laptop has Ryzen 2200U with a Radeon Vega 3 and I am using it with CentOS 8, KDE 5 and Chromium version 81. I installed x264 and gstreamer-plugin-blah stuffs, but still both Konqueror and Chromium says: Your browser does not currently recognize any of the video formats available. and YouTube suggests for HTML5 supp...
If you don't feel aversion to proprietary software I'd recommend installing Google Chrome as it supports H.264 by default: https://www.google.com/chrome/ As for Konqueror, installing gstreamer1-plugin-openh264 might help but I'm not sure it's available for CentOS 8.
YouTube Live Streaming doesn't work on CentOS
1,436,039,802,000
Situation: Running macOS 10.13.6 and using bash 5.0.17(1) A lot of subdirectories which hold multiple files. Need to filter out files in subdirectories with a specific extension (.avi). Need to process all .avi files and remux to .mp4 using ffmpeg. ffmpeg uses the following syntax for remuxing: ffmpeg -i in.avi -c co...
Credit to Cbhihe's answer, as it got me on the right path. I needed to change some a few things because of the way baseline works on mac and the handling of spaces in filenames. macOS find uses a somewhat special syntax. You can use the following one-liner: find -E . -type f -iregex ".*\.avi" -execdir bash -c 'in=$1;...
ffmpeg across .avi files in subdirectories
1,436,039,802,000
Ffmpeg is showing its playing an icecast stream but there is no audio coming out. Restarting the program produces audio again. If an icecast feed goes away, ffmpeg keeps running even though theres no audio for some reason. I need to detect this and restart it if theres an issue.
Set stimeout to e.g. 1000000 (10 seconds) - then ffmpeg will quit if it doesn't get any further data in 10 seconds. Then you can e.g. run ffmpeg into a loop.
How can I check from the command line to see if FFMpeg is actively playing audio?
1,552,663,800,000
Try to capture RTSP stream with ffmpeg. Everything goes nice, if I save video to my home folder. Can't save to another directory. ffmpeg says 'Permission denied' even directory premission is 777. In short: ffmpeg -i 'rtsp://192.168.0.161:554/11' -c:v copy -an new.mp4 good ffmpeg -i 'rtsp://192.168.0.161:554/11' -c:...
The thing is I've tried to save video to the folders located at mounted partition. And my snap package have no connection to interface "removable-media". After connection everything works great.
ffmpeg permissions trouble
1,552,663,800,000
I want to play a video at a certain time. Like an alarm. for instance, at 07:00 play video.mp4 I have tried this with crontab and with at, but no success yet
I wrote a little script for that: #!/bin/bash [ "$1" = "-q" ] && shift && quiet=true || quiet=false hms=(${1//:/ }) printf -v now '%(%s)T' -1 printf -v tzoff '%(%z)T\n' $now tzoff=$((0${tzoff:0:1}(3600*${tzoff:1:2}+60*${tzoff:3:2}))) slp=$(((86400+(now-now%86400)+10#$hms*3600+10#${hms[1]}*60+${hms[2]}-tzoff-now)%86400...
Start playing a video at a certain time
1,552,663,800,000
I am looking for a way to create CBR TS file from a high bitrate MXF input file. I have tried to use ffmpeg, but apparently it doesn't do a good job of creating CBR output file so right now I am a bit clueless what I can use. I have tried to use: ffmpeg -i input.mxf -copyts -c copy -muxrate 200M -f mpegts output.ts ...
I found a way to achieve rather nice looking and smooth output CBR with 10-15% of stuffing. Unfortunately it requires transcoding of the original file: $ffmpeg -i input.mxf \ -c:v libx264 \ -x264opts nal-hrd=cbr \ -b:v 30M -minrate:v 30M -maxrate:v 30M -muxrate 35M -bufsize:v 25M \ -acodec aac -ac 2 -b:a 128k \ -f mp...
Create CBR TS file from MXF file
1,552,663,800,000
I am trying to install ffmpeg on a CentOS 6.8 server and I am getting some errors relating to required libs. How do I install those missing libs? Where do I find them? What should I do to install FFMPEG? Here are the errors: Error: Package: libavdevice-2.6.8-3.el7.nux.x86_64 (nux-dextop) Requires: libcdio_...
looks like you have been using both DAG and NUX repos. NUX repos are more updated, so when yum looks for dependencies it gives those for CentOS 7, I'm sure that is the reason dependencies do not get installed. If you disable NUX for a moment, and only use DAG for this purpose, I think the instructions mentioned here w...
How do I install ffmpeg on CentOS 6.8 with all dependencies? I am getting many "Error package ... requires ..."
1,552,663,800,000
I'm trying to use a url piped from tshark into a while loop. while read line ; do echo "$line" ffmpeg -i "$line" -c copy "filename" done < <(tshark -i tun0 -B 50 -P -V -q -l -Y 'http matches "(?<=\[Full request URI: )(http://mywebsite.com/file.*)(?=\])"' 2>&1 | grep --line-buffered -Po "(?<=\[Full request URI: )(http...
Edit: It appears the grep is capturing a newline or carriage return which is fine when you submit it as a one off command but not fine in the loop. Add tr -d '\r'
How to use a greped url provided by tshark inside a bash script?