-
Notifications
You must be signed in to change notification settings - Fork 35
Description
I think I've been affected by a bug that recently landed in Humble, during the upgrade from 1.0.1 to 3.0.2. This bug has resulted in only one keyframe being written by the FFMPEG transport plugin. As a result, if I instantiate a camera with:
<param name="camera.image_raw.ffmpeg.encoder" value="hevc_nvenc" />
<param name="camera.image_raw.ffmpeg.encoder_av_options" value="preset:ll,profile:main,crf:0" />
and then record two bags with:
ros2 bag record /camera_0/image_raw/ffmpeg -o bag1
# CTRL-C the first process
ros2 bag record /camera_0/image_raw/ffmpeg -o bag2
# CTRL-C the second process
Then the second bag will be impossible to decode because it consists only of P-frames, with no I-frames.
As far as I can tell, this is because the initialization of the encoder via parameters has recently changed as follows.
In ffmpeg_image_transport, the encoder's setGOPSize function is only called if the parameter is explicitly passed by the user:
| encoder_.setGOPSize(v.get<int>()); |
In ffmpeg_encoder_decoder, GOPSize_ is initialized to -1:
Thus, the README is incorrect:
ffmpeg_image_transport/README.md
Line 81 in b2d028c
| - ``gop_size``: The number of frames between keyframes. Default: 10. |
Can you advise on whether this is a legit bug, or am I misreading the documentation?