Skip to content

feat: add video encoder support#29

Open
manato wants to merge 17 commits intomainfrom
feat/video_encoder
Open

feat: add video encoder support#29
manato wants to merge 17 commits intomainfrom
feat/video_encoder

Conversation

@manato
Copy link
Collaborator

@manato manato commented Feb 12, 2026

PR Type

  • New Feature

Related Links

Description

This pull request introduces the video encoder support running on the Jetson Orin platform.
Due to the hardware support constraint, the supported codecs are limited to H.264, H.265, and AV1.

The key changes are:

  • add JetsonH264Compressor, JetsonH265Compressor, and JetsonAV1Compressor in the accelerated_image_processor_compression package. [1], [2], [3]. The overall relationship between those classes is as follows:
Previous version (click to expand)
     classDiagram
         class BaseProcessor
         class VideoCompressor
         class JetsonVideoCompressor
         namespace Dedicated_Encoders {
           class JetsonH264Compressor
           class JetsonH265Compressor
           class JetsonAV1Compressor
         }

         BaseProcessor : +process(image)
         BaseProcessor : +is_ready()
         VideoCompressor : +backend()
         JetsonVideoCompressor : +collect_codec_params_impl()
         JetsonVideoCompressor : +set_capture_plane_format_impl()
         JetsonVideoCompressor : +init_codec_impl()
         JetsonVideoCompressor : +payload_preprocess_impl()
         JetsonVideoCompressor : +payload_copy_impl()

         BaseProcessor <|-- VideoCompressor
         VideoCompressor <|-- JetsonVideoCompressor
         JetsonVideoCompressor <|-- JetsonH264Compressor
         JetsonVideoCompressor <|-- JetsonH265Compressor
         JetsonVideoCompressor <|-- JetsonAV1Compressor

         note for JetsonVideoCompressor "Each Jetson[*]Compressor implements its own *_impl methods"

Loading
 classDiagram
    class BaseProcessor
    class Compressor
    class VideoCompressor
    class JetsonVideoCompressor
    namespace Dedicated_Encoders {
      class JetsonH264Compressor
      class JetsonH265Compressor
      class JetsonAV1Compressor
    }

    BaseProcessor : +process(image)
    BaseProcessor : +is_ready()
    Compressor: +backend()
    JetsonVideoCompressor : +collect_codec_params_impl()
    JetsonVideoCompressor : +set_capture_plane_format_impl()
    JetsonVideoCompressor : +init_codec_impl()
    JetsonVideoCompressor : +payload_preprocess_impl()
    JetsonVideoCompressor : +payload_copy_impl()

    BaseProcessor <|-- Compressor
    Compressor <|-- JPEGCompressor
    Compressor <|-- VideoCompressor
    VideoCompressor <|-- JetsonVideoCompressor
    JetsonVideoCompressor <|-- JetsonH264Compressor
    JetsonVideoCompressor <|-- JetsonH265Compressor
    JetsonVideoCompressor <|-- JetsonAV1Compressor
Loading
  • Expand the ROS node so that it can be configured to publish video encoded data as well in the same manner as the current JPEG compression [1], [2]

Review Procedure

  • Build package

    colcon build --cmake-clean-cache --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_EXPORT_COMPILE_COMMANDS=ON  --packages-up-to accelerated_image_processor_ros
    
    source . ./install/setup.bash
  • Configure the accelerated_image_processor_ros/config/imgproc.param.yaml to use video compression. For example, the configuration for publishing AV1 looks like:

    /**:
      ros__parameters:
        max_task_length: 5
        compressor:
          type: av1
          target_bits_per_pixel: 0.1
          av1:
            enable_tile: true
            log2_num_tile_row: 2
            log2_num_tile_col: 2
            enable_ssim_rdo: true
            enable_cdf_update: true
        rectifier:
          do_rectify: false
          alpha: 0.0
  • Launch the node

    ros2 launch accelerated_image_processor_ros imgproc.launch.xml
  • [optional] Encoded data can be briefly decoded by

    ros2 run image_transport republish ffmpeg raw --ros-args \ 
      -r /in/ffmpeg:=/image_raw/compressed \
      -r out:=/image_raw/decompressed \
      -r __node:=dec
    • The decoding result may have a large delay. Besides, errors like [Decoder]: cannot find pts that matches -1 might be shown. This is possibly due to inappropriate pts field handling, which lacks taking into account in the implementation at this moment.

The followings are the results of colcon test for accelerated_image_processor_compression and accelerated_image_processor_ros, respectively.

colcon test for `accelerated_image_processor_ros`
$ colcon test --event-handlers console_cohesion+ --packages-select accelerated_image_processor_ros
Starting >>> accelerated_image_processor_ros
--- output: accelerated_image_processor_ros
UpdateCTestConfiguration  from :/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/CTestConfiguration.ini
Parse Config file:/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/CTestConfiguration.ini
   Site: tegra-ubuntu
   Build name: (empty)
 Add coverage exclude regular expressions.
Create new tag: 20260217-0935 - Experimental
UpdateCTestConfiguration  from :/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/CTestConfiguration.ini
Parse Config file:/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/CTestConfiguration.ini
Test project /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
    Start 1: conversion.cpp_accelerated_image_processor_ros

1: Test command: /usr/bin/python3 "-u" "/opt/ros/humble/install/share/ament_cmake_test/cmake/run_test.py" "/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/conversion.cpp_accelerated_image_processor_ros.gtest.xml" "--package-name" "accelerated_image_processor_ros" "--output-file" "/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/ament_cmake_gtest/conversion.cpp_accelerated_image_processor_ros.txt" "--command" "/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/conversion.cpp_accelerated_image_processor_ros" "--gtest_output=xml:/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/conversion.cpp_accelerated_image_processor_ros.gtest.xml"
1: Working Directory: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros
1: Test timeout computed to be: 60
1: -- run_test.py: invoking following command in '/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros':
1:  - /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/conversion.cpp_accelerated_image_processor_ros --gtest_output=xml:/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/conversion.cpp_accelerated_image_processor_ros.gtest.xml
1: libEGL warning: DRI3: failed to query the version
1: libEGL warning: DRI2: failed to authenticate
1: [==========] Running 31 tests from 16 test suites.
1: [----------] Global test environment set-up.
1: [----------] 3 tests from TestConversionFromRosTime
1: [ RUN      ] TestConversionFromRosTime.Zero
1: [       OK ] TestConversionFromRosTime.Zero (0 ms)
1: [ RUN      ] TestConversionFromRosTime.NonZero
1: [       OK ] TestConversionFromRosTime.NonZero (0 ms)
1: [ RUN      ] TestConversionFromRosTime.BidirectionalConversionIsConsistent
1: [       OK ] TestConversionFromRosTime.BidirectionalConversionIsConsistent (0 ms)
1: [----------] 3 tests from TestConversionFromRosTime (0 ms total)
1:
1: [----------] 3 tests from TestConversionFromRosEncoding
1: [ RUN      ] TestConversionFromRosEncoding.RGB8toRGB
1: [       OK ] TestConversionFromRosEncoding.RGB8toRGB (0 ms)
1: [ RUN      ] TestConversionFromRosEncoding.BGR8toBGR
1: [       OK ] TestConversionFromRosEncoding.BGR8toBGR (0 ms)
1: [ RUN      ] TestConversionFromRosEncoding.UnsupportedThrowsRuntimeError
1: [       OK ] TestConversionFromRosEncoding.UnsupportedThrowsRuntimeError (0 ms)
1: [----------] 3 tests from TestConversionFromRosEncoding (0 ms total)
1:
1: [----------] 2 tests from TestConversionFromRosImage
1: [ RUN      ] TestConversionFromRosImage.CopyFields
1: [       OK ] TestConversionFromRosImage.CopyFields (0 ms)
1: [ RUN      ] TestConversionFromRosImage.UnsupportedEncodingThrowsRuntimeError
1: [       OK ] TestConversionFromRosImage.UnsupportedEncodingThrowsRuntimeError (0 ms)
1: [----------] 2 tests from TestConversionFromRosImage (0 ms total)
1:
1: [----------] 1 test from TestConversionFromRosCameraInfo
1: [ RUN      ] TestConversionFromRosCameraInfo.CopyFields
1: [       OK ] TestConversionFromRosCameraInfo.CopyFields (0 ms)
1: [----------] 1 test from TestConversionFromRosCameraInfo (0 ms total)
1:
1: [----------] 4 tests from TestConversionFromRosDistortionModel
1: [ RUN      ] TestConversionFromRosDistortionModel.PlumbBob
1: [       OK ] TestConversionFromRosDistortionModel.PlumbBob (0 ms)
1: [ RUN      ] TestConversionFromRosDistortionModel.Equidistant
1: [       OK ] TestConversionFromRosDistortionModel.Equidistant (0 ms)
1: [ RUN      ] TestConversionFromRosDistortionModel.RationalPolynomial
1: [       OK ] TestConversionFromRosDistortionModel.RationalPolynomial (0 ms)
1: [ RUN      ] TestConversionFromRosDistortionModel.UnsupportedThrowsRuntimeError
1: [       OK ] TestConversionFromRosDistortionModel.UnsupportedThrowsRuntimeError (0 ms)
1: [----------] 4 tests from TestConversionFromRosDistortionModel (0 ms total)
1:
1: [----------] 1 test from TestConversionFromRosRoi
1: [ RUN      ] TestConversionFromRosRoi.CopyFields
1: [       OK ] TestConversionFromRosRoi.CopyFields (0 ms)
1: [----------] 1 test from TestConversionFromRosRoi (0 ms total)
1:
1: [----------] 3 tests from TestConversionToRosTime
1: [ RUN      ] TestConversionToRosTime.Zero
1: [       OK ] TestConversionToRosTime.Zero (0 ms)
1: [ RUN      ] TestConversionToRosTime.NonZero
1: [       OK ] TestConversionToRosTime.NonZero (0 ms)
1: [ RUN      ] TestConversionToRosTime.BidirectionalConversionIsConsistent
1: [       OK ] TestConversionToRosTime.BidirectionalConversionIsConsistent (0 ms)
1: [----------] 3 tests from TestConversionToRosTime (0 ms total)
1:
1: [----------] 1 test from TestConversionToRosRaw
1: [ RUN      ] TestConversionToRosRaw.CopyFields
1: [       OK ] TestConversionToRosRaw.CopyFields (0 ms)
1: [----------] 1 test from TestConversionToRosRaw (0 ms total)
1:
1: [----------] 2 tests from TestConversionToRosEncoding
1: [ RUN      ] TestConversionToRosEncoding.RGBtoRGB8
1: [       OK ] TestConversionToRosEncoding.RGBtoRGB8 (0 ms)
1: [ RUN      ] TestConversionToRosEncoding.BGRtoBGR8
1: [       OK ] TestConversionToRosEncoding.BGRtoBGR8 (0 ms)
1: [----------] 2 tests from TestConversionToRosEncoding (0 ms total)
1:
1: [----------] 1 test from TestConversionToRosCompressed
1: [ RUN      ] TestConversionToRosCompressed.CopyFields
1: [       OK ] TestConversionToRosCompressed.CopyFields (0 ms)
1: [----------] 1 test from TestConversionToRosCompressed (0 ms total)
1:
1: [----------] 3 tests from TestConversionToRosFormat
1: [ RUN      ] TestConversionToRosFormat.RawThrowsInvalidArgument
1: [       OK ] TestConversionToRosFormat.RawThrowsInvalidArgument (0 ms)
1: [ RUN      ] TestConversionToRosFormat.Jpeg
1: [       OK ] TestConversionToRosFormat.Jpeg (0 ms)
1: [ RUN      ] TestConversionToRosFormat.Png
1: [       OK ] TestConversionToRosFormat.Png (0 ms)
1: [----------] 3 tests from TestConversionToRosFormat (0 ms total)
1:
1: [----------] 1 test from TestConversionToRosFFmpeg
1: [ RUN      ] TestConversionToRosFFmpeg.CopyFieldsAndVideo
1: [       OK ] TestConversionToRosFFmpeg.CopyFieldsAndVideo (0 ms)
1: [----------] 1 test from TestConversionToRosFFmpeg (0 ms total)
1:
1: [----------] 1 test from TestConversionToRosFFmpegEncoding
1: [ RUN      ] TestConversionToRosFFmpegEncoding.ValidEncodings
1: [       OK ] TestConversionToRosFFmpegEncoding.ValidEncodings (0 ms)
1: [----------] 1 test from TestConversionToRosFFmpegEncoding (0 ms total)
1:
1: [----------] 1 test from TestConversionToRosInfo
1: [ RUN      ] TestConversionToRosInfo.CopyFields
1: [       OK ] TestConversionToRosInfo.CopyFields (0 ms)
1: [----------] 1 test from TestConversionToRosInfo (0 ms total)
1:
1: [----------] 3 tests from TestConversionToRosDistortionModel
1: [ RUN      ] TestConversionToRosDistortionModel.PlumbBob
1: [       OK ] TestConversionToRosDistortionModel.PlumbBob (0 ms)
1: [ RUN      ] TestConversionToRosDistortionModel.Equidistant
1: [       OK ] TestConversionToRosDistortionModel.Equidistant (0 ms)
1: [ RUN      ] TestConversionToRosDistortionModel.RationalPolynomial
1: [       OK ] TestConversionToRosDistortionModel.RationalPolynomial (0 ms)
1: [----------] 3 tests from TestConversionToRosDistortionModel (0 ms total)
1:
1: [----------] 1 test from TestConversionToRosRoi
1: [ RUN      ] TestConversionToRosRoi.CopyFields
1: [       OK ] TestConversionToRosRoi.CopyFields (0 ms)
1: [----------] 1 test from TestConversionToRosRoi (0 ms total)
1:
1: [----------] Global test environment tear-down
1: [==========] 31 tests from 16 test suites ran. (0 ms total)
1: [  PASSED  ] 31 tests.
1: -- run_test.py: return code 0
1: -- run_test.py: inject classname prefix into gtest result file '/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/conversion.cpp_accelerated_image_processor_ros.gtest.xml'
1: -- run_test.py: verify result file '/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/conversion.cpp_accelerated_image_processor_ros.gtest.xml'
1/3 Test #1: conversion.cpp_accelerated_image_processor_ros ...   Passed    0.22 sec
test 2
    Start 2: parameter.cpp_accelerated_image_processor_ros

2: Test command: /usr/bin/python3 "-u" "/opt/ros/humble/install/share/ament_cmake_test/cmake/run_test.py" "/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/parameter.cpp_accelerated_image_processor_ros.gtest.xml" "--package-name" "accelerated_image_processor_ros" "--output-file" "/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/ament_cmake_gtest/parameter.cpp_accelerated_image_processor_ros.txt" "--command" "/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/parameter.cpp_accelerated_image_processor_ros" "--gtest_output=xml:/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/parameter.cpp_accelerated_image_processor_ros.gtest.xml"
2: Working Directory: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros
2: Test timeout computed to be: 60
2: -- run_test.py: invoking following command in '/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros':
2:  - /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/parameter.cpp_accelerated_image_processor_ros --gtest_output=xml:/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/parameter.cpp_accelerated_image_processor_ros.gtest.xml
2: libEGL warning: DRI3: failed to query the version
2: libEGL warning: DRI2: failed to authenticate
2: [==========] Running 4 tests from 2 test suites.
2: [----------] Global test environment set-up.
2: [----------] 2 tests from TestParameterFetchParametersWithoutPrefix
2: [ RUN      ] TestParameterFetchParametersWithoutPrefix.NoOverridesUsesDefaults
2: [       OK ] TestParameterFetchParametersWithoutPrefix.NoOverridesUsesDefaults (12 ms)
2: [ RUN      ] TestParameterFetchParametersWithoutPrefix.AppliesOverrides
2: [       OK ] TestParameterFetchParametersWithoutPrefix.AppliesOverrides (7 ms)
2: [----------] 2 tests from TestParameterFetchParametersWithoutPrefix (19 ms total)
2:
2: [----------] 2 tests from TestParameterFetchParametersWithPrefix
2: [ RUN      ] TestParameterFetchParametersWithPrefix.AppliesOverridesAndSuccessesToFetchWithCorrectPrefix
2: [       OK ] TestParameterFetchParametersWithPrefix.AppliesOverridesAndSuccessesToFetchWithCorrectPrefix (6 ms)
2: [ RUN      ] TestParameterFetchParametersWithPrefix.AppliesOverridesButFailsToFetchWithWrongPrefix
2: [       OK ] TestParameterFetchParametersWithPrefix.AppliesOverridesButFailsToFetchWithWrongPrefix (7 ms)
2: [----------] 2 tests from TestParameterFetchParametersWithPrefix (13 ms total)
2:
2: [----------] Global test environment tear-down
2: [==========] 4 tests from 2 test suites ran. (32 ms total)
2: [  PASSED  ] 4 tests.
2: -- run_test.py: return code 0
2: -- run_test.py: inject classname prefix into gtest result file '/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/parameter.cpp_accelerated_image_processor_ros.gtest.xml'
2: -- run_test.py: verify result file '/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/parameter.cpp_accelerated_image_processor_ros.gtest.xml'
2/3 Test #2: parameter.cpp_accelerated_image_processor_ros ....   Passed    0.25 sec
test 3
    Start 3: qos.cpp_accelerated_image_processor_ros

3: Test command: /usr/bin/python3 "-u" "/opt/ros/humble/install/share/ament_cmake_test/cmake/run_test.py" "/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/qos.cpp_accelerated_image_processor_ros.gtest.xml" "--package-name" "accelerated_image_processor_ros" "--output-file" "/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/ament_cmake_gtest/qos.cpp_accelerated_image_processor_ros.txt" "--command" "/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/qos.cpp_accelerated_image_processor_ros" "--gtest_output=xml:/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/qos.cpp_accelerated_image_processor_ros.gtest.xml"
3: Working Directory: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros
3: Test timeout computed to be: 60
3: -- run_test.py: invoking following command in '/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros':
3:  - /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/qos.cpp_accelerated_image_processor_ros --gtest_output=xml:/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/qos.cpp_accelerated_image_processor_ros.gtest.xml
3: libEGL warning: DRI3: failed to query the version
3: libEGL warning: DRI2: failed to authenticate
3: [==========] Running 4 tests from 1 test suite.
3: [----------] Global test environment set-up.
3: [----------] 4 tests from TestQoSFindQos
3: [ RUN      ] TestQoSFindQos.ReturnsNulloptWhenNoPublishers
3: [INFO] [1771320925.535551040] [aip_qos_unit_no_publishers]: Waiting for topic: /aip_qos_unit/no_publishers ...
3: [       OK ] TestQoSFindQos.ReturnsNulloptWhenNoPublishers (13 ms)
3: [ RUN      ] TestQoSFindQos.ReturnsNulloptWhenMultiplePublishers
3: [       OK ] TestQoSFindQos.ReturnsNulloptWhenMultiplePublishers (209 ms)
3: [ RUN      ] TestQoSFindQos.SucceedsWithSinglePublisherAndReturnsProfile
3: [INFO] [1771320926.266481600] [aip_qos_it_query]: QoS is acquired for topic: /aip_qos_it/single_publisher
3: [       OK ] TestQoSFindQos.SucceedsWithSinglePublisherAndReturnsProfile (522 ms)
3: [ RUN      ] TestQoSFindQos.FailsWhenTwoDifferentNodesPublishSameTopic
3: [ERROR] [1771320927.078271232] [aip_qos_it_query2]: Multiple publishers found for topic: /aip_qos_it/two_publishers. Cannot determine proper QoS
3: [       OK ] TestQoSFindQos.FailsWhenTwoDifferentNodesPublishSameTopic (810 ms)
3: [----------] 4 tests from TestQoSFindQos (1555 ms total)
3:
3: [----------] Global test environment tear-down
3: [==========] 4 tests from 1 test suite ran. (1555 ms total)
3: [  PASSED  ] 4 tests.
3: -- run_test.py: return code 0
3: -- run_test.py: inject classname prefix into gtest result file '/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/qos.cpp_accelerated_image_processor_ros.gtest.xml'
3: -- run_test.py: verify result file '/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_ros/test_results/accelerated_image_processor_ros/qos.cpp_accelerated_image_processor_ros.gtest.xml'
3/3 Test #3: qos.cpp_accelerated_image_processor_ros ..........   Passed    1.77 sec

100% tests passed, 0 tests failed out of 3

Label Time Summary:
gtest    =   2.23 sec*proc (3 tests)

Total Test time (real) =   2.24 sec
---
Finished <<< accelerated_image_processor_ros [2.44s]

summary: 1 package finished [2.97s]
colcon test result for `accelerated_image_processor_compression` (partially clipped because the full log is too long)
# Add `--executor sequential --ctest-args -j16` to accelerate test process
$ colcon test --executor sequential --ctest-args -j16 --event-handlers console_cohesion+ --packages-select accelerated_image_processor_compression
Starting >>> accelerated_image_processor_compression
--- output: accelerated_image_processor_compression
UpdateCTestConfiguration  from :/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression/CTestConfiguration.ini
Parse Config file:/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression/CTestConfiguration.ini
   Site: tegra-ubuntu
   Build name: (empty)
 Add coverage exclude regular expressions.
Create new tag: 20260217-0935 - Experimental
UpdateCTestConfiguration  from :/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression/CTestConfiguration.ini
Parse Config file:/home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression/CTestConfiguration.ini
Test project /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
        Start   1: TestH264Compressor.JetsonVideoCompressorH264Default

1: Test command: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression/jetson_video_compressor_h264.cpp_accelerated_image_processor_compression "--gtest_filter=TestH264Compressor.JetsonVideoCompressorH264Default" "--gtest_also_run_disabled_tests"
1: Working Directory: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression
1: Test timeout computed to be: 10000000
test 2
        Start   2: JetsonVideoCompressorH264Combo/TestH264Compressor.JetsonVideoCompressorH264ProfileLevelTypeCombo/("BASELINE", "1_0", "lossy")

2: Test command: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression/jetson_video_compressor_h264.cpp_accelerated_image_processor_compression "--gtest_filter=JetsonVideoCompressorH264Combo/TestH264Compressor.JetsonVideoCompressorH264ProfileLevelTypeCombo/0" "--gtest_also_run_disabled_tests"
2: Working Directory: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression
2: Test timeout computed to be: 10000000
test 3
        Start   3: JetsonVideoCompressorH264Combo/TestH264Compressor.JetsonVideoCompressorH264ProfileLevelTypeCombo/("BASELINE", "1_0", "lossless")

3: Test command: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression/jetson_video_compressor_h264.cpp_accelerated_image_processor_compression "--gtest_filter=JetsonVideoCompressorH264Combo/TestH264Compressor.JetsonVideoCompressorH264ProfileLevelTypeCombo/1" "--gtest_also_run_disabled_tests"
3: Working Directory: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression
3: Test timeout computed to be: 10000000
test 4
        Start   4: JetsonVideoCompressorH264Combo/TestH264Compressor.JetsonVideoCompressorH264ProfileLevelTypeCombo/("BASELINE", "1B", "lossy")

4: Test command: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression/jetson_video_compressor_h264.cpp_accelerated_image_processor_compression "--gtest_filter=JetsonVideoCompressorH264Combo/TestH264Compressor.JetsonVideoCompressorH264ProfileLevelTypeCombo/2" "--gtest_also_run_disabled_tests"
4: Working Directory: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression
4: Test timeout computed to be: 10000000
test 5
        Start   5: JetsonVideoCompressorH264Combo/TestH264Compressor.JetsonVideoCompressorH264ProfileLevelTypeCombo/("BASELINE", "1B", "lossless")

5: Test command: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression/jetson_video_compressor_h264.cpp_accelerated_image_processor_compression "--gtest_filter=JetsonVideoCompressorH264Combo/TestH264Compressor.JetsonVideoCompressorH264ProfileLevelTypeCombo/3" "--gtest_also_run_disabled_tests"
5: Working Directory: /home/nvidia/test/sandbox/accelerated_image_processor/build/accelerated_image_processor_compression
5: Test timeout computed to be: 10000000
test 6
        Start   6: JetsonVideoCompressorH264Combo/TestH264Compressor.JetsonVideoCompressorH264ProfileLevelTypeCombo/("BASELINE", "1_1", "lossy")


# (... super long log here)

242:
242: [----------] Global test environment tear-down
242: [==========] 1 test from 1 test suite ran. (1834 ms total)
242: [  PASSED  ] 1 test.
244/247 Test #240: JetsonVideoCompressorAV1ComboWithoutTiling/TestAV1Compressor.JetsonVideoCompressorAV1ProfileLevelTypeCombo/(false, 0, 0, true, false, "lossy") .......   Passed    2.08 sec
245/247 Test #241: JetsonVideoCompressorAV1ComboWithoutTiling/TestAV1Compressor.JetsonVideoCompressorAV1ProfileLevelTypeCombo/(false, 0, 0, true, false, "lossless") ....   Passed    2.10 sec
246/247 Test #242: JetsonVideoCompressorAV1ComboWithoutTiling/TestAV1Compressor.JetsonVideoCompressorAV1ProfileLevelTypeCombo/(false, 0, 0, true, true, "lossy") ........   Passed    2.05 sec
243: Opening in BLOCKING MODE
243: [ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvV4l2ElementPlane.cpp:932) <encoder> Capture Plane:Timed out waiting for dqthread
243: [       OK ] JetsonVideoCompressorAV1ComboWithoutTiling/TestAV1Compressor.JetsonVideoCompressorAV1ProfileLevelTypeCombo/7 (1692 ms)
243: [----------] 1 test from JetsonVideoCompressorAV1ComboWithoutTiling/TestAV1Compressor (1692 ms total)
243:
243: [----------] Global test environment tear-down
243: [==========] 1 test from 1 test suite ran. (1692 ms total)
243: [  PASSED  ] 1 test.
247/247 Test #243: JetsonVideoCompressorAV1ComboWithoutTiling/TestAV1Compressor.JetsonVideoCompressorAV1ProfileLevelTypeCombo/(false, 0, 0, true, true, "lossless") .....   Passed    1.90 sec

100% tests passed, 0 tests failed out of 247

Label Time Summary:
gtest    =   2.19 sec*proc (4 tests)

Total Test time (real) =  37.78 sec
---
Finished <<< accelerated_image_processor_compression [38.1s]

Summary: 1 package finished [38.5s]

Remarks

I decided to use ffmpeg_image_transport_msgs::msg::FFMPEGPacket instead of sensor_msgs::msg::CompressedImage for the video encoded data because sensor_msgs::msg::CompressedImage is hard to express some information, such as the flag to show whether this is a key frame or not, which is mandatory for decoding.

Pre-Review Checklist for the PR Author

PR Author should check the checkboxes below when creating the PR.

  • Assign PR to reviewer

Checklist for the PR Reviewer

Reviewers should check the checkboxes below before approval.

  • Commits are properly organized and messages are according to the guideline
  • (Optional) Unit tests have been written for new behavior
  • PR title describes the changes

Post-Review Checklist for the PR Author

PR Author should check the checkboxes below before merging.

  • All open points are addressed and tracked via issues or tickets

CI Checks

  • Build and test for PR: Required to pass before the merge.

@manato manato requested a review from ktro2828 February 12, 2026 14:03
Copy link
Contributor

@ktro2828 ktro2828 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your dedicated PR! My first review's done. Please take a look when you have time!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive video encoder support for H.264, H.265, and AV1 codecs on NVIDIA Jetson Orin platforms. The implementation leverages hardware-accelerated encoding via the Jetson Multimedia API (NvVideoEncoder) and integrates with the existing ROS 2 node infrastructure to publish encoded video frames using the ffmpeg_image_transport_msgs::msg::FFMPEGPacket message type instead of sensor_msgs::msg::CompressedImage.

Changes:

  • Added new video encoder classes (JetsonH264Compressor, JetsonH265Compressor, JetsonAV1Compressor) with a common base class hierarchy
  • Extended ROS node to dynamically select between JPEG compression (using CompressedImage) and video encoding (using FFMPEGPacket) based on configuration
  • Added comprehensive test suites for all three video codecs with various parameter combinations

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 27 comments.

Show a summary per file
File Description
src/accelerated_image_processor_compression/include/accelerated_image_processor_compression/video_compressor.hpp Defines base VideoCompressor class and factory functions for codec-specific compressors
src/accelerated_image_processor_compression/src/video_compressor/jetson.hpp Declares JetsonVideoCompressor base class with encoder parameters and virtual interface methods
src/accelerated_image_processor_compression/src/video_compressor/jetson.cpp Implements core Jetson video encoder logic including initialization, processing, and callback handling
src/accelerated_image_processor_compression/src/video_compressor/jetson_h264.cpp Implements H.264-specific encoder configuration and parameters
src/accelerated_image_processor_compression/src/video_compressor/jetson_h265.cpp Implements H.265-specific encoder configuration and parameters
src/accelerated_image_processor_compression/src/video_compressor/jetson_av1.cpp Implements AV1-specific encoder with IVF header stripping logic
src/accelerated_image_processor_compression/src/video_compressor/jetson_error_helper.hpp Provides error handling macros and status types for encoder operations
src/accelerated_image_processor_compression/src/video_compressor/jetson_precise_timestamp_map.hpp Implements thread-safe timestamp mapping to preserve nanosecond precision
src/accelerated_image_processor_compression/src/builder.cpp Updates factory to support H264, H265, and AV1 compression types
src/accelerated_image_processor_ros/src/imgproc_node.hpp Changes publisher types to PublisherBase for polymorphic message publishing
src/accelerated_image_processor_ros/src/imgproc_node.cpp Implements dynamic publisher creation based on compression type (JPEG vs video)
src/accelerated_image_processor_ros/src/conversion.cpp Adds to_ros_ffmpeg() and to_ros_ffmpeg_encoding() conversion functions
src/accelerated_image_processor_common/include/accelerated_image_processor_common/datatype.hpp Adds video format enums and optional fields for PTS, flags, and endianness
src/accelerated_image_processor_common/include/accelerated_image_processor_common/processor.hpp Makes process() virtual and extracts post_process() for video encoder callback use
src/accelerated_image_processor_compression/test/jetson_video_compressor_*.cpp Comprehensive test suites for H264, H265, and AV1 encoders with parameter combinations
src/accelerated_image_processor_compression/CMakeLists.txt Adds video encoder source files and VPI/NVMMAPI dependencies
src/accelerated_image_processor_compression/cmake/FindNVMMAPI.cmake CMake module to locate Jetson Multimedia API libraries

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Besides, since `create_compressor`s for video compression are only defined on
the Jetson platform, `#ifdef` condition was added to skip the tests for video
compressor creation on non-Jetson platforms.

Signed-off-by: Manato HIRABAYASHI <[email protected]>
Signed-off-by: Manato HIRABAYASHI <[email protected]>
Copy link
Contributor

@ktro2828 ktro2828 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manato Thank you for your prompt updates! I left some comments for the possible updates in the future, but LGTM!

@ktro2828
Copy link
Contributor

ktro2828 commented Feb 17, 2026

@manato One concern; It seems the unit-testing for accelerated_image_processor_compression takes over an hour. Does it happen on your Jetson device too?

Thanks to the review
[comment](#29 (comment)),
I noticed that `is_bigendian` is a common field in both sensor_msgs::msg::Image
and ffmpeg_image_transport_msgs::msg::FFMPEGPacket. From this perspective, I
conclude that `is_bigendian` can be a non-optional field in `common::ImageFormat`
as well.

Signed-off-by: Manato HIRABAYASHI <[email protected]>
Now, `JPEGCompressor` and `VideoCompressor` inherit the class

Signed-off-by: Manato HIRABAYASHI <[email protected]>
@manato
Copy link
Collaborator Author

manato commented Feb 17, 2026

@manato One concern; It seems the unit-testing for accelerated_image_processor_compression takes over an hour. Does it happen on your Jetson device too?

@ktro2828 Thanks for your detailed confirmation. Over an hour sounds like a little bit too long to me. Because the test of accelerated_image_processor_compression now consists of all possible parameter combinations for video encoding, it surely takes some time. You can accelerate the test process by adding --executor sequential --ctest-args -j16 options to colcon test because such parameter-combination tests are registered by separate gtests.
(Just in case, I added these points to the PR description as well, so that we can recall later.)

On my environment, if I added the options:

$ colcon test --executor sequential --ctest-args -j16 --event-handlers console_cohesion+ --packages-select accelerated_image_processor_compression
Starting >>> accelerated_image_processor_compression

# long log here...

100% tests passed, 0 tests failed out of 247

Label Time Summary:
gtest    =   2.19 sec*proc (4 tests)

Total Test time (real) =  37.78 sec
---
Finished <<< accelerated_image_processor_compression [38.1s]

Summary: 1 package finished [38.5s]

-> the test finished approximately 38 seconds.

Even if I omit the options:

$ colcon test --event-handlers console_cohesion+ --packages-select accelerated_image_processor_compression
Starting >>> accelerated_image_processor_compression

# long log here...

100% tests passed, 0 tests failed out of 247

Label Time Summary:
gtest    =   1.94 sec*proc (4 tests)

Total Test time (real) = 445.88 sec
---
Finished <<< accelerated_image_processor_compression [7min 26s]

Summary: 1 package finished [7min 27s]

-> It took approximately 7.5 minutes.

Judging from your observation, I guess there are two possible causes:

  1. Your Jetson is in power-saving mode
  2. The test may get stuck somewhere

For the 1. case, you can confirm whether the Jetson is max performance mode by the following ways:

$ sudo jetson_clocks --show
SOC family:tegra234  Machine:CTI Forge + Orin AGX
Online CPUs: 0-11
cpu0:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu1:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu2:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu3:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu4:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu5:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu6:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu7:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu8:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu9:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu10: Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
cpu11: Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0
GPU MinFreq=1300500000 MaxFreq=1300500000 CurrentFreq=1300500000
EMC MinFreq=204000000 MaxFreq=3199000000 CurrentFreq=3199000000 FreqOverride=1
DLA0_CORE:   Online=1 MinFreq=0 MaxFreq=1600000000 CurrentFreq=1600000000
DLA0_FALCON: Online=1 MinFreq=0 MaxFreq=844800000 CurrentFreq=844800000
DLA1_CORE:   Online=1 MinFreq=0 MaxFreq=1600000000 CurrentFreq=1600000000
DLA1_FALCON: Online=1 MinFreq=0 MaxFreq=844800000 CurrentFreq=844800000
PVA0_VPS0: Online=1 MinFreq=0 MaxFreq=1152000000 CurrentFreq=1152000000
PVA0_AXI:  Online=1 MinFreq=0 MaxFreq=832000000 CurrentFreq=832000000
FAN Dynamic Speed control=active hwmon4_pwm1=1
NV Power Mode: MAXN

Like the above, all 12 CPU cores are online, MinFreq==MaxFreq==CurrentFreq, NV Power Mode==MAXN, if the Jetson Orin is in max performance mode.
If it is not the case, you can configure it by:

$sudo nvpmodel -m 0 # Set NV Power Mode to MAXN. system reboot will be required
$sudo jetson_clocks # Maximize online core frequencies. If it is not registered as systemd service, this needs to be executed at every boot

For the 2. case, the actual executables for the test exist under build/<package_name>. So you can see the raw output of the test executables by executing them directly.
e.g.:

build/accelerated_image_processor_compression/jetson_video_compressor_av1.cpp_accelerated_image_processor_compression

Would you mind checking these two points?

@ktro2828
Copy link
Contributor

ktro2828 commented Feb 18, 2026

@manato Thank you for detailed supports!

  1. Your Jetson is in power-saving mode

Yeah, my device was in the power-saving mode, so I updated to max power mode

Result of jetson_clocks --show
$ sudo jetson_clocks --show
[sudo] password for nvidia: 
SOC family:tegra234  Machine:CTI Forge + Orin AGX
Online CPUs: 0-11
cpu0:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu1:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu2:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu3:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu4:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu5:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu6:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu7:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu8:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu9:  Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu10: Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
cpu11: Online=1 Governor=schedutil MinFreq=2201600 MaxFreq=2201600 CurrentFreq=2201600 IdleStates: WFI=0 c7=0 
GPU MinFreq=1300500000 MaxFreq=1300500000 CurrentFreq=1300500000
Active GPU TPCs: 8
EMC MinFreq=204000000 MaxFreq=3199000000 CurrentFreq=3199000000 FreqOverride=1
DLA0_CORE:   Online=1 MinFreq=0 MaxFreq=1600000000 CurrentFreq=1600000000
DLA0_FALCON: Online=1 MinFreq=0 MaxFreq=844800000 CurrentFreq=844800000
DLA1_CORE:   Online=1 MinFreq=0 MaxFreq=1600000000 CurrentFreq=1600000000
DLA1_FALCON: Online=1 MinFreq=0 MaxFreq=844800000 CurrentFreq=844800000
PVA0_VPS0: Online=1 MinFreq=0 MaxFreq=1369600000 CurrentFreq=1369600000
PVA0_AXI:  Online=1 MinFreq=0 MaxFreq=985600000 CurrentFreq=985600000
FAN Dynamic Speed Control=nvfancontrol hwmon0_pwm1=1
NV Power Mode: MAXN
  1. The test may get stuck somewhere

Seems unit-testings for JetsonH264Compressor and JetsonH265Compressor have some troubles on my device.

  • JetsonAV1Compressor --> Passed ✅
Result of AV1 test
$ build/accelerated_image_processor_compression/jetson_video_compressor_av1.cpp_accelerated_image_processor_compression
[==========] Running 41 tests from 3 test suites.
[----------] Global test environment set-up.
[----------] 1 test from TestAV1Compressor
[ RUN      ] TestAV1Compressor.JetsonVideoCompressorAV1Default
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 282 
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 282 
808539713
875711822
808539713
875711822
NVMEDIA: Need to set EMC bandwidth : 282000 
NvVideo: bBlitMode is set to TRUE 
[ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvV4l2ElementPlane.cpp:933) <encoder> Capture Plane:Timed out waiting for dqthread
[       OK ] TestAV1Compressor.JetsonVideoCompressorAV1Default (1311 ms)
[----------] 1 test from TestAV1Compressor (1311 ms total)

...
...
...

[ RUN      ] JetsonVideoCompressorAV1ComboWithoutTiling/TestAV1Compressor.JetsonVideoCompressorAV1ProfileLevelTypeCombo/7
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 282 
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 282 
NVMEDIA: Need to set EMC bandwidth : 282000 
NvVideo: bBlitMode is set to TRUE 
[ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvV4l2ElementPlane.cpp:933) <encoder> Capture Plane:Timed out waiting for dqthread
[       OK ] JetsonVideoCompressorAV1ComboWithoutTiling/TestAV1Compressor.JetsonVideoCompressorAV1ProfileLevelTypeCombo/7 (1225 ms)
[----------] 8 tests from JetsonVideoCompressorAV1ComboWithoutTiling/TestAV1Compressor (9760 ms total)

[----------] Global test environment tear-down
[==========] 41 tests from 3 test suites ran. (50046 ms total)
[  PASSED  ] 41 tests.
nvidia@ANVIL:~/workspace/a
  • JetsonH264Compressor --> Stacked ❌
Result of H264 test
$ build/accelerated_image_processor_compression/jetson_video_compressor_h264.cpp_accelerated_image_processor_compression 
[==========] Running 97 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 1 test from TestH264Compressor
[ RUN      ] TestH264Compressor.JetsonVideoCompressorH264Default
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 4 
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4 
875967048
875711822
875967048
875711822
H264: extProfile = 5 Level = 51 
NVMEDIA: Need to set EMC bandwidth : 282000 
NvVideo: bBlitMode is set to TRUE 
VENC: NvVideoEncBlockReportError: 2469: BlockSide error 0x4
NvVideoEnc: BlockError 
NvVideoEncTransferOutputBufferToBlock: DoWork failed line# 680 
NvVideoEnc: NvVideoEncTransferOutputBufferToBlock TransferBufferToBlock failed Line=691
...
...Stacked here
...
^C
  • JetsonH265Compressor --> Core dumped ❌
Result of H265 test
$ build/accelerated_image_processor_compression/jetson_video_compressor_h265.cpp_accelerated_image_processor_compression 
[==========] Running 105 tests from 2 test suites.
[----------] Global test environment set-up.
[----------] 1 test from TestH265Compressor
[ RUN      ] TestH265Compressor.JetsonVideoCompressorH265Default
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 8 
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8 
892744264
875711822
892744264
875711822
NvVideo: H265 : Profile : 1 
NVMEDIA: Need to set EMC bandwidth : 282000 
NvVideo: bBlitMode is set to TRUE 
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
NVENC_H265: Unsupported frameRate (Supported: 1.0 - 60.0), setting to deault value 30.00
[ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvV4l2ElementPlane.cpp:933) <encoder> Capture Plane:Timed out waiting for dqthread
[       OK ] TestH265Compressor.JetsonVideoCompressorH265Default (1297 ms)
[----------] 1 test from TestH265Compressor (1297 ms total)

...
... 
...

[ RUN      ] JetsonVideoCompressorH265Combo/TestH265Compressor.JetsonVideoCompressorH265ProfileLevelTypeCombo/68
Opening in BLOCKING MODE 
NvMMLiteOpen : Block : BlockType = 8 
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8 
892744264
875711822
892744264
875711822
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
[ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvBuffer.cpp:169) <Buffer> Could not map buffer 3, plane 0
[ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvV4l2ElementPlane.cpp:733) <encoder> Capture Plane:Error during setup
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
/home/nvidia/workspace/accelerated_image_processor/src/accelerated_image_processor_compression/src/video_compressor/jetson.cpp:177 (Success)
Encoder initialization failed: 
NvMMLiteOpen : Block : BlockType = 8 
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 8 
892744264
875711822
892744264
875711822
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
nvbufsurface: NvBufSurfaceMap function failed....
nvbufsurface: mapping of buffer (0) failed
nvbufsurface: error in mapping
[ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvBuffer.cpp:169) <Buffer> Could not map buffer 0, plane 0
[ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvV4l2ElementPlane.cpp:733) <encoder> Capture Plane:Error during setup
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
nvbuf_utils: dmabuf_fd -24 mapped entry NOT found
/home/nvidia/workspace/accelerated_image_processor/src/accelerated_image_processor_compression/src/video_compressor/jetson.cpp:177 (Success)
Encoder initialization failed: 
NvMMLiteOpen : Block : BlockType = 8 
===== NvVideo: NVENC =====
InitNVENC: Host1x handle open failed
NvMMLiteBlockCreate : Block : BlockType = 8 
Segmentation fault (core dumped)

I will investigate what's the problem.

Similar issue?: https://forums.developer.nvidia.com/t/maximum-width-and-height-supported-by-hardware-encoder/298688

* @brief Execute post process
* @param processed The image to be post-processed
*/
void post_process(Image & processed)
Copy link
Contributor

@ktro2828 ktro2828 Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[NIT] Seems better to rename as postprocess(...) for the name consistency with register_postprocess(...), what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments