Tag Info

New answers tagged

2

Different filter on each side I cropped the image to make the output size smaller just for display purposes. This will show the whole video on each side. Left is xbr and right is scale. ffmpeg -i input.avi -filter_complex \ "[0:v]xbr=4,pad=iw*2[bg]; \ [0:v]scale=iw*4:-1:flags=neighbor[fg]; \ [bg][fg]overlay=w,format=yuv420p[v]" \ -map "[v]" -map 0:a ...


2

The first number in the -map option is the input file index. So if you're using 0 twice, you're only using testing.mp4. Try this instead: ffmpeg -i testing.mp4 -i rkelly.mp3 -c copy -map 0:v:0 -map 1:a:0 -shortest out3.mp4 Here, 0:v:0 selects the first video stream of the first input file, and 1:a:0 selects the first audio stream of the second input ...


1

I don't see a way to do it with ffmpeg easily. There is a segment muxer but you can't set the duration of segments. There's nothing stopping you from doing it like this, which I believe is fairly simple. Just create a text file containing a comma-separated list of start points and durations: $ cat split.txt 00:01:05,5 00:06:10,2 00:08:25,1 And then in ...


1

Writing many small files is slow. That’s why the CPU isn’t at 100% load, but your hard disk probably is. That’s of course not referring to writing at 100% possible throughput, but how fast your disk can service requests. Because creating files involves access to many regions of the disk that might be apart quite a bit, your disk’s access latency is the ...


1

As always, there are multiple ways of performing tasks like this within FFmpeg. The one I am most familiar with is using the channelsplit filter to separate your audio streams and define labels for each of them. That way you can perform various filters to any one of the channels individually, and map the output to include any combination of channels you ...


1

Here's a method using alphaextract, alphamerge, hue, boxblur, and overlay. Original input, filtered output, mask image. Example: ffmpeg -i input -loop 1 -i mask.png -filter_complex \ "[1:v]alphaextract[alf]; \ [0:v][alf]alphamerge,hue=s=0,boxblur=5[fg]; \ [0:v][fg]overlay[v]" -map "[v]" -map 0:a -c:a copy output The mask should be the same size ...


0

It seems to be a new "feature": ffmpeg spams "Past duration x.y too large" messages With ffmpeg version 2.6.2 they get written out once per frame information (frame=...) and with 2.6.git they occur mostly at the start of the recording and then at irregular intervals.


0

You need to tell the image file demuxer to interpret the pattern like a glob and add quotes around the pattern: ffmpeg -pattern_type glob -i "*.jpg" -vcodec mpeg4 timelapse.avi


0

Usually, for such usage, I use the following line : mencoder mf://*.jpg -mf w=[width]:h=[height]:fps=[fps]:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o out.avi


0

Here's a method using: ffprobe to get the duration bc to calculate half the duration ffmpeg to make the thumbnail image Example: input=video.mp4 duration=$(ffprobe -v error -show_entries format=duration -of default=nw=1:nk=1 "$input") ffmpeg -ss "$(echo "$duration"/2 | bc)" -i "$input" -q:v 2 -vframes 1 output.jpg You can replace my lazy usage of bc ...


0

You need to provide two things: The proper dependencies The proper configure options PNG decoding dependencies PNG decoding depends on the zlib library, so you need to install whatever package provides zlib.h before compiling ffmpeg. configure options --enable-decoder=mjpeg,png --enable-demuxer=image2 --enable-protocol=file --enable-zlib This is ...


0

Try using MP4Joiner. I have used this tool to accomplish exactly what you appear to be attempting. PS sorry about the reply to the old question, but for others browsing here this tool works very well.


2

I also get stuck with this problem and find solution, and maybe it would help anyone in future. You just need to open regedit and find "Realtek" (or any other part of device name), one of the results would be like on the screenshot below. Just open "FriendlyName" parameter and rename your device as you wish. Screenshot:


1

ffmpeg -i BigBuckBunny_320x180.mp4 -ss 00:00:09.000 -t 60 -q:v 1 -r 1 -f image2 image_%05d.jpeg -ss start time -t duration from start time or use trim ffmpeg -i BigBuckBunny_320x180.mp4 -vf trim=09:69 -r 1 -f image2 image_%05d.jpeg How to get duration of video example. ffprobe -v quiet -show_streams -select_streams v:0 -show_entries ...


0

You need to merge both inputs into a single stream with amerge. This will create a 4-channel audio stream (assuming both inputs are stereo) which will then be downmixed back to stereo with -ac 2. ffmpeg -i video.mp4 -filter_complex \ "amovie=music.m4a:loop=0[loop]; \ [0:a][loop]amerge=inputs=2[a]" \ -map 0:v -map "[a]" -c:v copy -ac 2 -shortest -movflags ...


0

Please read this doc, it cans help you alot (Manipulating audio channels with ffmpeg) https://trac.ffmpeg.org/wiki/AudioChannelManipulation


1

As you've notices the amerge filter combined both stereo inputs into a 4-channel output. The current 4-channel layout: c0 is the left channel from L.wav c1 is the right channel from L.wav c2 is the left channel from R.wav c3 is the right channel from R.wav You can add the pan filter to mix the desired channels back into a stereo output. As far as I can ...


0

Appreciate both scripts, great way to split videos. Still, I had some problems with videos not showing correct time afterwards and I wasn't able to jump to a specific time. One solution was to demux and then mux the streams using Mp4Box. Another, easier way for me was to use mkvmerge for splitting. Therefore, both scripts had to be altered. For ...


1

I just updated my ffmpeg tool version from 0.x.x, to 2.4.2. New version don't has this issue.


0

I think you can use the following command now. ffmpeg -i inputFile -vcodec copy -acodec copy -ss 00:09:23 -to 00:25:33 outputFile Have a look also ffmpeg Doc


1

I had the same problem. But I found a solution. I search for the file by extension using: find ~/ -iname "*.mxf" The system found the file with the exact same name I tried before. Use the command for conversion copying the name of the file from the previous search with location inclusive. This time it will work. :)


1

I had similar issues with the concat filter and I think it's due to the differing time bases used for the inputs. I overcame it with the concat protocol method. I think it's showing variable framerate for your trim-only output because with a 1/90000 base time a 60Hz video will have expect a frame every 1500, but the concat filter may have smushed two ...


2

Can I know if in the file exists on a specific date (for example, January 1, 2014)? Can I analyze the meta-data stream of the h264 ? No, because the stream is simply an H.264 bitstream with (simply speaking) one frame after another. It does not contain any metadata. When you want metadata, you need a container, e.g. an MPEG-2 Transport Stream, which is ...


1

ffmpeg on its own cannot do that. You have to figure out the duration of the individual segment yourself, as there's no way to specify a minimum duration. For this you'd probably iterate over the total length of the video twice. In the first run, determine the length of the segments. If you find that the last segment is shorter than, say, 15 seconds, you ...


1

As far as I can tell, the FLV format does not officially support uncompressed audio in PCM format (see the spec). However, you can still multiplex PCM audio into FLV with ffmpeg. There seems to be a bug or incompatibility with ffplay not playing the audio correctly, but it works for me in VLC: ffmpeg -i sample.mkv -c copy sample.flv If you want to be more ...


1

The answer therefore seems to be: Method 1 is verified to work, but is libx264-specific, and comes at the cost of eliminating the very useful scenecut option in libx264. Method 3 works as of the FFMPEG version of April 2015, but you should verify your results with with the script included at the bottom of this post, as the FFMPEG documentation is unclear ...


0

No, there isn't an option in ffmpeg to specify a subtitle track that should be shown by default. (ffmpeg version 2.6.1 built with gcc 4.9.2 (GCC) 20150304 (prerelease) as default on Arch, see end of answer for compile flags) Resources highlighting the lack of command line options for setting default/forced subtitles stream in ffmpeg include the following: ...


2

From the options in your question, I would use Method 1, as it's the most robust. You should simply set the keyint and min-keyint to the same value and disable scene detection. If you don't disable scene detection, the "counter" will indeed be reset, and your keyframes end up at irregular intervals. Note that I am not assuming variable framerate sequences ...


1

There is a difference between Sample Aspect Ratio (SAR) and Display Aspect Ratio (DAR). If you want to change the video to display at 4:3, you will need to resize the image. If you want to use FFmpeg to resize without re-encoding, try: ffmpeg -i [INPUT] -s 720x540 -c copy [OUTPUT] You can also try changing just the DAR with: ffmpeg -i [INPUT] -aspect ...


1

You cannot codec copy when applying a filter. Also, Youtube has a max framerate of 60fps, so if that is your end goal, you will be dropping frames from your variable framerate file at some point within the transcoding chain anyway. It's hard to give better advice without having more specific knowledge of your file type, and what your desired end format is. ...


1

In general it is not safe to parse the output of ls(see below) and similarly "*.*". I suggest to use find it protects you from unusual file name with special character. #!/bin/bash #Convert files using ffmpeg OrDir="/Volumes/Misc/To Convert 2/" find "$OrDir" -type f -exec /bin/bash -c \ 'f2=$(basename "$1"); \ ffmpeg -i "$1" -c:v libx264 -crf 19 ...


2

As the directory name contains spaces, you need to quote "$DIR" to prevent spaces from being parsed as word separators. I would also suggest you slightly change the for loop: #!/bin/bash DIR="/Volumes/Misc/To Convert 2" cd "$DIR" for i in *.*; do ffmpeg -i "$i" -your_option "/Volumes/Misc/Converted/${i%.*}.m4v" done


0

If you want ACCURATE duration, forget FFMEG. It only gives an estimate based on filesize and average bitrate. I've found, in some case, the estimated duration time off by 2x! On Linux, if file is created and modified only during the said video recording, an alternate solution would be to use creation and last modification time to calculate duration, ...


0

Your guess is correct, that the video quality has nothing to do with the video encoding, but the deinterlace filter. You are using yadif, but if you are unsatisfied with its quality have a look at the other deinterlacing filters kerndeint, mcdeint and w3fdif. You can find usage details and options in the ffmpeg documentation.



Top 50 recent answers are included