Skip to content

Commit f8a61ad

Browse files
committed
feat(linux): wave5: Add FFMPEG Encode commands
Wave5 driver has been updated to make it operable with FFMPEG. Update documentation with relevant commands to expose this feature to customers. Signed-off-by: Brandon Brnich <[email protected]>
1 parent 086b098 commit f8a61ad

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

source/linux/Foundational_Components_Multimedia_wave5.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
Multimedia Video Codec
55
######################
66

7+
.. _multimedia-wave5-introduction:
8+
79
************
810
Introduction
911
************
@@ -638,6 +640,35 @@ To pipe the output from ffmpeg to ffplay with hardware acceleration, the followi
638640
639641
ffmpeg -re -codec:v hevc_v4l2m2m -i input.h265 -fps_mode passthrough -f rawvideo - | ffplay -framerate 30 -video_size 1920x1080 -f rawvideo -autoexit -
640642
643+
FFMPEG also has support to use V4L2 HW accelerators for video encoding. The following command is an example for encoding a raw video by using the Wave5 IP:
644+
645+
.. code-block:: console
646+
647+
ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 352x288 -r 30 -i <input_video>.yuv -c:v h264_v4l2m2m <output_video>.h264 -y -nostdin
648+
649+
The following is the equivalent command if H265 encoding is required.
650+
651+
.. code-block:: console
652+
653+
ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 352x288 -r 30 -i <input_video>.yuv -c:v hevc_v4l2m2m <output_video>.h265 -y -nostdin
654+
655+
.. note::
656+
657+
352x288 above is just an example resolution. Update this value to properly reflect the resolution of the raw video.
658+
659+
FFMPEG can also capture video by using cameras attached to the device. See the following for an example.
660+
661+
.. code-block:: console
662+
663+
ffmpeg -f v4l2 -framerate 30 -video_size 1280x720 -i /dev/video3 -c:v h264_v4l2m2m <video_destination>
664+
665+
Remember that the Wave5 does have HW requirements for the raw video; refer to :ref:`multimedia-wave5-introduction` for these constraints. If the video being
666+
captured is a resolution not aligned to the HW requirements, FFMPEG can pad the video to make it compliant with HW. The following command accomplishes this.
667+
668+
.. code-block:: console
669+
670+
ffmpeg -f rawvideo -pix_fmt yuv420p -s 1920x1080 -r 30 -i <1080p_input_video>.yuv -vf "pad=width=1920:height=1088:x=0:y=0:color=black" -c:v h264_v4l2m2m <output_video>.h264
671+
641672
To print out the packet's data and payload data in hexadecimal from a given multimedia stream named :file:`foo.h265`, the following can be used:
642673

643674
.. code-block:: console

0 commit comments

Comments
 (0)