Skip to content

fix(compression): copy sequence header properly for AV1 packet - #41

Open
manato wants to merge 1 commit into
mainfrom
fix/proper_sequence_header_for_av1
Open

fix(compression): copy sequence header properly for AV1 packet#41
manato wants to merge 1 commit into
mainfrom
fix/proper_sequence_header_for_av1

Conversation

@manato

@manato manato commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

PR Type

  • Bug Fix

Related Links

N/A

Description

This PR fixes how to generate the necessary header information for AV1 keyframes.

Previously, the JetsonAV1Compressor copied the whole first frame to every key frame to make the generated streeam decodable from any key frame.
If the stream is processed by a "spec-faithful" decoder, it generates a blank image for every key frame (, and packing two key frames into one packet, which violates the AV1 specification).

This PR extracts only a portion of information (called "Sequence Header") and copies it to every key frame to secure the specification and make the generated stream decodable from any key frame.

Review Procedure

Execute the followings on a Jetson platform

# publish test pattern (you can install gscam package via `sudo apt install ros-$ROS_DISTRO-gscam`)
$ ros2 run gscam gscam_node \
  --ros-args \
  -p gscam_config:="videotestsrc pattern=18 ! video/x-raw,width=2880,height=1860,frame=2/1"\
  -p camera.image_raw.enable_pub_plugins:=["image_transport/raw"]

# execute AV1 compression
$ ros2 run accelerated_image_processor_ros accelerated_image_processor_ros_imgproc_node \
  --ros-args \
  -r image_raw:=/camera/image_raw \
  -r image_raw/compressed:=/camera/image_raw/compressed \
  -p max_task_length:=5 \
  -p compressor.type:="av1" \
  -p compressor.av1.enable_tile:=false \
  -p rectifier.do_rectify:=false

And visualize compressed data using AV1-compatible lichtblick (which is making in progress): TIER IV INTERNAL

In the previous implementation, blank frames (whole-green images) appear periodically.
After this PR is introduced, they should be gone.

Before After
acc_pr41_before.mp4
acc_pr41_after.mp4

Remarks

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.

Stack created with GitHub Stacks CLIGive Feedback 💬

Previously, the `JetsonAV1Compressor` copied whole the first frame to every key
frames to make generated stream decodable from any key frames.
If the stream is processed a "spec-faithful" dedcoder, it generates blank images
for every key frames (, and packing two key frames into one packet viorates the
AV1 specification).
This commit extracts only portion of information and copies it to every key
frames to secure the specification and make the generated stream decodable from any key frames.

Signed-off-by: Manato HIRABAYASHI <manato.hirabayashi@tier4.jp>
@manato
manato marked this pull request as ready for review September 3, 2026 06:22
@manato
manato requested a review from ktro2828 September 3, 2026 06:22
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.

1 participant