TX1上使用265实时硬编码

来源:互联网 发布:ps磨皮插件怎么安装mac 编辑:程序博客网 时间:2024/06/10 21:56

官方明确说可以使用gstreamer,并且提供了gstreamer的一些样例

https://devtalk.nvidia.com/default/topic/920426/encode-h265-on-tx1/

http://developer.download.nvidia.com/embedded/L4T/r23_Release_v1.0/L4T_Tegra_X1_Multimedia_User_Guide.pdf


因此就先按这个流程走一遍吧,后续应该会使用修改版的x265进行实验。因此未完待续。

一开始使用video/x-raw这个参数一直有问题,看到http://stackoverflow.com/questions/27419113/playing-a-raw-video-using-gst-launch 这个。没太细究,换成videoparse吧


然后基本流程可以follow这个博主的步骤。ps:使用gst-inspect-1.0 –-version 查看到已经安装了1.8的版本了。

https://www.findhao.net/easycoding/1646

注意到使用了videoparse,这个是包含在bad组件中的  这需要另外安装gstreamer的其他组件

sudo apt-getinstall  gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad


然后就ok了,顺便把中间的omxh265改为x265enc也可以压缩了,不过omxh265速度很快 但是使用x265速度很慢,似乎没有GPU加速,待检查

gst-launch-1.0 filesrc location=BQMall_xxx.yuv ! videoparse format=i420 width=832 height=480 framerate=30 ! omxh265enc ! ‘video/x-h265,stream-format=(string)byte-stream’ ! filesink location aaa.265 -e


gst-launch-1.0 -v filesrc location=BQMall_xxx.yuv ! videoparse format=i420 width=832 height=480 framerate=30 ! x265enc ! filesink location aaa.265 -e   (-v可以不用)


注:在使用omxh265enc与omxh264enc时,需要定义stream-format=(string)byte-stream否则解码时显示no valid frames found before end of stream

ref: http://gstreamer-devel.966125.n4.nabble.com/prepare-a-video-file-for-rtph264pay-td4669076.html

不过发现omxh265enc使用IPPP编码,实际效果的BDrate甚至不如omxh264enc


如果要封装成mkv 参考https://devtalk.nvidia.com/default/topic/1002327/hardware-accelerated-video-encoding-with-gstreamer/


解码命令

gst-launch-1.0 filesrc location=./aaa.bin ! h265parse ! omxh265dec ! nvoverlaysink -e



0 0
原创粉丝点击