【问题标题】:How to pipe image to gstreamer using omxh264enc on raspberry pi?如何在树莓派上使用 omxh264enc 将图像传送到 gstreamer?
【发布时间】:2019-11-13 09:44:59
【问题描述】:

我正在将图像传送到 gstreamer,以便使用 omxh264 将其编码为视频。在我的代码中,图像是从源接收并通过管道传输到 gstreamer。为了重现这个问题,我在一个目录中提取了一些帧,并尝试使用以下命令将图像通过管道传输到 gstreamer。

cat Images/* |gst-launch-1.0 fdsrc fd=0 ! videoparse framerate=25 ! videoconvert ! omxh264enc ! qtmux ! filesink location=out.mp4

但是,我收到以下消息(在设置 GST_DEBUG="*:3" 之后)

Setting pipeline to PAUSED ...
0:00:00.136206216 14317  0x1ee58a0 WARN                GST_POLL gstpoll.c:829:gst_poll_remove_fd: 0x1edf450: couldn't find fd !
Pipeline is PREROLLING ...
0:00:00.171278212 14317  0x1ec0c90 FIXME           videoencoder gstvideoencoder.c:606:gst_video_encoder_setcaps:<omxh264enc-omxh264enc0> GstVideoEncoder::reset() is deprecated
0:00:00.181177600 14317 0x72302120 WARN                GST_PADS gstpad.c:4092:gst_pad_peer_query:<omxh264enc-omxh264enc0:src> could not send sticky events
0:00:00.183710793 14317 0x72302120 ERROR                    omx gstomx.c:2098:gst_omx_port_populate_unlocked:<omxh264enc-omxh264enc0> Failed to pass buffer 0x71900d50 (0x71804010) to video_encode port 201: Bad port index (0x8000101b)
0:00:00.184424533 14317 0x72302120 WARN             omxvideoenc gstomxvideoenc.c:945:gst_omx_video_enc_loop:<omxh264enc-omxh264enc0> error: Unable to reconfigure output port
ERROR: from element /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0: Could not configure supporting library.
Additional debug info:
gstomxvideoenc.c(945): gst_omx_video_enc_loop (): /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0:
Unable to reconfigure output port
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
0:00:00.185111606 14317 0x72302120 FIXME               basesink gstbasesink.c:3126:gst_base_sink_default_event:<filesink0> stream-start event without group-id. Consider implementing group-id handling in the upstream elements
Freeing pipeline ...

如果我将 omxh264enc 替换为 x264enc,则该命令可以正常工作。我在 omxh264enc 上做错了什么?

【问题讨论】:

    标签: raspberry-pi raspberry-pi3 gstreamer gstreamer-1.0


    【解决方案1】:

    我遇到了类似的问题(正在努力将一堆图像放入 RPI 上的 H264 视频中)。假设照片在一个文件夹中并命名为 Image001.jpg、Image002.jpg 等。这会将图像转换为具有 30 fps 和分辨率 640 * 480 的 avi 文件。使用 omxh264enc(GPU 硬件加速)在 RPI 零上运行

    试试:

     gst-launch-1.0 -e multifilesrc location="/Folder/Image%03d.jpg" !  
     image/jpeg, framerate=30/1 ! decodebin ! video/x-raw, width=640,  
     height=480 ! progressreport name=progress ! omxh264encode   
     target-bitrate=7500000 control-rate=variable ! video/x-h264, profile=high !  
     h264parse ! filesink location="/home/pi/Desktop/NewVideo.avi"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-12
      • 2020-03-23
      • 2017-10-13
      相关资源
      最近更新 更多