<p>You can use ffprobe for this</p>

<pre><code>ffprobe file.mkv -show_entries stream=codec_name -select_streams v:0 -of compact=p=0:nk=1 -v 0
</code></pre>

<p>For H.265/HEVC, this will print <code>hevc</code>; for H.264, <code>h264</code> .</p>

CC BY-SA 4.0
2019-05-13T20:51:00.407Z
Works perfectly!  Thank you Gyan!
NetFool
CC BY-SA 4.0
2019-05-13T05:29:53.697Z
2019-05-13T05:29:53.697Z
Gyan
<p>Can anyone suggest a way to tell the difference, from the OSX command line, between .mkv files encoded with H.265 from those encoded with H.264?</p>

<p>Plex H.265 streams viewed from some devices (e.g. LG net-enabled TVs) stall frequently, probably due to the lack of H.265 decoding hardware.</p>

<p>I'd rather not have to re-encode all of the MKVs in my video library, so I'd like to be able to process only the H.265 files.</p>

CC BY-SA 4.0
2019-05-13T02:43:45.020Z
Install mediainfo via homebrew
SlimSCSI
<ffmpeg><streaming><h.264><mkv>
Identify H.265 from the OSX Command Line?
NetFool
# Identify H.265 from the OSX Command Line?

(Asked by: username_0 on 2019-05-12)

Can anyone suggest a way to tell the difference, from the OSX command line, between .mkv files encoded with H.265 from those encoded with H.264?

Plex H.265 streams viewed from some devices (e.g. LG net-enabled TVs) stall frequently, probably due to the lack of H.265 decoding hardware.

I'd rather not have to re-encode all of the MKVs in my video library, so I'd like to be able to process only the H.265 files.

**Tags:** ffmpeg, streaming, h.264, mkv

> **Comments:**
> **username_1**: Install mediainfo via homebrew  

---

## 1 answers

### Answer by username_2 on 2019-05-13. Score: 2 | Accepted answer

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 .

> **Comments:**
> **username_0**: Works perfectly!  Thank you username_2!  

---

