Hot answers tagged

28 votes
Accepted

ffmpeg: how to add several subtitle streams

Whenever's there's multiple inputs fed to ffmpeg, and you need one more than video/audio/subtitle stream sent to the output, -map statements are needed. ffmpeg -i $movie.mov -i $sub_en.srt -i $sub_de....
Gyan's user avatar
  • 32.6k
7 votes
Accepted

Why does AAC have two Sampling rates?

tracks show two different sampling rates. (...) Can anyone explain what this means? I always thought one audio track can only have one sampling rate. Is this just a different way of describing one ...
Jérôme Martinez's user avatar
7 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 ...
Gyan's user avatar
  • 32.6k
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 ...
Pingger Shikkoken's user avatar
5 votes

Join multiple M4V to one file (maybe MKV?)

If you have ffmpeg installed, see this article that basically says to create a file that has all of the names, or to use the following command Concat Protocol ffmpeg -i 'concat:input1|input2' -...
bret7600's user avatar
  • 197
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
3 votes
Accepted

Trim audio stream to video stream length

One should use the avformat library flag to stop muxing with the shortest stream. ffmpeg -i file.mp4 -map 0 -c copy -fflags +shortest -max_interleave_delta 1G -movflags +faststart out.mp4
Gyan's user avatar
  • 32.6k
3 votes
Accepted

I have a .mkv video file I need to use but it is apparently infinite

So I've found the issue to be related to inconsistent framerates. I found that running the video through ffmpeg with ffmpeg -i yourfile.mkv -c:v copy -c:a copy -r 30 newfile.mkv actually fixed the ...
Caden Mitchell's user avatar
3 votes

Is it possible to encode MP4 video with VP9 codec?

ffmpeg v4.0.2 or higher can encode/transcode VP9 in mp4. Commandline (when transcoding): ffmpeg -i INPUT.MKV -c:v libvpx-vp9 OUTPUT.MP4 Commandline (when remuxing (Super fast)): ffmpeg -i INPUT.MKV -c:...
Manthaar Janyaro's user avatar
2 votes
Accepted

How to display subtitles as default in an MKV file

There are two aspects to your query - 1)setting one of the subtitle streams as the default and 2)automatically displaying it during playback.I'm not aware of a method to force a player to display ...
Gyan's user avatar
  • 32.6k
2 votes

MKVToolNix equivalent for .MP4's

dmMediaConverter is very similar to MKVToolnix. It is just a ffmpeg gui, so it can save in any format. To replicate the described MKVToolnix use, select "Convert", then "Add files", selecting both ...
cipricus's user avatar
  • 131
2 votes
Accepted

MKVToolNix equivalent for .MP4's

Muxing a file simply means to extract individual streams out of existing container files or mix existing streams together into a new container file. For MP4, this can be done with ffmpeg and the -c ...
MoritzLost's user avatar
  • 5,412
2 votes
Accepted

How to stop ffmpeg from interlacing when converting from m2ts to mkv

The source is interlaced. To deinterlace it, you can use the yadif filter. To use it with the default values: ffmpeg -i input.m2ts -vf yadif=parity=auto output.mkv
Gyan's user avatar
  • 32.6k
2 votes
Accepted

How to calculate the length of the video file that was encoded so far?

Short answer is No. Longer answer is, it depends. If you're encoding a file, then generally the output is the duration of the input, unless there's speed change or trim filters or -ss, -to, -t ...
Gyan's user avatar
  • 32.6k
2 votes

Is there any way to efficently compress multiangle recordings?

The name for this feature is Multiview Video Coding (MVC): an stereoscopic video coding standard for video compression that allows for the efficient encoding of video sequences captured ...
Gyan's user avatar
  • 32.6k
2 votes

Editing/Changing Cluster Timecode Element in mkv files (Amazon Kinesis Video)

MKV frame timestamps are relative to the start of the cluster. The cluster timestamps, however can be absolute or relative to the beginning of the "presentation". The frame timestamps are the ...
MushMal's user avatar
  • 21
2 votes
Accepted

Identify H.265 from the OSX Command Line?

You can use ffprobe for this ffprobe file.mkv -show_entries stream=codec_name -select_streams v:0 -of compact=p=0:nk=1 -v 0 For H.265/HEVC, this will print hevc; for H.264, h264 .
Gyan's user avatar
  • 32.6k
2 votes
Accepted

Loop video for the duration of audio

To merge an audio stream with a repeated video stream ffmpeg -stream_loop -1 -i 20s.ts -i 120s.mp3 -map 0:v:0 -map 1:a:0 -shortest -c copy output.mp4 -stream_loop -1 : to loop infinity of video input ...
xer-rex's user avatar
  • 754
2 votes

How can we keep the subtitle track when converting from MKV to MP4 with ffmpeg?

You can find detailed answer on your question here Basically you need to add "-map" parameter to your command. ffmpeg -i myMovie.mkv -c copy -map 0:v:0 -map 0:a:0 -map 0:s:0 myMovieMP4.mp4 -...
Viktor Liashenko's user avatar
2 votes
Accepted

Using FFMPEG to convert an MKV with multiple subtitles, audio tracks and chapters to a plain mp4

There are multiple questions; I'll try to answer them separately for simplicity. First of all, converting from mkv to mp4: The easiest way would be something like this ffmpeg -i input.mkv output.mp4 ...
Euklios's user avatar
  • 166
1 vote

Widely compatible video format with lossless audio

According to Mozilla Developers MPEG-4 containers can include FLAC audio. Ditto for OGG containers.
user38574's user avatar
1 vote
Accepted

Is it possible to remove a border from a Webm video losslessly?

See here https://www.webmproject.org/docs/container/ under section Track. There you find PixelCropBottom, PixelCropTop, PixelCropLeft and PixelCropRight - all of which are supported. These parameters ...
Matt's user avatar
  • 1,401
1 vote

Removing streams in HEVC H.265 MKV file?

In the syntax -map 1:a:24, 1 stands for the input file index. Counting starts from 0, so 1 refers to the 2nd input file but the command only has one input. a stands for stream type, and in this case, ...
Gyan's user avatar
  • 32.6k
1 vote

How can I merge five mkv files I've created in OBS Studio?

In case you will be unable to use MKVToolsNix for whatever reason, there is an older tool which is able to append files quite well: AVIDemux. The process is trivial. Start the program and open your ...
v010dya's user avatar
  • 850
1 vote
Accepted

How can I merge five mkv files I've created in OBS Studio?

This is absolutely not a problem. You can do this with MKVToolNix (specifically with it's GUI, since that is what you have requested). I am on Debian GNU/Linux, if you use something different, your ...
v010dya's user avatar
  • 850
1 vote

FFmpeg does not preserve colors after resizing

There is already a solution here. But I will try to summarize it in brief. You need to specify the correct flags for color properties of the original file. Your original file (as probably many other ...
Tzamutzl's user avatar
1 vote

FFmpeg does not preserve colors after resizing

Ad 1: Try adding the -pix_fmt yuv420p10le option (e.g. before -vf). Or only -pix_fmt + for using the same pixel format as the input video has. If it doesn't help, you obviously have an inappropriate,...
MarianD's user avatar
  • 1,494
1 vote
Accepted

FFmpeg can't convert eia_608 subtitles: "Data Ignored since exceeding screen width"

It's a warning, not an error. The subs are still converted. The EIA-608 standard specifies a maximum of 32 characters per line and the ffmpeg decoder is enforcing that. A workaround is to use ...
Gyan's user avatar
  • 32.6k
1 vote

Is it possible to encode MP4 video with VP9 codec?

FFmpeg, a command-line app, can write VP9 streams in MP4s. Get a static daily/snapshot binary from https://ffmpeg.zeranoe.com/builds/ Basic command is ffmpeg -i in.mov -c:v vp9 out.mov
Gyan's user avatar
  • 32.6k
1 vote

How to stop ffmpeg from interlacing when converting from m2ts to mkv

You can try deinterlacing it at the decoding step with the following command, via the CUVID deinterlacer: ffmpeg -hwaccel cuvid -c:v h264_cuvid -deint 2 -drop_second_field 1 \ -i input.m2ts -c:v ...
Ivan Kolesnikov's user avatar

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