Gstreamer application usage on board

This commit is contained in:
zeroway
2019-07-17 11:41:58 +08:00
parent 25ceb1707b
commit 5c96fd0fa8
4 changed files with 45 additions and 3 deletions

View File

@ -39,6 +39,9 @@
## 应用开发
[LCD应用编程](./apps)
[Gstreamer使用](./gst.md)
## Uboot中驱动开发
[GPIO驱动](./uboot)

View File

@ -221,7 +221,7 @@ IQ文件会全部拷贝到etc/iqfiles目录下
/etc/init.d/S50set_pipeline start
### Test mipi camera on Buildroot
### Test mipi camera(on Buildroot system)
Test mipi camera using gstreamer(camera_rkisp.sh)
@ -266,7 +266,7 @@ Dump picture to file(using 7yuv to view the file)
--set-fmt-video=width=2112,height=1568,pixelformat=SBGGR10 \
--stream-mmap=3 --stream-to=/tmp/mp.raw.out --stream-count=1 --stream-poll
### USB摄像头使用(linux系统)
### USB摄像头使用(linux distro系统)
[参考代码](./test_camera-uvc.sh)
@ -286,4 +286,4 @@ Dump picture to file(using 7yuv to view the file)
指定输出格式和大小
su linaro -c 'gst-launch-1.0 v4l2src device=/dev/video8 ! "image/jpeg,width=640,height=480,framerate=30/1" ! mppvideodec ! rkximagesink sync=false'
su linaro -c 'gst-launch-1.0 v4l2src device=/dev/video0 ! "image/jpeg,width=640,height=480,framerate=30/1" ! mppvideodec ! rkximagesink sync=false'

26
gst.md Normal file
View File

@ -0,0 +1,26 @@
# Gstreamer使用
## 视频播放
使用gstreamer播放本地视频
export DISPLAY=:0.0
gst-launch-1.0 uridecodebin uri=file:///usr/local/test.mp4 ! rkximagesink
如果是root用户执行则要切换到普通用户
su linaro -c "gst-launch-1.0 uridecodebin uri=file:///usr/local/test.mp4 ! rkximagesink"
## 编解码测试
编解码测试[参考代码](./test_enc.sh)
export DISPLAY=:0.0
su linaro -c "gst-launch-1.0 videotestsrc num-buffers=512 ! video/x-raw,format=NV12,width=1920,height= 1080,framerate=30/1 ! queue ! mpph264enc ! queue ! h264parse ! mpegtsmux ! filesink location=/home/linaro/2k.ts"
su linaro -c "gst-launch-1.0 uridecodebin uri=file:///home/linaro/2k.ts ! rkximagesink"
JPEG解码测试
export DISPLAY=:0.0
su linaro -c 'gst-launch-1.0 -v videotestsrc ! "video/x-raw,width=1920,height=1080" ! queue ! jpegenc ! queue ! jpegparse ! queue ! mppvideodec ! rkximagesink'

13
test_enc.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
export DISPLAY=:0.0
#export GST_DEBUG=*:5
#export GST_DEBUG_FILE=/tmp/2.txt
echo "message: output to /home/linaro/2k.ts!"
su linaro -c "gst-launch-1.0 videotestsrc num-buffers=512 ! video/x-raw,format=NV12,width=1920,height= 1080,framerate=30/1 \
! queue ! mpph264enc ! queue ! h264parse ! mpegtsmux ! filesink location=/home/linaro/2k.ts"
echo "message: playing encoded video!"
su linaro -c "gst-launch-1.0 uridecodebin uri=file:///home/linaro/2k.ts ! rkximagesink"