Skip to content

Commit 2e056b7

Browse files
jsunintelfrankdjx
authored andcommitted
ffmpeg: Add the steps to connect kahawai with openh264 encoder (#123)
* plugin/ffmpeg: add the steps to connect kahawai with openh264 encoder Signed-off-by: Jing Sun <[email protected]> (cherry picked from commit e4750e9)
1 parent 0b15631 commit 2e056b7

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

plugins/ffmpeg_plugin/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ One-session example: ffmpeg -framerate 60 -pixel_format yuv422p10le -width 1920
1010

1111
Two-sessions example: ffmpeg -framerate 60 -pixel_format yuv422p10le -width 1920 -height 1080 -udp_port 20000 -port 0000:31:00.0 -local_addr "192.168.96.2" -src_addr "239.168.85.20" -total_sessions 2 -ext_frames_mode 1 -f kahawai -i "1" -framerate 60 -pixel_format yuv422p10le -width 1920 -height 1080 -udp_port 20001 -port 0000:31:00.0 -local_addr "192.168.96.3" -src_addr "239.168.85.20" -total_sessions 2 -ext_frames_mode 1 -f kahawai -i "2" -map 0:0 -vframes 5000 -f rawvideo /dev/null -y -map 1:0 -vframes 5000 -f rawvideo /dev/null -y
1212

13+
With openh264 encoder example: ffmpeg -framerate 60 -pixel_format yuv422p10le -width 1920 -height 1080 -udp_port 20000 -port 0000:31:00.0 -local_addr "192.168.96.2" -src_addr "239.168.85.20" -dma_dev "0000:00:01.0" -ext_frames_mode 1 -f kahawai -i "k" -vframes 2000 -c:v libopenh264 out.264 -y
14+
1315
Parameters description:
1416
1. "framerate" supports 25, 30, 59, 60 and 120.
1517
2. "pixel_format" supports yuv422p10le only for now.

plugins/ffmpeg_plugin/build_ffmpeg_plugin.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
EX_PATH=${PWD}
44

5+
build_openh264(){
6+
if [ ! -d "./openh264" ];then
7+
git clone https://github.com/cisco/openh264.git
8+
fi
9+
10+
cd ./openh264
11+
git checkout -b openh264v2.3.1 origin/openh264v2.3.1
12+
make -j32
13+
sudo make install
14+
sudo ldconfig
15+
cd ../
16+
}
17+
518
build_ffmpeg(){
619
if [ ! -d "./ffmpeg" ];then
720
git clone https://git.ffmpeg.org/ffmpeg.git
@@ -13,13 +26,15 @@ build_ffmpeg(){
1326
git reset --hard aa28df74ab197c49a05fecc40c81e0f8ec4ad0c3
1427
cp -f ../kahawai.c ./libavdevice/
1528
git am --whitespace=fix ../0001-avdevice-kahawai-Add-the-kahawai-input-device-plugin.patch
16-
./configure --enable-shared --disable-static --enable-nonfree --enable-pic --enable-gpl --enable-mtl
29+
./configure --enable-shared --disable-static --enable-nonfree --enable-pic --enable-gpl --enable-mtl --enable-libopenh264 --enable-encoder=libopenh264
1730
make clean
1831
make -j32
1932
sudo make install
33+
sudo ldconfig
2034
cd ../
2135
}
2236

37+
build_openh264
2338
build_ffmpeg
2439

2540
echo "Building ffmpeg plugin is finished"

0 commit comments

Comments
 (0)