130
votes
Accepted
Repeat/loop Input Video with ffmpeg?
-stream_loop option
ffmpeg -stream_loop 3 -i input.mp4 -c copy output.mp4
This can avoid re-encoding because it can use stream copy.
0 means no loop, -1 means infinite loop.
This may not work with ...
30
votes
Repeat/loop Input Video with ffmpeg?
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 ...
22
votes
Accepted
MP4 / h.264 patent issues?
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 ...
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 ...
15
votes
Repeat/loop Input Video with ffmpeg?
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 ...
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,
...
12
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.
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 ...
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, ...
8
votes
Accepted
Do video formats support colour profiles?
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 ...
8
votes
MP4 / h.264 patent issues?
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 ...
8
votes
Accepted
Video converted by FFMPEG has a different duration, why?
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. ...
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 ...
6
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
...
6
votes
Accepted
Convert mkv to mp4 (or webM) with the output file viewable in the process
This is possible for MP4, with a caveat. The command below will generate a fragmented MP4, which you can view in a browser while the conversion is taking place. However, only the fragments completely ...
6
votes
Accepted
Removing MP4 encoding information
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 ...
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 ...
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 ...
5
votes
Accepted
How to extract MOOV atom/metadata from MP4 file?
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
votes
Quality of VHS converted to DVD
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 ...
5
votes
Removing / Overlaying logo on mp4 video format with ffmpeg on linux
Your command is missing double quotes around the filter definition :
ffmpeg -i input.mp4 -vf "delogo=x=270:y=190:w=40:h=40" -c:a copy output.mp4
(as explained in FFmpeg filters documentation)
...
5
votes
Accepted
Does the MP4 HTML5 compatible video type allow for mono audio?
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 ...
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.
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 ...
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 ...
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 -...
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 ...
4
votes
Accepted
Adobe Premiere saves m4v instead of mp4
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
votes
Avconv rotating mpeg4 - video loses quality
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 ...
4
votes
Accepted
Is it possible to create a continuously looping video?
I make similar videos for our corporate reception, interstate and overseas offices, events, conferences and presentations etc. The answer is to look outside the video file itself and focus on the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mp4 × 246ffmpeg × 107
video × 52
h.264 × 24
encoding × 20
conversion × 20
codec × 18
audio × 17
file-formats × 15
premiere × 13
compression × 13
mkv × 12
video-editor × 11
video-quality × 11
transcoding × 11
editing × 10
webvideos × 10
subtitles × 9
youtube × 8
avi × 8
streaming × 7
video-recording × 7
framerate × 7
windows × 7
software-recommendation × 6