Hot answers tagged

85

Concat demuxer This allows you to loop an input without needing to re-encode. Make a text file. Contents of an example text file to repeat 4 times. file 'input.mp4' file 'input.mp4' file 'input.mp4' file 'input.mp4' Then run ffmpeg: ffmpeg -f concat -i list.txt -c copy output.mp4 For Linux users This example is the same as above but you don't have to ...


27

With ffmpeg 2.8.4, the following command creates output.mp4 that is a repeating copy of input.mp4 until the ffmpeg process is stopped: ffmpeg -stream_loop -1 -i input.mp4 -c copy output.mp4 This command won't terminate on its own, and the output file will grow infinitely.


19

IANAL, but as far as I understand it, if you're charging viewers for h.264 / MPEG-4 AVC content you may need to pay license fees. Even though x264 / ffmpeg are Free with a big F, they are just software libraries for encoding video streams into the H.264/MPEG-4 AVC format, which is covered by the MPEG patent. But the threshold for when fees are applicable is ...


18

A really good program you can use is Handbrake. It's a very popular program among so called "pirates" because it's really good at getting a high quality even at tiny file sizes. And this is with good reason, because the main purpose of Handbrake is, indeed, to make the movies small with high quality. Personally I use it when I distribute my short movies on ...


15

At least on FFmpeg 2.8.x (but oldie should works too) you can use lavfi as input format and complex filter graph using movie and setpts filters as a argument for -i option. Next command doing this work for you: ffmpeg -re -f lavfi -i "movie=filename=input.mp4:loop=0, setpts=N/(FRAME_RATE*TB)" output.mp4 Zero loop= arguments means infinity loop. Values ...


13

Use bitstream filter filter_units with ffmpeg 4.0 or newer. ffmpeg -i INPUT -c copy -bsf:v 'filter_units=remove_types=6' OUTPUT P.S. /* NAL unit types */ enum { H264_NAL_SLICE = 1, H264_NAL_DPA = 2, H264_NAL_DPB = 3, H264_NAL_DPC = 4, H264_NAL_IDR_SLICE = 5, H264_NAL_SEI ...


12

Let me explain you from scratch. MOV, MP4, AVI, MKV etc all these are just containers, It is just kind of wrapper which contains audio, video, text, metadata file together as one file. It does not play a big role in the size of a file. Size of the file heavily depends on audio and video codec and bit-rate of that audio video codecs. So there is a ...


9

Edit: I should probably remove some of the worrying conclusions about using x264 / ffmpeg that I now believe are unfounded. I put a section at the end to clear it up. For now I'm going to leave the whole mess here. Don't panic, x264 and ffh264 appear to be fine, legally, even for producing commercial videos at the standard royalty rates. Just to clear up ...


9

Run ffmpeg -i titlefile.mp4 -vf setdar=16/9 -video_track_timescale 29971 -ac 1 newtitle.mp4 and then run concat with the new title video. Modern containers like MP4 have Presentation TimeStamps, which are denominated with reference to a timebase. So, if the timebase value is 1/500 and a frame's PTS is 200, then that tells the video player to show that ...


8

ffmpeg looks promising. Might be worth a shot. Specifically, the command ffmpeg -i video.mp4 -i audio.m4a -acodec copy -vcodec copy output.mp4 should do the trick.


8

No most video formats (nearly all) do not allow custom ICC color profiles to be embedded. (Improvemet/correction: MP4s can have color profiles tagged in the metadata of a video file.) most video on the consumer end is intended for the REC.709 color space. sRGB is similar and uses the same primaries. transcoding (including compressing) will almost always ...


8

Hope this explanation is what you're looking for: When you transcode to an encoding such as H.264 (MPEG-4 part 10) you necessarily also resample the video, that's part of H.264 compression technique. Nontheless, I doubt if this is the reason you experience a timing gap since the resampling doesn't necessarily influence the clock rate of the media. So, I ...


7

Yes. M4V is a slight extension to the MP4 container format. M4V is Apple's version, which adds optional DRM-encryption. So if the video is DRM-protected (i.e. came from the iTunes store) it should stay as m4v (and will open by default in iTunes). If it's not, it can be used with either extension, and many players will be happy either way. By default, .m4v ...


7

What is your definition of huge and what is your definition of high quality? Size is directly related to compression and compression is directly inversely related to quality for the most part. Some amount of compression can be had for free using lossless compression or near free with more efficient pattern finding for lossy compression, but for the most ...


6

Regular ffmpeg won't do this. You'll need a combination of two tools to carry this out. #1 Use ffmpeg from direct264, a modded version of an old ffmpeg build with a custom filter to modify H264 bitstreams. This build is crippled in most other ways, so rename it or don't put it in your path. ffmpeg -i in.mp4 -vcodec copy -acodec copy -vbsf h264_changesps=...


6

I recently encountered this exact problem and I was able to repair the file using Untrunc, a program created specifically to solve this problem, as suggested by sparrowt on SuperUser: For this method you need: another video file which isn't broken a linux installation (I used Ubuntu 12.04) and basic ability to use a command line. This is ...


6

Generally, it’s a bad idea to store data on SD or micro SD cards for any substantial period of time. If you’re a hobbyist, traveling, and plan to transfer to a hard drive when you get home, that’s fine. But if you’re a traveling media specialist, you want to get your data off of SD/micro SD as soon as possible, for a number of reasons; Those cards are ...


5

MP4 has not really an official meaning. But it adds a lot to the MPEG-confusion: MPEG-4 part 14 container: takes an .mp4 file extension, therefore often just called MP4, if it contains audio, it can also have the .m4a extension, for video .m4v, and others (.m4p, .m4b, .m4r). the container format is a derivative of Apple QuickTime's container format (.mov). ...


5

The key is to dial in the bitrate - you'll need about 800kbps video with 100kbps audio to hit 200MB. That's low for for SD resolution, but it might be good enough for you. Also look for software that has an option for 2-pass encoding. Try Expression Encoder, Adobe Media Encoder, or Sorenson Squeeze.


5

You can use AtomicParsley to parse the metadata of a MP4-file. For example AtomicParsley /path/to.mp4 -T 1 will print the whole atom tree.


5

Maybe I'm a bit late, but I'd use bento4 mp4dump, it's really easy to install on mac with brew brew install bento4 mp4dump 1.mp4 [ftyp] size=8+16 major_brand = iso5 minor_version = 200 compatible_brand = iso6 compatible_brand = mp41 [moov] size=8+740 [mvhd] size=12+96 timescale = 1000 duration = 0 duration(ms) = 0 ....


5

One big loss in converting VHS to DVD arises from going through the composite domain. Both VHS and MPEG2 use a separated chroma paradigm -- on the VHS tape are two signals, essentially luma and bandwidth-limited chroma. MPEG2 (the standard for DVD) also uses separate luma and chroma. But the standard output from a VHS player combines the signals in a way ...


5

The Mainconcept or Sony codecs in Vegas are subpar for low-bitrate output such as needed for HTML5 use. Use ffmpeg to generate your HTML5 videos. Yes, mono audio is acceptable for HTML5 use, but once you use ffmpeg/x264 for generating those videos, the 6kB/s savings you get from switching to mono audio won't matter much if at all. Get the 32-bit static ...


5

Change the ” to a ". Avoid using TextEdit or other "smart" editors to edit your scripts and shell commands. They will mangle it with fancy quotes and other oddball characters and ruin your commands.


5

For video, stream_loop option should be used. ffmpeg -y -stream_loop -1 -i video -i audio.mp3 -fflags +shortest -max_interleave_delta 50000 -c copy output.mp4 You'll have to use a very recent version of ffmpeg (> Nov '17) as stream_loop had a bug, only recently fixed. Since video encoding is expensive in terms of time and CPU, I've used streamcopy. For ...


5

The most reliable way to ensure a desired length for an output is to specify -t X on the output. But if you need adaptive limiting of the output duration, use ffmpeg -loop 1 -framerate 5 -i 000.png -i 000.wav -c:v libx264 -c:a aac -b:a 192k -shortest -fflags +shortest -max_interleave_delta 500M out.mp4 The fflag is applied deeper in the processing ...


4

As it was shot by its creators is kind of a nebulous concept, particularly when compression is involved. Color reproduction varies greatly from one device to another and without a calibrated display and a complete chain of color control going back to the source, you aren't going to get exact. Even then, chances are good that somewhere along the line the ...


4

I think the simplest way to this is to use MP4Box. ./MP4Box -add file1.mp4 -cat file2.mp4 -cat file3.mp4 output.mp4


4

I encountered the same issue when I turned the sound off in the sequence. When I re-enabled audio export, even though I didn't want to or need to, it saved as an mp4 again.


4

There's no way to do this losslessly, other than setting a meta-data flag and depending on players to rotate the video. (This is what cell-phone cameras do). With avconv / ffmpeg, what you're doing is using your decoded -> transposed video as a source to encode with x264. See https://trac.ffmpeg.org/wiki/Encode/H.264 for how to do this. IDK where you ...


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