Hot answers tagged

129 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 ...
user avatar
  • 9,159
54 votes
Accepted

Fix bad files and streams with ffmpeg so VLC and other players would not crash

If parts of the file reside on physically bad sectors, or for whatever reason, the OS cannot serve the whole file to FFmpeg, then naturally FFmpeg can't do anything about that. You should get a ...
user avatar
  • 30k
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 ...
user avatar
  • 436
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 ...
user avatar
  • 13.3k
16 votes
Accepted

encoding 4:2:2 in 10-bit with libx264

x264 supports both 8-bit and 10-bit outputs, and you don't have to do anything special. ffmpeg If using ffmpeg you can see what pixel formats and bit depths are supported by libx264: $ ffmpeg -h ...
user avatar
  • 9,159
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 ...
user avatar
  • 251
13 votes
Accepted

H.264 or VP9 for encoding for YouTube?

tl;dr: Since Youtube reencodes all videos regardless of the upload format, it really isn't that important. Just export your video with a high bitrate to preserve quality. Also see my answer here ...
user avatar
  • 5,382
13 votes
Accepted

Using h264 in loseless mode brings small unexpected results

It's an artifact of the player, not the encoder. I used the command below to generate a RGB format capture in HuffYUV ffmpeg -f dshow -video_size 1920x1080 -framerate 30 -i video="screen-capture-...
user avatar
  • 30k
12 votes
Accepted

ffmpeg: explicitly tag h.264 as bt.601, rather than leaving unspecified?

PAL and NTSC have different color primaries, so NTSC = SMPTE 170M = BT 601 525 PAL = BT 470 BG = BT 601 625 See the rows for value 5 & 6 on the table on page 387 of the active H.264 standard. ...
user avatar
  • 30k
9 votes

How can I convert .MTS file (AVCHD) to .mp4 by ffmpeg without re-encoding H264 video stream?

Seeing that in the text of your question you have started discussing other utilities, i will assume that you are not interested in sticking with ffmpeg, but rather in getting the job done. In my ...
user avatar
  • 800
9 votes
Accepted

ffmpeg encode in all-i mode h264 and h265 streams

For H264 ffmpeg -i input -c:v libx264 -intra output For H265, seems no alias or preset has been set yet ffmpeg -i input -c:v libx265 -x265-params frame-threads=4:keyint=1:ref=1:no-open-gop=1:...
user avatar
  • 30k
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 ...
user avatar
  • 2,608
8 votes
Accepted

Differences of h.264 and h.265?

HEVC (High Efficiency Video Coding), the new video coding standard brings promise of huge bandwidth savings of approx. 40-45% over H.264 encoded content More info here
user avatar
  • 216
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 ...
user avatar
  • 30k
8 votes
Accepted

What's the difference between "visually lossless" and real lossless and what does this mean for future encodes?

Technically lossless, or real lossless, means that when the output is decoded by a conformant decoder, the result is mathematically identical to the input. Visually lossless is a non-rigorous term ...
user avatar
  • 30k
7 votes

encoding 4:2:2 in 10-bit with libx264

edit: I successfully made a 10bit encode of Ducks Take Off. First way: I built a 10bit x264 binary that statically links libx264. cp -al x264-git x264-10bit # instead of changing my normal git ...
user avatar
  • 2,608
7 votes

H.264 or VP9 for encoding for YouTube?

YouTube will re-encode whatever you give it. VP9 is currently too slow to encode. So the best choice is to either: Give it the original footage, or if it is not accepted by YouTube or is too big to ...
user avatar
  • 9,159
7 votes
Accepted

H.264 Max Resolution

One of the bits of information associated with a H264 stream is its level. The level informs the decoder the computational resources needed for a successful decode. Turns out that the highest level 5....
user avatar
  • 30k
7 votes
Accepted

What CRF or settings I should choose for h265 in order to achieve a similiar quality of h264?

The CRF scales for x264 and x265 do not correspond. x265 CRF 28 is supposed to be equivalent to x264 CRF 23. But x265 is not yet as mature in its development as x264, so take that CRF equivalence with ...
user avatar
  • 30k
6 votes
Accepted

Can I use h.264 codec inside .mp4 container for my website

You are correct: h.264 is non-free and content producers as well as developers are obliged to pay royalties to MPEGLA for its use - but only if they are charging for their content, and the volume goes ...
user avatar
  • 13.3k
6 votes

Can I use h.264 codec inside .mp4 container for my website

Use it. Nothing else can provide the the same quality per bitrate as x264 (the top-class H.264 encoder) while not taking 10,000 years to encode (x265 'n VP9). Some tips: Use a recent ffmpeg build ...
user avatar
  • 9,159
6 votes

Can H264 achieve "equivalence" with ProRes 422?

Has anyone done or seen any tests comparing Apple ProRes 422 with high-bitrate H.264? No, but I can tell you that x264 can get as close to lossless as you want (or even mathematically lossless, with -...
user avatar
  • 2,608
6 votes
Accepted

Can H264 achieve "equivalence" with ProRes 422?

Well going by the numbers h264 has a lesser bit-depth and color accuracy than ProRes 422. PR422 has 10bit and 4:2:2 chroma sub-sampling, h264 has 8bit and 4:2:0 unless you encode in the Hi422P Intra ...
user avatar
  • 7,069
6 votes
Accepted

Converting video with different resolutions slightly affects in file size, why?

You are using the same bitrate for each video. The bitrate determines how much data is used per second. The resolution has nothing to do with how much data is used, it only impacts the number of ...
user avatar
  • 19.2k
6 votes

H.264 Max Resolution

H.264/AVC is not limited for 4K in terms of max resolution as it supports DCI 4K (4092x2160) @ 60 fps at Level 5.2. For example Sony already uses XAVC which is exactly 4K AVC. For a while the max ...
user avatar
  • 406
5 votes

How can I convert .MTS file (AVCHD) to .mp4 by ffmpeg without re-encoding H264 video stream?

As per this ffmpeg bug Interlaced H.264 packets are split causing MP4 STTS when remuxing a mpeg-ts containing interlaced H.264 into mp4, both fields of each video frame are split into seperate ...
user avatar
  • 30k
5 votes

Fix bad files and streams with ffmpeg so VLC and other players would not crash

In the search of a better answer a possible way could be: ffmpeg -i video.mkv -c copy video_fixed.mkv However I'm pretty sure there are some extra options that can make the result even better..
user avatar
  • 1,384
5 votes

How do I encode videos into h.264 at 8k resolution?

Are you sure the 8k videos on your computer are actually h.264, and not h.265? The max resolution of h.264 level 5.2 is still 4096x2305. To convert beyond that in Premiere, you need to chose HEVC (h....
user avatar
  • 4,151
5 votes
Accepted

It is better to have more B-frames or more P-frame for video streaming?

"Q: Is it better to have more B-frames or more P-frame for video streaming?". From: https://en.wikipedia.org/wiki/Video_compression_picture_types The three major picture types used in the ...
user avatar
  • 827
5 votes
Accepted

How to convert 10-bit H.265 videos to H.264 without losing quality

it looks like the Video is encoded in 4000 kbit/s, instead of a Rate Factor (RF). But that isn't the issue here. The issue is: while 264 does support lossless encoding, it not widely compatible! (you ...
user avatar

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