diff --git a/DESCRIPTION.rst b/DESCRIPTION.rst
index d1b41af..2649378 100644
--- a/DESCRIPTION.rst
+++ b/DESCRIPTION.rst
@@ -1,4 +1,4 @@
 ffconv
-=======================
+======
 
 Process media files to match profiles using ffmpeg.
\ No newline at end of file
diff --git a/ffconv/stream_processors.py b/ffconv/stream_processors.py
index e81feac..145207b 100644
--- a/ffconv/stream_processors.py
+++ b/ffconv/stream_processors.py
@@ -108,9 +108,19 @@ class VideoProcessor(StreamProcessor):
         # Set input reference frames value
         self.refs = int(stream['refs'])
 
-        # Set target values for frames, profile, level, preset and quality
-        height = int(stream.get('height', 720))
-        self.max_refs = profile[self.media_type]['max_refs'].get(height, 5)
+        # Assert height is included in stream
+        if 'height' not in stream:
+            raise KeyError("Height not specified in video stream.")
+
+        # Get height and set target for ref frames (default is 4)
+        self.max_refs = 4
+        height = int(stream['height'])
+        for h, f in sorted(profile[self.media_type]['max_refs'].items()):
+            if height <= h:
+                self.max_refs = f
+                break
+
+        # Set target values for profile, level, preset and quality
         self.target_profile = profile[self.media_type]['profile']
         self.target_level = profile[self.media_type]['level']
         self.target_preset = profile[self.media_type]['preset']
diff --git a/setup.py b/setup.py
index 20c088d..e4ec3cc 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ setup(
     name='ffconv',
 
     # https://packaging.python.org/en/latest/single_source_version.html
-    version='0.0.3',
+    version='0.1.0',
 
     description='Process media files with ffmpeg',
     long_description=long_description,

Height-to-Reference Frames matching error
Sometimes the video height does not match the standard values perfectly (720, 1080, etc), and in those cases the stream processor is deciding incorrectly: a video stream with a height if 704 is trying to limit the frames to 4, when it should do it at 8.

When deciding ref frames maximum, we should *compare heights* instead of matching them exactly.
diff --git a/tests/test_files.py b/tests/test_files.py
index e332188..e4f8612 100644
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -108,7 +108,7 @@ class FileProcessorTest(TestCase):
         self.assertEqual(res, [])
 
         # Process 1 video only
-        streams = [{'codec_type': 'video', 'codec_name': 'h264', 'index': 0, 'refs': 1}]
+        streams = [{'codec_type': 'video', 'codec_name': 'h264', 'index': 0, 'refs': 1, 'height': 720}]
         res = processor.process_streams(streams)
         self.assertEqual(len(res), 1)
         self.assertEqual(VideoProcessor.process.call_count, 1)
@@ -117,7 +117,7 @@ class FileProcessorTest(TestCase):
         VideoProcessor.process.reset_mock()
 
         # Process 1 video, 2 audio, 2 subs
-        streams = [{'codec_type': 'video', 'codec_name': 'h264', 'index': 0, 'refs': 4},
+        streams = [{'codec_type': 'video', 'codec_name': 'h264', 'index': 0, 'refs': 4, 'height': 720},
                    {'codec_type': 'audio', 'codec_name': 'aac', 'index': 0, 'channels': 2},
                    {'codec_type': 'audio', 'codec_name': 'aac', 'index': 0, 'channels': 6},
                    {'codec_type': 'subtitle', 'codec_name': 'srt', 'index': 0},
@@ -143,7 +143,7 @@ class FileProcessorTest(TestCase):
         self.assertEqual(res, [])
 
         # Process 1 video, 2 audio, 2 subs
-        streams = [{'codec_type': 'video', 'codec_name': 'h264', 'index': 0, 'refs': 4},
+        streams = [{'codec_type': 'video', 'codec_name': 'h264', 'index': 0, 'refs': 4, 'height': 480},
                    {'codec_type': 'audio', 'codec_name': 'aac', 'index': 0, 'channels': 2},
                    {'codec_type': 'audio', 'codec_name': 'aac', 'index': 0, 'channels': 6},
                    {'codec_type': 'subtitle', 'codec_name': 'srt', 'index': 0},
@@ -220,7 +220,7 @@ class FileProcessorTest(TestCase):
     @patch('ffconv.stream_processors.execute_cmd', MagicMock())
     @patch('ffconv.file_processor.execute_cmd', MagicMock())
     @patch('ffconv.file_processor.FileProcessor.probe', MagicMock(return_value=[
-        {'index': 0, 'codec_type': 'video', 'codec_name': 'h264', 'refs': 4},
+        {'index': 0, 'codec_type': 'video', 'codec_name': 'h264', 'refs': 4, 'height': 720},
         {'index': 1, 'codec_type': 'audio', 'codec_name': 'aac', 'channels': 6, 'tags': {'LANGUAGE': 'eng'}},
         {'index': 2, 'codec_type': 'subtitle', 'codec_name': 'ass', 'tags': {'LANGUAGE': 'spa'}},
         {'index': 3, 'codec_type': 'subtitle', 'codec_name': 'srt', 'tags': {'LANGUAGE': 'por'}},
diff --git a/tests/test_streams.py b/tests/test_streams.py
index a24c1bb..04584d8 100644
--- a/tests/test_streams.py
+++ b/tests/test_streams.py
@@ -64,6 +64,26 @@ class VideoProcessorTest(TestCase):
         processor.convert.reset_mock()
         processor.clean_up.reset_mock()
 
+        # Attempt to process 704:8, nothing to do
+        stream = {'index': 7, 'codec_type': 'video', 'codec_name': 'h264',
+                  'refs': 8, 'height': 704}
+        processor = VideoProcessor(input, stream, profile)
+        res = processor.process()
+        self.assertEqual(res, {'input': 'some-film.mkv', 'index': 7})
+        self.assertFalse(processor.convert.called)
+        self.assertFalse(processor.clean_up.called)
+
+        # Attempt process for 2160:8 refs, needs to convert (default ref is 4)
+        stream = {'index': 7, 'codec_type': 'video', 'codec_name': 'h264',
+                  'refs': 8, 'height': 2160}
+        processor = VideoProcessor(input, stream, profile)
+        res = processor.process()
+        self.assertEqual(res, {'input': 'video-7.mp4', 'index': 0})
+        self.assertTrue(processor.convert.called)
+        self.assertTrue(processor.clean_up.called)
+        processor.convert.reset_mock()
+        processor.clean_up.reset_mock()
+
         # Attempt to process xvid, turn to h264
         stream = {'index': 7, 'codec_type': 'video', 'codec_name': 'xvid',
                   'refs': 1, 'height': 720}

pip install -e .
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
astroid==3.3.9
coverage==7.8.0
dill==0.3.9
exceptiongroup==1.2.2
-e git+https://github.com/kako-nawao/ffconv.git@b93056b5cb13eb62cbc8c3aa0e21c45e908d153f#egg=ffconv
iniconfig==2.1.0
isort==6.0.1
mccabe==0.7.0
nose2==0.15.1
packaging==24.2
platformdirs==4.3.7
pluggy==1.5.0
pylint==3.3.6
pytest==8.3.5
tomli==2.2.1
tomlkit==0.13.2
typing_extensions==4.13.0

name: ffconv
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - astroid==3.3.9
      - coverage==7.8.0
      - dill==0.3.9
      - exceptiongroup==1.2.2
      - iniconfig==2.1.0
      - isort==6.0.1
      - mccabe==0.7.0
      - nose2==0.15.1
      - packaging==24.2
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pylint==3.3.6
      - pytest==8.3.5
      - tomli==2.2.1
      - tomlkit==0.13.2
      - typing-extensions==4.13.0
prefix: /opt/conda/envs/ffconv

tests/test_streams.py::VideoProcessorTest::test_process
tests/test_files.py::ExecuteCommandTest::test_errors tests/test_files.py::FileProcessorTest::test_clean_up tests/test_files.py::FileProcessorTest::test_init tests/test_files.py::FileProcessorTest::test_merge tests/test_files.py::FileProcessorTest::test_probe tests/test_files.py::FileProcessorTest::test_process tests/test_files.py::FileProcessorTest::test_process_streams_error tests/test_files.py::FileProcessorTest::test_process_streams_success tests/test_files.py::FileProcessorTest::test_replace_original tests/test_streams.py::VideoProcessorTest::test_convert tests/test_streams.py::VideoProcessorTest::test_init tests/test_streams.py::AudioProcessorTest::test_convert tests/test_streams.py::AudioProcessorTest::test_init tests/test_streams.py::AudioProcessorTest::test_process tests/test_streams.py::SubtitleProcessorTest::test_clean_up tests/test_streams.py::SubtitleProcessorTest::test_convert tests/test_streams.py::SubtitleProcessorTest::test_init tests/test_streams.py::SubtitleProcessorTest::test_process
setup.py ffconv/stream_processors.py DESCRIPTION.rst
setup.py ffconv/stream_processors.py DESCRIPTION.rst