1

I have a video in MKV format that I wanted to convert to MP4, so I used ffmpeg to convert it. The command I used was pretty simple:

ffmpeg -i <path_and_name_of_file>.mkv <path_and_name_of_file>.mp4

I don't really know how to use ffmpeg and since this is probably the only time I plan to use it I looked up how to do it online and it said I can just use that simple command if all I'm doing is changing the file format.

So I did that, and it did the process like normal (it took about 10 hours because it's a 1080p 3+ hours video) but when I tried playing the file it didn't work. I tried Movies & TV and Windows Media Player and they both open the file and show how long it is, but when I hit play nothing happens, not even an error message. But it did play when opening it with VLC Media Player or Chrome.

The problem is, both Movies & TV and WMP play the original MKV file just fine, so I must have done something wrong with FFmpeg. Is it that I have to add more stuff to the command or something?


Update: Sorry it took me so long to come back to this. I'm guessing this bit is what grawity was asking for. The original MKV video:

Input #0, matroska,webm, from '<original_video_path>.mkv':
  Metadata:
    encoder         : libebml v1.4.5 + libmatroska v1.7.1
  Duration: 03:30:24.32, start: 0.000000, bitrate: 8122 kb/s
  Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn (default)
  Stream #0:1(eng): Audio: eac3 (Dolby Digital Plus + Dolby Atmos), 48000 Hz, 5.1(side), fltp, 768 kb/s (default)
  Stream #0:2(eng): Subtitle: subrip

The converted MP4 video:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '<converted_video_path>.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.16.100
  Duration: 03:30:24.32, start: 0.000000, bitrate: 4843 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 4441 kb/s, 24 fps, 24 tbr, 12288 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.31.102 libx264
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 6 channels, fltp, 394 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Giacomo1968
  • 58,727

1 Answers1

0

You need to re-encode, at least to get the bitrate back up.

ffmpeg -i file.mkv -c:v h264 -c:a copy -b:v 8000k -preset ultrafast out.mp4 

Using -c:v h264 will increase play ability. -c:a copy will keep your original 5.1 channel audio track.


@DanielB raises a good point with -c copy, which I overlooked due to his other point, "You should never use it without specifying video and audio handling parameters." Facts.

Also, using yuv420p is correct. It should make x264 play without issue, but requires re-encoding.

Giacomo1968
  • 58,727