0

我对 gstreamer 很陌生。我正在尝试使用 gstreamer1.0 playbin 元素播放 mpg 视频文件。

当我使用以下管道时,一切正常并显示视频:

gst-launch-1.0 -vm --gst-debug=3 filesrc location=/opt/aac-files/MPEG2-av-ps-short.mpg ! mpegpsdemux ! multiqueue ! mpegvideoparse ! mpeg2dec ! videoconvert ! videoscale ! video/x-raw,format=BGR16 ! waylandsink surface-id=1000

但是当我使用 playbin 元素时,我收到一条无效的格式错误消息:

:/# GST_DEBUG=waylandsink:DEBUG,wayland:DEBUG gst-launch-1.0 playbin uri=file:///opt/aac-files/MPEG2-av-ps-short.mpg video-sink=waylandsink surface-id=1000
Setting pipeline to PAUSED ...

** (gst-launch-1.0:2373): WARNING **: Wayland compositor is missing the ability to scale, video display may not work properly.
Pipeline is PREROLLING ...
libva info: VA-API version 0.99.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_0_32
libva info: va_openDriver() returns 0
Got context from element 'mfxdec0': gst.mfx.Aggregator=context, gst.mfx.Aggregator=(GstMfxTaskAggregator)NULL;
Redistribute latency...
0:00:00.151055451  2373 0x7f48b00ac000 DEBUG            waylandsink ../../../git/ext/wayland/gstwaylandsink.c:533:gst_wayland_sink_set_caps:<waylandsink0> set caps video/x-raw, format=(string)NV12, width=(int)720, height=(int)576, interlace-mode=(string)progressive, pixel-aspect-rat1

(gst-launch-1.0:2373): GStreamer-CRITICAL **: gst_debug_log_valist: assertion 'category != NULL' failed

(gst-launch-1.0:2373): GStreamer-CRITICAL **: gst_debug_log_valist: assertion 'category != NULL' failed
0:00:00.180116315  2373 0x7f48b00ac000 DEBUG            waylandsink ../../../git/ext/wayland/wlshmallocator.c:150:gst_wl_shm_memory_construct_wl_buffer:<wlshmallocator0> Creating wl_buffer of size 1769472 (768 x 576, stride 3072), format BGRx
0:00:00.180401520  2373 0x7f48b00ac000 DEBUG            waylandsink ../../../git/ext/wayland/wlshmallocator.c:150:gst_wl_shm_memory_construct_wl_buffer:<wlshmallocator0> Creating wl_buffer of size 622080 (720 x 576, stride 720), format NV12
[destroyed object]: error 0: invalid format 0x3231564e
surface                : 40 created
wl_display@1: error 0: invalid object 3
Error communicating with wayland: Invalid argument
SetDestinationRectangle: surface ID (40), Width (67111600), Height (32750)
Error communicating with wayland: Invalid argument
SetSourceRectangle     : surface ID (40), Width (67111600), Height (32750)
Error communicating with wayland: Invalid argument
SetVisibility          : surface ID (40), ILM_TRUE
Error communicating with wayland: Invalid argument
layerAddSurface        : surface ID (40) is added to layer ID (1000)
Error communicating with wayland: Invalid argument
Error communicating with wayland: Invalid argument
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstPulseSinkClock
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:05.264870866
Setting pipeline to PAUSED ...

是否可以使用 playbin 设置正确的视频格式?

4

0 回答 0