Skip to main content
22 votes
Accepted

How is this .mp4 file 596523 hours long?

There are several things we can note here: The file stops playing after 0:05:30. If you remux the file (mkvtools for example) you do have 5:30 displayed as the length. The original file does in fact ...
v010dya's user avatar
  • 870
17 votes

Merge MP4 with M4A

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.
sgryzko's user avatar
  • 271
13 votes

Removing MP4 encoding information

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, ...
whmiao's user avatar
  • 131
12 votes
Accepted

Big difference in the video file size after the conversion (.mov to .mp4)

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 ...
Unstoppable's user avatar
9 votes
Accepted

ffmpeg concat introduces a/v sync problem

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, ...
Gyan's user avatar
  • 33.4k
8 votes

How to extract MOOV atom/metadata from MP4 file?

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 ...
SkarXa's user avatar
  • 181
8 votes
Accepted

FFMPEG: Loop video to the length of audio

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 ...
Gyan's user avatar
  • 33.4k
7 votes
Accepted

Lossless convert 3gp video to mp4 using ffmpeg

If the codecs of your input file are already h264 and aac for video and audio, respectively, you can just copy without decoding and encoding again. ffmpeg -i input.3gp -c:v copy -c:a copy output.mp4 ...
kamae's user avatar
  • 206
6 votes

Corrupt MP4 [recording interrupted]

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 ...
Ajedi32's user avatar
  • 161
6 votes

How do i increase the volume of a video I recorded?

You can use ffmpeg: ffmpeg -i file_with_quiet_sound.mp4 -af volume=150 -vcodec copy newfile.mp4 It will increase volume of your file at 150 times! Don't worry, big values can do funny effects, I ...
bukkojot's user avatar
  • 675
6 votes

Removing Metadata Title in mp4 files

You can try FFMpeg. There are examples showing how to strip all metadata and removing just a single item isn't much different. Try ffmpeg -i in.mp4 -metadata title= -c:v copy -c:a copy out.mp4 This ...
StarGeek's user avatar
  • 181
6 votes

Need help to fix a broken MP4 which lacks a MOOV atom

As you said you have similar files, you may try the following: 1) any good mp4 file with the same resolution and bitrate to generate the header files: recover_mp4.exe good.mp4 --analyze 2) recover ...
user000001's user avatar
6 votes

Store video files on USB, SD card, microSD, or external hard drive?

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 ...
Jason Conrad's user avatar
  • 4,514
5 votes
Accepted

How to batch covert a folder of mp4 files to avi?

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.
llogan's user avatar
  • 10.1k
5 votes

Why when you specify a video bitrate with ffmpeg does the resulting files displayed bit rate differ?

The issue is that you are using -crf with -b:v. ffmpeg is a well built program, so it's just ignoring -b:v and using -crf. If you want to have a specific bitrate, remove the crf command. CRF is "...
user3643's user avatar
  • 2,306
5 votes

What is the colour range of most videos?

Most videos are limited range i.e. luma goes from 16 to 235, and chroma from 16 to 240. Unless expressly set, FFmpeg does not scale the range from one to another. Whatever the source is, that's the ...
Gyan's user avatar
  • 33.4k
5 votes
Accepted

Add multiple mp3 files to an mp4 file with ffmpeg

Use -i /path/to/mp4File -i /path/to/soundmp3File1 -i path/to/soundmp3File2 -map 0 -map 1:a -map 2:a -codec copy -shortest path/to/output/fileWithSounds FFmpeg will automatically select one video and ...
Gyan's user avatar
  • 33.4k
5 votes

Adding audio to picture: video too long even when using -shortest

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 -...
Gyan's user avatar
  • 33.4k
5 votes

How to extract each video scene with FFmpeg

Using the encoder's scenecut to detect scenes is not advisable, since its purpose is efficient GOP splitting taking into account other encoding parameters. It is not a "pure" scene detector. Its ...
Gyan's user avatar
  • 33.4k
5 votes
Accepted

Smallest Possible Video File in H.264 Format

A one frame H264 stream would have to consist of an intra-coded frame, so there is a size floor in effect. This ffmpeg command produces a 1.7 kiB file ffmpeg -f lavfi -i color=blue:s=1280x720 -...
Gyan's user avatar
  • 33.4k
5 votes

Store video files on USB, SD card, microSD, or external hard drive?

I strongly advice against microSD cards because they will get lost. They're just too tiny. There are external SSDs which weigh not much, 50g maybe 100g, I think this is not much weight. Of course you ...
Matt's user avatar
  • 1,421
4 votes
Accepted

Issues looping a stream with FFMpeg

Try with the movie filter instead ffmpeg -loop 1 -i image.jpg -filter_complex \ "movie=video.mov:loop=999,setpts=N/(FRAME_RATE*TB)[1v]; \ [0:v][1v]overlay=x=main_w*0.44:y=main_h*0.33[...
Gyan's user avatar
  • 33.4k
4 votes

Corrupt MP4 [recording interrupted]

Updated: this tool can now recover files from more sources. Try with recover_mp4_to_h264. It's a command line program, and will require a good reference file. Usage as indicated: recover_mp4 ...
Gyan's user avatar
  • 33.4k
4 votes

Convert mp4 to avi while keeping frame rate and quality and being able to play in QuickTime?

An AVI file is just a container and can contain any codec, so if you want to encode to QuickTime and Media player, you need to: ffmpeg -i input.mp4 -c:v libx264 -c:a libmp3lame -b:a 384K output.avi ...
Fabby's user avatar
  • 196
4 votes

MKVToolNix equivalent for .MP4's

I just went through a very similar use-case working with TS files. MoritzLost has the key point but as ffmpeg options can be quite difficult to sort out when you are first getting started, here is a ...
mattpr's user avatar
  • 141
4 votes
Accepted

Proper command to remux mpeg-ts to mp4 with FFmpeg?

Unless you know you have a specific need to preserve timestamps, there's no need to use -copyts. MPEG-TS, being a format, used for remote viewing, will have some start time offset, by default, to ...
Gyan's user avatar
  • 33.4k
4 votes
Accepted

ffmpeg transpose=clock rotates 180 degrees instead 90

FFmpeg, by default, autorotates videos if a rotation tag is detected. The output video will be oriented upright and have no rotation tag. During processing, this step happens before any filtering is ...
Gyan's user avatar
  • 33.4k
4 votes
Accepted

Is MP4 a valid or common container for ProRes?

No, officially, ProRes is not a registered codec for the ISOBMFF family, of which MP4 is a member.
Gyan's user avatar
  • 33.4k
4 votes
Accepted

How can you convert a WebM with transparency to MP4 with a background color using ffmpeg?

The native VP8/9 decoders don't support transparency, so a) you'll have to force a decoder, b) the way to change transparent pixels is to overlay the video onto the color. ffmpeg -c:v libvpx -i 123....
Gyan's user avatar
  • 33.4k
4 votes
Accepted

Errors in converting mp4 to ts with FFmpeg

a) -bsf h264_mp4toannexb applies the filter to all output streams but it has to be applied to only video streams. b) In any case, newer versions of ffmpeg, like the one you have, will automatically ...
Gyan's user avatar
  • 33.4k

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