Video streaming Can';t让gstreamer生成去隔行扫描视频

Video streaming Can';t让gstreamer生成去隔行扫描视频,video-streaming,gstreamer,video-processing,rtsp,interlacing,Video Streaming,Gstreamer,Video Processing,Rtsp,Interlacing,背景: 我正在从Bosch VideoJet x40网络视频编码器传输视频。 它最多读取4个模拟摄像机输入和输出RTP流 我正在提供一台旧录像机的测试镜头(拯救列兵Ryan!),使用一个黄色的 连接到网络编码器输入的视频复合电缆 这些RTP流在UDP/RTP上作为H.264编码视频发送 小包裹YUV I420颜色空间中的编码视频数据 我的gstreamer管道读取RTP数据包,将它们从YUV转换为原始RGB,然后保存它们。迄今为止,它在这方面工作正常: gst-launch --gst-de

背景:

  • 我正在从Bosch VideoJet x40网络视频编码器传输视频。 它最多读取4个模拟摄像机输入和输出RTP流
  • 我正在提供一台旧录像机的测试镜头(拯救列兵Ryan!),使用一个黄色的 连接到网络编码器输入的视频复合电缆
  • 这些RTP流在UDP/RTP上作为H.264编码视频发送 小包裹YUV I420颜色空间中的编码视频数据
我的gstreamer管道读取RTP数据包,将它们从YUV转换为原始RGB,然后保存它们。迄今为止,它在这方面工作正常:

gst-launch --gst-debug=2 -vv udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264" port=33314 ! rtph264depay ! h264parse ! ffdec_h264 ! ffmpegcolorspace ! "video/x-raw-rgb, bpp=(int)24, depth=(int)24, framerate=(fraction)25/1, interlaced=(boolean)false" ! filesink location="privateryan.rgb"
下面是该命令的调试输出,它基本正常工作,并保存原始RGB视频输出。仅几秒钟后,此文件就变得巨大(如预期的那样),因此如果运行此命令,请小心:

Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0.GstPad:src: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:src: caps = video/x-h264
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = application/x-rtp, media=(string)video, payload=(int)96, clock-rate=(int)90000, encoding-name=(string)H264
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, parsed=(boolean)true, stream-format=(string)byte-stream, alignment=(string)au
/GstPipeline:pipeline0/ffdec_h264:ffdec_h2640.GstPad:sink: caps = video/x-h264, parsed=(boolean)true, stream-format=(string)byte-stream, alignment=(string)au
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, width=(int)704, height=(int)240, parsed=(boolean)true, stream-format=(string)byte-stream, alignment=(string)au
/GstPipeline:pipeline0/ffdec_h264:ffdec_h2640.GstPad:sink: caps = video/x-h264, width=(int)704, height=(int)240, parsed=(boolean)true, stream-format=(string)byte-stream, alignment=(string)au
/GstPipeline:pipeline0/ffdec_h264:ffdec_h2640.GstPad:src: caps = video/x-raw-yuv, width=(int)704, height=(int)240, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)5/11
/GstPipeline:pipeline0/GstFFMpegCsp:ffmpegcsp0.GstPad:src: caps = video/x-raw-rgb, bpp=(int)24, depth=(int)24, framerate=(fraction)25/1, interlaced=(boolean)false, width=(int)704, height=(int)240, pixel-aspect-ratio=(fraction)5/11, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, endianness=(int)4321
/GstPipeline:pipeline0/GstFFMpegCsp:ffmpegcsp0.GstPad:sink: caps = video/x-raw-yuv, width=(int)704, height=(int)240, framerate=(fraction)25/1, format=(fourcc)I420, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)5/11
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw-rgb, bpp=(int)24, depth=(int)24, framerate=(fraction)25/1, interlaced=(boolean)false, width=(int)704, height=(int)240, pixel-aspect-ratio=(fraction)5/11, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, endianness=(int)4321
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw-rgb, bpp=(int)24, depth=(int)24, framerate=(fraction)25/1, interlaced=(boolean)false, width=(int)704, height=(int)240, pixel-aspect-ratio=(fraction)5/11, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, endianness=(int)4321
/GstPipeline:pipeline0/GstFileSink:filesink0.GstPad:sink: caps = video/x-raw-rgb, bpp=(int)24, depth=(int)24, framerate=(fraction)25/1, interlaced=(boolean)false, width=(int)704, height=(int)240, pixel-aspect-ratio=(fraction)5/11, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, endianness=(int)4321
录制后,我使用Vooya原始序列播放器检查文件并播放它们。但是,如果不告诉Vooya视频是隔行扫描的,则文件无法正确播放

我需要平面包装的框架,我可以提取以后的计算机视觉应用程序

在这里,您可以看到视频播放,尽管使用了错误的视频格式(隔行):

在这里,当我将设置更改为所需时,您可以看到视频未播放:

因此,我尝试将解交错插件添加到我的管道中,但没有成功。我可能做错了什么

这是我的新管道,在文件链接之前有解交错

gst-launch --gst-debug=1 -v udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264,frame-rate=(fraction)25/1" port=33314 ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! "video/x-raw-rgb, bpp=(int)24, depth=(int)24, framerate=(fraction)25/1, interlaced=(boolean)false" ! deinterlace ! filesink location="privateryan.rgb"
0:00:00.096569700 12969       0x607080 ERROR           GST_PIPELINE ./grammar.y:614:gst_parse_perform_link: could not link ffmpegcsp0 to deinterlace0
WARNING: erroneous pipeline: could not link ffmpegcsp0 to deinterlace0
为什么我的视频在经过所有这些处理后仍然显示为隔行扫描,我在隔行扫描插件方面可能做了哪些不正确的事情

我认为录像机或黑白摄像机可能会在其一端隔行扫描视频,但我不确定。即使是这样,我也无法改变这一点,仍然需要去交错


谢谢

您是否使用其他播放器进行过测试?是的,在VLC中,它与xvimagesink一样正确显示。我目前的理论是将隔行扫描的帧一分为二,帧速率加倍,即一帧中的所有顶部场,下一帧中的所有底部场,然后播放器通过将它们编织在一起来解隔行扫描。我还不能证明这一点,但这听起来似乎合理吗?简单的证明是自己阅读文件(而不是通过媒体播放器)并检查其内容。因为它是未压缩的RGB,所以读取应该相当简单