Tag Info

Hot answers tagged

5

concat filter This method is best if you need to perform additional filtering: Use the trim, atrim, setpts, asetpts, and concat filters: ffmpeg -i input -filter_complex \ "[0:v]trim=60:65,setpts=PTS-STARTPTS[v0]; \ [0:a]atrim=60:65,asetpts=PTS-STARTPTS[a0]; \ [0:v]trim=120:125,setpts=PTS-STARTPTS[v1]; [0:a]atrim=120:125,asetpts=PTS-STARTPTS[a1]; \ ...


5

The -loop option is specific to the image file demuxer and gif muxer, so it can't be used for typical video files, but you can use the concat demuxer. Concat demuxer Make a text file. Contents of an example text file to repeat 4 times. $ cat list.txt file 'input.mp4' file 'input.mp4' file 'input.mp4' file 'input.mp4' Then run ffmpeg: ffmpeg -f concat ...


4

Re-muxing only Use stream copy mode to just re-mux instead of re-encode: ffmpeg -ss 01:07:29 -i input -codec copy -map 0 -to 01:08:05 fight.avi Using -ss as an input option can be faster than using it as an output option, but it may not be as accurate. -codec copy will stream copy (no re-encoding). Default behavior, if -codec copy is omitted, is to ...


4

Why would you want your videos in the .3gp container to begin with? Its a very irrelevant format nowadays, there is practically no device that supports the 3gp container but not MP4 at the same time. Its nothing but a close derivative of MP4, they are very similar container formats holding the same codec. If you want to support a lot of devices using h264 in ...


4

Couldn't wait! Figured it out: I saved an image to the file out.png at a fixed frame rate from processing. Created a fifo: mkfifo fifo Then in one terminal: tail -f out.png > fifo Then in another terminal: cat fifo | ffmpeg -f image2pipe -r 1 -i pipe:0 spo.mp4 Making sure to close tail first allowing ffmpeg to write the last bit of the file.


3

That's way more than h.264 can handle. The maximum resolution for h.264 is 4096×2304 with Level 5.1 or 5.2. http://en.wikipedia.org/wiki/H.264#Levels There are lossless codecs who can theoretically handle this video resolution but it would make no sense to do this. There is no hardware capable of playing videos in this resolution at any acceptable frame ...


3

One method is to use the overlay video filter. Assuming your video is 640x480, 30 seconds duration, 25 frame rate: ffmpeg -f nullsrc=s=640x480:d=35:r=25 -i video.mp4 -i audio.wav -filter_complex \ "[0:v][1:v]overlay[video]" -map "[video]" -map 2:a -codec:a copy -shortest output.mkv I set the duration of the nullsrc source filter to be 5 seconds longer ...


3

Apparently by default ffmpeg only copies one stream of each type. To tell it to copy all streams, you need -map 0 So, this does it: ffmpeg -i "concat:a01.mxf|b02.mxf" -y -map 0 -c copy result.mxf


3

The H.264 standard defines maximum bit rates for 1280x720@30fps as between 14.000 and 42.000 kbit/s, depending on the profile (baseline, main, high etc.). It's even higher for higher frame rates. (http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC) Sony Vegas standard rendering templates use bitrates between 2 and 16 Mbps. Youtube recommends bitrates between ...


3

No this is not possible. Looking at this theoretically disregarding the codec you can not take away information and call it lossless, thats already a terminology problem. Applying a new color space without transcoding is also not possible It's not so easy to say whether this is even possible with certain codecs other than h264, it really depends on how you ...


3

You specify a preset and a quality value at the same time and by that overriding the preset. I would also recommend you don't encode with ffmpeg while capturing as this would be pretty slow on most PCs. The "error" in your ffmpeg commandline is the option -crf 1. CRF is a quality setting of x264 and the lower the value the higher the bitrate of the video ...


3

-preset Use the slowest preset that is fast enough that it does not drop frames. You can see if ffmpeg is dropping frames in the console output (if I recall correctly). Presets are: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow. -crf Use the highest -crf value that still provides an acceptable quality level. Range is 0-51. 0 ...


3

A container is what the name implies, a container for video data and audio data (and other misc. data). This might go a little bit under your know-how but just to make it easy to understand: A video is made up by frames which are made up by pixels. A codec like h265/HEVC is there to take this pixel information and process it in a way that makes it a lot ...


3

A videofilter in ffmpeg always has to modify pixel information hence the reason why you need to re-encode. It seems logical at first that you wouldn't have to do this when cropping but the way lossy video codecs work makes this pretty impossible without re-encoding everything. They usually don't see an array of pixel information but a much more complex ...


3

Yes, this is possible using ffmpeg and the mkv container. An example command sequence would be: ffmpeg -i input1 -i input2 -c copy -map 0 -map 1 output.mkv source Breaking down the command: -i input1 This selects the first input file. Could be something like my video_track1.mov. -i input2 Here you can specify the second input file. You can add another ...


3

You could possibly use the curves filter. It has a lighter preset: ffmpeg -i input -vf curves=preset=lighter -c:a copy output The red, green, and blue components can be adjusted separately. The following is the same as what the lighter preset uses: curves=r='0.4/0.5':g='0.4/0.5':b='0.4/0.5' Additionally you can make your own curves preset in ...


3

x264 must be compiled with --bit-depth=10. Note that the resulting build will not be able to output 8-bit depth. Of course you can have separate builds, but whatever build ffmpeg is linked to will determine what bit depth it can output.


3

I think it is easier to combine a full dimension background image (720x500px) with your video in ffmpeg instead of adding the 20px footer to the video. You can simply use the overlay filter for this: ffmpeg \ -loop 1 -i 720x500.jpg \ -i 720x480.mp4 \ -filter_complex overlay=0:0 \ -t 0:01.48 \ out.m4v Note: In this example you have to ...


3

You can use the pad video filter to add the required space on the bottom, and then the overlay video filter to place the image: ffmpeg -i video.vob -i image.png -filter_complex \ "[0:v]pad=0:ih+20[bg];[bg][1:v]overlay=0:H-h,format=yuv420p[v]" \ -map "[v]" -map 0:a -c:v libx264 -c:a aac -strict -2 -movflags +faststart output.mp4 I had to make some ...


2

To expand on LordNeckbeard's answer, yes, just mux the JPEG data into an MJPEG video stream. That will be the smallest representation of the exact sequence of output images, even though MJPEG is a terribly inefficient codec by today's standards. (no temporal redundancy, and not even any intra prediction. You can make a variable-framerate MJPEG video to ...


2

This will output a lossless H.264 video where frames will use information from other frames ffmpeg -f image2 -r 30 -i %09d.jpg -vcodec libx264 -profile:v high444 -refs 16 -crf 0 -preset ultrafast a.mp4 Explanation of options: -f image2 - tells ffmpeg to select a group of images -r 30 - tells ffmpeg to encode at 30 frames (or images) per second (change ...


2

I struggled with a similar issue on Ubuntu 12.04.3 LTS. I fixed the problem using the static ffmpeg build which is available from http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.latest.tar.gz


2

The first thing that I noticed is that your camera is delivering yuv422p - which isn't bad in and of itself, but you could try forcing it to yuv420 by adding -pix_fmt yuv420p to your command. (This is nice if you ever plan on displaying your video on anything that isn't linux.) The second thing that I noticed is that the start times are wildly different - ...


2

Although I am not sure if stderr will really help here because of the way that ffmpeg does its reporting, I can recommend the following pattern. Use the -progress [url] flag and parse it with the tool of your choice every 100ms or so. Here is something to get you started that (with a little tweaking) might do what you want: #!/bin/bash touch ...


2

It varies a little from one server to another, but the basic components are an encoder/streaming client on the local client that takes input from the camera and turns it in to a stream that can be sent to the stream server on the VPS. The job of the stream server (such as Red5) is then to provide a publishing point that relays the stream to viewers. The ...


2

I found a helpful post on stackoverflow that addresses this issue: http://stackoverflow.com/a/21400416/377875 Apparently, it's a problem with color space. Something like this works: ffmpeg -i "$1" -i "$2" \ -filter_complex "[1:0] setsar=sar=1,format=rgba [1sared]; [0:0]format=rgba [0rgbd]; ...


2

Depending how the content was made, the banding might be introduced when you're converting your content from RGB colorspace to YUV. You can try to make an h264 while keeping RGB colorspace, although I've read it's not easy. Are you able to use another codec?


2

The bands you're referring to could well just be a limitation of the 8-bit colour space. In theory the way to solve this is to use 10- or 12-bit colour space through every stage from rendering, to editing and mastering, through to output and even in the screen or projector. However your final output is probably going to be displayed in an 8 bits per ...


2

You can use ffmpeg with the compand audio filter (a port of sox effect filter of same name) to "compress or expand the audio's dynamic range", but admittedly this is one of the more complicated audio filters. Example from the documentation Make music with both quiet and loud passages suitable for listening to in a noisy environment (whatever that means): ...


2

You are re-encoding the video rather than cutting out a portion of the stream. Any re-encode is going to produce quality loss, particularly when you cut the data rate to less than 1/11th of the original data rate. If you want to cut out a portion of the video, you need to use a tool like VirtualDUB to actually extract a portion of the actual video stream ...



Only top voted, non community-wiki answers of a minimum length are eligible