<p>Let me clarify what a stream mapping line such as the one below, indicates.</p>

<pre><code>Stream #0:0 -&gt; #0:0 (h264 (native) -&gt; h264 (libx264))
</code></pre>

<p><code>Stream #0:0</code> indicates that the input stream is from the first file #<strong>0</strong>:0 and is the first stream in that file #0:<strong>0</strong></p>

<p><code>-&gt; #0:0</code> indicates that the input stream is sent to the first stream of the first output file.</p>

<p><code>h264 (native)</code> means that the detected codec of the input stream is H.264 and that ffmpeg will use its native (builtin) decoder to decode the stream.</p>

<p><code>h264 (libx264)</code> means that the codec of the output stream will be H.264 and that ffmpeg will use the <code>libx264</code> encoder to generate this stream.</p>

<p>"h264(constrained)" usually seen in the input file dump e.g.</p>

<pre><code>Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive)...
</code></pre>

<p>indicates that the input stream codec is H.264 and the stream <a href="https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles" rel="nofollow noreferrer">profile</a> is Constrained Baseline. A profile defines the kind of methods that an encoder can use to generate streams and also a set of methods that a decoder is expected to perform, in order to decode the stream.</p>

<p>With your ffmpeg command, libx264 is re-encoding your video stream with CRF 23 and profile High. If the output looks fine to you, there's nothing to do further.</p>

<p>To experiment, you can use</p>

<pre><code>ffmpeg.exe -i [RecordedVideoFileName.mkv] -crf X [OutputVideoFileName.mkv]
</code></pre>

<p>where X can go from 0 to 51. 18 to 28 is a good range for good quality and file size. Lower is better quality and larger size.</p>

CC BY-SA 4.0
2019-08-18T07:58:13.653Z
Thanks for the explanation. I've upvoted your answer but it'll only reflect when I reach 15. I had a clarification to ask, though. Since FFMPEG is using a CRF of 23, does it mean that the output video is somewhat inferior to the original input and that whether my naked eye can find out the difference is another matter? I ask this because the transcoded video didn't seem to be inferior to the input video.
SOuser
CC BY-SA 4.0
2019-08-18T08:23:38.663Z
Yes, modern video lossy codecs make use of [psychophysics](https://en.wikipedia.org/wiki/Psychophysics) - the result is mathematically inexact but acceptable for subjective use.
Gyan
CC BY-SA 4.0
2019-08-18T08:27:18.597Z
Thank you for the explanation once again, Gyan!
SOuser
CC BY-SA 4.0
2019-08-17T20:00:14.190Z
2019-08-18T07:20:10.333Z
2019-08-18T07:20:10.333Z
Gyan
<p>I am recording a video using OBS Studio with the following settings:
<a href="https://i.sstatic.net/gosCi.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gosCi.png" alt="OBS Recording Settings"></a>
<a href="https://i.sstatic.net/XUbaD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XUbaD.png" alt="OBS Video Settings"></a></p>

<p>With these settings, OBS is consuming 55 to 60 MB storage for a minute long recording. Considering that my recordings span across multiple hours, a 2-hour recording ends up consuming as much as 4 GB space.</p>

<p>So I tried to transcode the recorded videos with FFMPEG with this command:</p>

<p><code>ffmpeg.exe -i [RecordedVideoFileName.mkv] [OutputVideoFileName.mkv]</code></p>

<p>The transcoded video consumes just 5-6 MB per minute in comparison to 55-60 MB per minute as consumed by OBS. The logs of the command are <a href="https://pastebin.com/AuM0Fcza" rel="nofollow noreferrer">here</a>.</p>

<p>While going through the logs, the following statements statements caught my eye:</p>

<pre><code>Stream mapping:
  Stream #0:0 -&gt; #0:0 (h264 (native) -&gt; h264 (libx264))
  Stream #0:1 -&gt; #0:1 (aac (native) -&gt; vorbis (libvorbis))
</code></pre>

<p>So I had the following questions:</p>

<ol>
<li>What is the difference between h264(constrained), h264(native) and h264(libx264) encoders?</li>
<li>Does transcoding from one to another (as in my case) result in degraded video/audio quality?</li>
</ol>

<ffmpeg><h.264><obs>
h264 (Constrained Baseline)/(h264 (native) vs h264 (libx264)
SOuser
# h264 (Constrained Baseline)/(h264 (native) vs h264 (libx264)

(Asked by: username_0 on 2019-08-17)

I am recording a video using OBS Studio with the following settings:


With these settings, OBS is consuming 55 to 60 MB storage for a minute long recording. Considering that my recordings span across multiple hours, a 2-hour recording ends up consuming as much as 4 GB space.
So I tried to transcode the recorded videos with FFMPEG with this command:
ffmpeg.exe -i [RecordedVideoFileName.mkv] [OutputVideoFileName.mkv]
The transcoded video consumes just 5-6 MB per minute in comparison to 55-60 MB per minute as consumed by OBS. The logs of the command are here.
While going through the logs, the following statements statements caught my eye:
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> vorbis (libvorbis))

So I had the following questions:

What is the difference between h264(constrained), h264(native) and h264(libx264) encoders?
Does transcoding from one to another (as in my case) result in degraded video/audio quality?

**Tags:** ffmpeg, h.264, obs


---

## 1 answers

### Answer by username_1 on 2019-08-17. Score: 3 | Accepted answer

Let me clarify what a stream mapping line such as the one below, indicates.
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))

Stream #0:0 indicates that the input stream is from the first file #0:0 and is the first stream in that file #0:0
-> #0:0 indicates that the input stream is sent to the first stream of the first output file.
h264 (native) means that the detected codec of the input stream is H.264 and that ffmpeg will use its native (builtin) decoder to decode the stream.
h264 (libx264) means that the codec of the output stream will be H.264 and that ffmpeg will use the libx264 encoder to generate this stream.
"h264(constrained)" usually seen in the input file dump e.g.
Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive)...

indicates that the input stream codec is H.264 and the stream profile is Constrained Baseline. A profile defines the kind of methods that an encoder can use to generate streams and also a set of methods that a decoder is expected to perform, in order to decode the stream.
With your ffmpeg command, libx264 is re-encoding your video stream with CRF 23 and profile High. If the output looks fine to you, there's nothing to do further.
To experiment, you can use
ffmpeg.exe -i [RecordedVideoFileName.mkv] -crf X [OutputVideoFileName.mkv]

where X can go from 0 to 51. 18 to 28 is a good range for good quality and file size. Lower is better quality and larger size.

> **Comments:**
> **username_0**: Thanks for the explanation. I've upvoted your answer but it'll only reflect when I reach 15. I had a clarification to ask, though. Since FFMPEG is using a CRF of 23, does it mean that the output video is somewhat inferior to the original input and that whether my naked eye can find out the difference is another matter? I ask this because the transcoded video didn't seem to be inferior to the input video.  
> **username_1**: Yes, modern video lossy codecs make use of [psychophysics](https://en.wikipedia.org/wiki/Psychophysics) - the result is mathematically inexact but acceptable for subjective use.  
> **username_0**: Thank you for the explanation once again, username_1!  

---

