ffmpeg -i in.mkv -map 0 -c copy -c:s mov_text out.mp4 remuxes H.264, AAC and subtitles into MP4 in under 1 second; a bare -c copy quietly drops the subtitles. ReelSDK runs it over HTTPS for $0.02 per compute minute.

Convert MKV to MP4 with ffmpeg, subtitles included

MP4 takes the H.264 and AAC from an MKV as they are, so the conversion is a remux; ReelSDK's API returned an 11-second file with all 3 tracks in under 4 seconds. The subtitle track is the part that needs care.

GuidesUpdated

remux
ffmpeg -i input.mkv -map 0 -c copy -c:s mov_text \
  -movflags +faststart output.mp4

-map 0 takes every stream, -c copy copies the video and audio untouched, and -c:s mov_text turns the SubRip track into the text format MP4 holds. A 5.5 MB MKV becomes an MP4 of about the same size with all three tracks, in a fraction of a second.

Variations

The other commands you will need

  1. List the streams first

    One line per stream with its index, codec, type and language. Ours printed 0,h264,video, 1,aac,audio and 2,subrip,subtitle,eng.

    inspect
    ffprobe -v error \
      -show_entries stream=index,codec_type,codec_name:stream_tags=language \
      -of csv=p=0 input.mkv
  2. Video and audio only

    Name the streams you want and the subtitles stay out on purpose.

    no-subs
    ffmpeg -i input.mkv -map 0:v -map 0:a -c copy \
      -movflags +faststart nosubs.mp4

The flags

The flags in these commands

The flags in these commands
FlagWhat it doesUsed here
-map 0Selects every stream of the first input, subtitles includedRemux
-map 0:v -map 0:aSelects only the video and audio streamsNo subtitles
-c copyCopies the selected streams without decoding themBoth
-c:s mov_textConverts text subtitles to the format MP4 storesRemux
-movflags +faststartPuts the index at the front so playback starts before the download endsBoth
-show_entries stream=...Makes ffprobe print only the fields you nameInspect

Sources: ffmpeg documentation: stream selection, ffprobe documentation, checked November 2026.

Why plain -c copy loses the subtitles

Without -map, ffmpeg picks streams itself: one video and one audio track. For MP4 it adds a subtitle track only when you name a subtitle codec with -c:s. So ffmpeg -i input.mkv -c copy out.mp4 finished and wrote only the video and audio, and nothing on screen said the subtitles were gone.

Adding -map 0 makes the problem visible: ffmpeg now tries to copy the SubRip track as it is and stops with Could not find tag for codec subrip in stream #2, codec not currently supported in container. MP4 stores text subtitles as mov_text, so the subtitle stream needs -c:s mov_text while the rest is copied. ASS subtitles convert the same way, without their styling.

-c copy -c:s mov_text without -map also works for a file with one track of each kind. -map 0 is still the safer habit, because automatic selection keeps one audio track and an MKV often has several. We read the subtitles back out of the finished MP4 and all three cues were there with their text.

Image subtitles from Blu-ray and DVD rips

PGS subtitles from Blu-ray rips and DVD subtitles are pictures, not text, and mov_text is text. ffmpeg only converts subtitles text to text or bitmap to bitmap; when we pushed our SubRip track the other way, into DVD subtitles, it stopped with Subtitle encoding currently only possible from text to text or bitmap to bitmap.

So a PGS track can't follow the video into MP4. Either leave it out with -map 0:v -map 0:a, keep the file as MKV, or burn the subtitles into the picture, which means re-encoding the video.

When you have to re-encode

A remux keeps whatever codec the MKV holds. If that codec is one your player can't decode, re-encode it: -c:v libx264 -crf 20 -pix_fmt yuv420p -c:a aac gives H.264 and AAC that play almost everywhere, at the cost of time and some quality. The CRF guide shows how to pick the number.

For other containers the same pattern holds: MOV usually copies straight across, while WebM holds VP9 and Opus, which is usually worth converting to H.264 and AAC.

Without installing ffmpeg

The same command as one API call

Post the same args to POST /v1/ffmpeg with the MKV's URL in inputs. Each job runs ffmpeg 8.1 on a fresh machine at $0.02 per compute minute, billed per second; this remux finished in under 4 seconds and cost under a fifth of a cent.

terminalTry it
curl "https://api.reelsdk.com/v1/ffmpeg?wait=60" \
  -H "Authorization: Bearer $REELSDK_KEY" \
  --json '{
    "inputs": {
      "input.mkv": "https://api.reelsdk.com/f/lib/out/job_os4zamgjs332jnu50w1h/clip.mkv"
    },
    "args": [
      "-i", "input.mkv", "-map", "0", "-c", "copy", "-c:s", "mov_text",
      "-movflags", "+faststart", "output.mp4"
    ],
    "outputs": ["output.mp4"]
  }'
output.mp4 from the API: H.264, AAC and a mov_text subtitle track, about 5.5 MB.Input: clip.mkv

FAQ

Questions, answered

How do I convert MKV to MP4 without re-encoding?

Remux it: ffmpeg -i in.mkv -map 0 -c copy -c:s mov_text out.mp4. The video and audio packets are copied as they are and only the subtitle track is converted. Our 11-second clip took a fraction of a second.

Why are my subtitles missing after converting MKV to MP4?

Plain -c copy without -map left the SubRip track behind and finished without an error. Add -map 0 to take every stream and -c:s mov_text so MP4 can hold the subtitles.

What does codec not currently supported in container mean?

MP4 has no way to store one of the streams you asked ffmpeg to copy. With an MKV it is usually the subtitle track: SubRip and ASS need -c:s mov_text, and image subtitles like PGS can't go into MP4 as mov_text at all.

Does converting MKV to MP4 lose quality?

Not with -c copy: the video and audio are the same bytes in a new container, so the frames are identical. Quality only changes if you re-encode, for example because the player can't decode the original codec.

Can I convert MKV to MP4 with an API?

Yes. Send the same args to POST https://api.reelsdk.com/v1/ffmpeg with the MKV's URL in inputs. It runs ffmpeg 8.1 on a fresh machine per job for $0.02 per compute minute, billed per second, and failed jobs are free.

Ready to build?

Ship video from your app today

Your first $0.50 is free, and one key covers every endpoint.

Moonlit lake with a lit cabin under the mountains