首页 > 解决方案 > 无法在基于 Yocto 的发行版上从 VLC 流式传输 RTSP

问题描述

我成功地使用 Yocto Linux 编译和部署 vlc 和 libvlc 到嵌入式板上。对于编译,我使用了 lua5.1 而不是 lua5.3。这就是我摆脱错误“损坏模块 liblua.so”的方法。

在我的 PC 上运行的东西不能在平台上运行,我很好奇可能缺少什么或可能是什么原因造成的。输出如下:

libvlc: Creating an input for 'rtsp://192.168.1.92:7236'
libvlc: using timeshift granularity of 50 MiB, in path '/tmp'
libvlc: `rtsp://192.168.1.92:7236' gives access `rtsp' demux `' path `192.168.1.92:7236'
libvlc: specified demux `any'
libvlc: creating demux: access='rtsp' demux='any' location='192.168.1.92:7236' file='(nul'
libvlc: looking for access_demux module matching "rtsp": 13 candidates
libvlc: version 2017.04.10
libvlc: RTP subsession 'video/MP2T'
libvlc: setup start: 0.000000 stop:0.000000
libvlc: creating demux: access='' demux='ts' location='' file='(null)'
libvlc: We have a timeout of 30 seconds
libvlc: spawned timeout thread
libvlc: play start: 0.000000 stop:0.000000
libvlc: using access_demux module "live555"
libvlc: looking for meta reader module matching "any": 2 candidates
libvlc: Trying Lua scripts in /home/root/.local/share/vlc/lua/meta/reader
libvlc: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
libvlc: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
libvlc: Error loading script /usr/lib/vlc/lua/meta/reader/filename.luac: /usr/lib/vlc/lua/mk
libvlc: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
libvlc: no meta reader modules matched
libvlc: `rtsp://192.168.1.92:7236' successfully opened
libvlc: looking for demux module matching "ts": 59 candidates
libvlc: no demux modules matched

我的应用程序没有看到任何输出,我想知道是什么原因造成的:这是 Lua 脚本中的错误,是“没有匹配的 demux 模块”吗?

在平台中,我可以选择使用以下选项配置 vlc:

PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad"
PACKAGECONFIG[a52] = "--enable-a52,--disable-a52,liba52"
PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
PACKAGECONFIG[live555] = "--enable-live555 LIVE555_PREFIX=${STAGING_DIR_HOST}${prefix},--disable-live555,live555"
PACKAGECONFIG[libass] = "--enable-libass,--disable-libass,libass"
PACKAGECONFIG[postproc] = "--enable-postproc,--disable-postproc,libpostproc"
PACKAGECONFIG[libva] = "--enable-libva,--disable-libva,libva"
PACKAGECONFIG[opencv] = "--enable-opencv,--disable-opencv,opencv"
PACKAGECONFIG[speex] = "--enable-speex,--disable-speex,speex"
PACKAGECONFIG[gstreamer] = "--enable-gst-decode,--disable-gst-decode,gstreamer1.0 gstreamer1.0-plugins-base gst-plugins-bad"
PACKAGECONFIG[vpx] = "--enable-vpx,--disable-vpx, libvpx"
PACKAGECONFIG[qt5] = "--enable-qt,--disable-qt, qtbase-native qtx11extras qtsvg"
PACKAGECONFIG[freerdp] = "--enable-freerdp,--disable-freerdp, freerdp"
PACKAGECONFIG[dvbpsi] = "--enable-dvbpsi,--disable-dvbpsi, libdvbpsi"
PACKAGECONFIG[samba] = "--enable-smbclient,--disable-smbclient, samba"
PACKAGECONFIG[upnp] = "--enable-upnp,--disable-upnp,libupnp"
PACKAGECONFIG[dvdnav] = "--enable-dvdnav,--disable-dvdnav,libdvdnav libdvdcss"
PACKAGECONFIG[sftp] = "--enable-sftp,--disable-sftp,libssh2"
PACKAGECONFIG[vorbis] = "--enable-vorbis,--disable-vorbis,libvorbis libogg"
PACKAGECONFIG[ogg] = "--enable-ogg,--disable-ogg,libvorbis libogg"
PACKAGECONFIG[dc1394] = "--enable-dc1394,--disable-dc1394,libdc1394"
PACKAGECONFIG[dv1394] = "--enable-dv1394,--disable-dv1394,libraw1394 libavc1394"
PACKAGECONFIG[svg] = "--enable-svg,--disable-svg,librsvg"
PACKAGECONFIG[svgdec] = "--enable-svgdec,--disable-svgdec,librsvg cairo"
PACKAGECONFIG[notify] = "--enable-notify,--disable-notify, libnotify gtk+3"
PACKAGECONFIG[fontconfig] = "--enable-fontconfig,--disable-fontconfig, fontconfig"
PACKAGECONFIG[freetype] = "--enable-freetype,--disable-freetype, freetype"
PACKAGECONFIG[dvdread] = "--enable-dvdread,--disable-dvdread, libdvdread libdvdcss"
PACKAGECONFIG[vnc] = "--enable-vnc,--disable-vnc, libvncserver"
PACKAGECONFIG[x11] = "--with-x --enable-xcb,--without-x --disable-xcb,  xcb-util-keysyms libxpm libxinerama"
PACKAGECONFIG[png] = "--enable-png,--disable-png,libpng"
PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"

现在,我有以下配置:

--enable-run-as-root \
    --enable-xvideo \
    --disable-screen --disable-caca \
    --enable-vlm \
    --enable-freetype \
    --enable-tremor \
    --enable-v4l2 --disable-aa --disable-faad \
    --enable-dbus \
    --without-contrib \
    --without-kde-solid \
    --enable-realrtsp \
    --disable-libtar \
    --enable-avcodec \
    ac_cv_path_MOC=${STAGING_BINDIR_NATIVE}${QT_DIR_NAME}/moc \
    ac_cv_path_RCC=${STAGING_BINDIR_NATIVE}${QT_DIR_NAME}/rcc \
    ac_cv_path_UIC=${STAGING_BINDIR_NATIVE}${QT_DIR_NAME}/uic \

非常感谢有关解决此问题的任何帮助。

编辑:我正在使用平台 TI DRA7xx,Yocto 在 rocko 分支上。我故意禁用了 x11 插件,因为我没有 x11,但仍然希望能够使用 eglfs 插件流式传输到 Qt 应用程序。

编辑 2:我从 Yocto 源启用了 a52 jack postproc gstreamer dvbpsi vorbis live555 ogg svg svgdec png vpx 插件,现在我得到以下输出:

libvlc: looking for demux module matching "ts": 61 candidates
libvlc: Force Seek Per Percent: PCR's not found,
libvlc: PATCallBack called
libvlc: new PAT ts_id=0 version=1 current_next=1
libvlc:   * number=1 pid=256
libvlc: PMTCallBack called
libvlc: new PMT program number=1 version=1 pid_pcr=4096
libvlc:   * es pid=4113 type=27 dr->i_tag=0x28
libvlc:   * es pid=4113 type=27 dr->i_tag=0x2a
libvlc:   * es pid=4113 type=27 fcc=h264
libvlc: selecting program id=1
libvlc: looking for decoder module matching "any": 38 candidates
libvlc: Using decodebin? no
libvlc: set state failure
libvlc: no decoder modules matched
libvlc: Codec `h264' (H264 - MPEG-4 AVC (part 10)) is not supported.
libvlc: Codec not supported
libvlc: VLC could not decode the format "h264" (H264 - MPEG-4 AVC (part 10))
libvlc: killing decoder fourcc `h264', 0 PES in FIFO
libvlc: MPEG-4 descriptor not found for pid 0x1100 type 0xf
libvlc:   * es pid=4352 type=15 fcc=mp4a
libvlc: looking for decoder module matching "any": 38 candidates
libvlc: no decoder modules matched
libvlc: Codec `mp4a' (MPEG AAC Audio) is not supported.
libvlc: Codec not supported
libvlc: VLC could not decode the format "mp4a" (MPEG AAC Audio)
libvlc: killing decoder fourcc `mp4a', 0 PES in FIFO
libvlc: using demux module "ts"
libvlc: DEMUX_SET_GROUP -1 (nil)
libvlc: pid[4096] unknown
libvlc: Buffering 0%
libvlc: Buffering 66%
libvlc: Stream buffering done (210 ms in 120 ms)
libvlc: Decoder wait done in 0 ms
../git/libdce_linux.c:70:       dce_init        ERROR: Failed OmapDrm_FD > 0 error val -

这让我认为它与 GPU 相关(OMAP)。

编辑 3 通过从 ffmpeg 启用 x264,我设法让流工作了一点。我还将 VLC 版本升级到 3.0.6,因为它抱怨 libavutils 的版本大于 55。现在,我看到流一分钟,然后冻结并给出分段错误。

libvlc: Standard set to Auto                                                           
libvlc: using demux module "ts"                                                        
libvlc: DEMUX_SET_GROUP -1 (nil)                                                       
libvlc: first packet for pid=0 cc=0x1                                                  
libvlc: PATCallBack called                                                             
libvlc: new PAT ts_id=0 version=1 current_next=1                                       
libvlc:   * number=1 pid=256                                                           
libvlc: temporary receiving program 1                                                  
libvlc: first packet for pid=256 cc=0x1                                                
libvlc: PMTCallBack called for program 1                                               
libvlc: new PMT program number=1 version=1 pid_pcr=4096                                
libvlc:   * pid=4113 type=0x1b AVC video stream as defined in ITU-T Rec. H.264         
libvlc:     - ES descriptor tag 0x28                                                   
libvlc:     - ES descriptor tag 0x2a                                                   
libvlc:      - found AVC_video_descriptor profile=0x67 level=0x80                      
libvlc:    => pid 4113 has now es fcc=h264                                             
libvlc: selecting program id=1                                                         
libvlc: looking for packetizer module matching "any": 25 candidates                    
libvlc: using packetizer module "h264"                                                 
libvlc: looking for video decoder module matching "any": 15 candidates                 
libvlc: using ffmpeg Lavc57.89.100                                                     
libvlc: CPU flags: 0x0000003f                                                          
libvlc: allowing 3 thread(s) for decoding                                              
libvlc: codec (h264) started                                                           
libvlc: using frame thread mode with 3 threads                                         
libvlc: using video decoder module "avcodec"                                           
libvlc: Default program is 1                                                           
libvlc:   * pid=17 listening for SDT                                                   
libvlc: enabling pid 4113 from program 1                                               
libvlc: enabling pcr pid 4096 from program 1                                           
libvlc: pid[4096] unknown                                                              
libvlc: Buffering 0%                                                                   
libvlc: found NAL_SPS (sps_id=0)                                                       
libvlc: found NAL_PPS (pps_id=0 sps_id=0)                                              
libvlc: restarting module due to input format change                                   
libvlc: removing module "avcodec"                                                      
libvlc: looking for video decoder module matching "any": 15 candidates                 
libvlc: using ffmpeg Lavc57.89.100                                                     
libvlc: CPU flags: 0x0000003f                                                          
libvlc: allowing 3 thread(s) for decoding                                              
libvlc: codec (h264) started                                                           
libvlc: using frame thread mode with 3 threads                                         
libvlc: using video decoder module "avcodec"                                           
libvlc: available software decoder output format 0 (yuv420p)                           
libvlc: looking for text renderer module matching "any": 3 candidates                  
libvlc: Building font databases.                                                       
libvlc: Took -9182 microseconds                                                        
libvlc: using text renderer module "freetype"                                          
libvlc: looking for video converter module matching "any": 16 candidates               
libvlc: 32x32 (32x32) chroma: YUVA -> 16x16 (16x16) chroma: RGBA with scaling using Bi)
libvlc: using video converter module "swscale"                                         
libvlc: looking for video converter module matching "any": 16 candidates               
libvlc: YUVP to YUVA converter                                                         
libvlc: using video converter module "yuvp"                                            
libvlc: Deinterlacing available                                                        
libvlc: deinterlace -1, mode auto, is_needed 0                                         
libvlc: looking for vout window module matching "none": 0 candidates                   
libvlc: no vout window modules                                                         
libvlc: Opening vout display wrapper                                                   
libvlc: looking for vout display module matching "vmem": 6 candidates                  
libvlc: VoutDisplayEvent 'resize' 1920x1090                                            
libvlc: using vout display module "vmem"                                               
libvlc: A filter to adapt decoder I420 to display I420 is needed                       
libvlc: looking for video converter module matching "any": 16 candidates               
libvlc: 1920x1080 (1920x1090) chroma: I420 -> 1920x1090 (1920x1090) chroma: I420 with )
libvlc: using video converter module "swscale"                                         
libvlc: Filter 'Swscale' (0xb1637560) appended to chain                                
libvlc: original format sz 1920x1090, of (0,0), vsz 1920x1080, 4cc I420, sar 1:1, msk 0
libvlc: VoutDisplayEvent 'resize' 1920x1080                                            
libvlc: removing module "freetype"                                                     
libvlc: looking for text renderer module matching "any": 3 candidates                  
libvlc: Building font databases.                                                       
libvlc: Took -9307 microseconds                                                        
libvlc: using text renderer module "freetype"                                          
libvlc: control type=22                                                                
libvlc: Buffering 75%                                                                  
libvlc: Received first picture                                                         
libvlc: Stream buffering done (233 ms in 209 ms)                                       
libvlc: Decoder wait done in 0 ms                                                      
libvlc: picture might be displayed late (missing 0 ms)                                 
libvlc: picture is too late to be displayed (missing 155 ms)                           
libvlc: picture is too late to be displayed (missing 138 ms)                           
libvlc: picture is too late to be displayed (missing 121 ms)                           
libvlc: picture is too late to be displayed (missing 105 ms)                           
libvlc: picture is too late to be displayed (missing 88 ms)                            
libvlc: picture is too late to be displayed (missing 72 ms)                            
libvlc: picture is too late to be displayed (missing 55 ms)                            
libvlc: picture is too late to be displayed (missing 38 ms)                            
libvlc: picture is too late to be displayed (missing 22 ms)                            
libvlc: picture might be displayed late (missing 5 ms)

有什么想法可以避免这个问题吗?是因为软件解码吗?我有以下配置:

PACKAGECONFIG_append = " a52 jack postproc gstreamer dvbpsi vorbis live555 ogg svg svgdec "
PACKAGECONFIG_append = " mad gnutls mkv"
RDEPENDS_vlc_append = " libmad libproxy ffmpeg "
EXTRA_OECONF_remove = "--disable-faad"
EXTRA_OECONF_append = " --enable-vlm --enable-x264 --enable-debug --enable-faad "
DEPENDS_append =  " x264 libav ffmpeg coreutils-native "
EXTRA_OECONF_append = " --enable-avcodec "

标签: linuxluavlcyocto

解决方案


推荐阅读