This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: gstreamer video deinterlacing

Part Number: AM5728

Tool/software: Linux

I'm trying to deinterlace raw YUV video flow, captured from analog cam on my board, based on sitara AM5728 processor.

For capture I use this pipeline:
  gst-launch-1.0 v4l2src device=/dev/video1 ! videoconvert ! filesink location=new.yuv

Output file correctly parses and deinterlases with ffmpeg:
  ffplay -f rawvideo -pix_fmt uyvy422 -video_size 720x288 -framerate 50 -vf tinterlace=mode=0 new.yuv

But I can't build correct pipeline  for this goal by gst-launch. I'm trying to use this pipeline, but output stream isn't deinterlaced:
  gst-launch-1.0 -v filesrc location=cap.yuv ! videoparse width=720 height=576 framerate=24/1 interlaced=true format=2 ! deinterlace ! autovideosink

Can anybody help me to solve this problem.
I'm attaching resulting output of above pipeline 


  • Hello,

    Where you are executing the above pipeline on board or PC?


    BR
    Margarita
  • I'm executing it on both machines, PC needs only for convenient way of taking screenshot of result
  • Hello,

    It seems that you are playing the video on PC(autovideosink element).
    You could try this pipeline:

    gst-launch-1.0 filesrc location=interlaced.uyuv ! videoparse width=1280 height=720 format=uyvy ! videoconvert ! autovideosink

    Change the resolution and format if it is require.

    The result that you are seeing seems like format problem.
    I can not understand the videoconvert element in your capture pipeline(set the capsfilter in the capture pipeline).

    BR
    Margarita

  • Thank you very much for fast reply. Yes, capture format was uncorrect, I've set correct filters for both pipelines, but result video flow is still outputs in interlaced mode:

    gst-launch-1.0 -v v4l2src device=/dev/video1 ! video/x-raw,format=UYVY,width=720,height=576,framerate=25/1 ! filesink location=new.yuv
    gst-launch-1.0 filesrc location=new.yuv ! videoparse width=720 height=576 format=uyvy ! videoconvert ! autovideosink

  • Hello,

    The "double" frame that you are seeing is the result of the interlaced video.
    Please, try to add the deinterlace element in the pipeline for read from file->display.
    You could check here for more information regarding deinterlace element. There is example also:
    gstreamer.freedesktop.org/.../gst-plugins-good-plugins-deinterlace.html

    Let me know the result.

    BR
    Margarita
  • After invocation of above pipeline, it's all the same result: picture is divided on two parts: part of bottom and part of top fields.

    gst-launch-1.0 -v filesrc location=cap.yuv ! videoparse width=720 height=576 format=uyvy interlaced=true ! deinterlace ! videoconvert ! autovideosink
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    /GstPipeline:pipeline0/GstVideoParse:videoparse0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)UYVY\,\ width\=\(int\)720\,\ height\=\(int\)576\,\ interlace-mode\=\(string\)interleaved\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)jpeg\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)25/1"
    /GstPipeline:pipeline0/GstDeinterlace:deinterlace0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)UYVY\,\ width\=\(int\)720\,\ height\=\(int\)576\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)jpeg\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)50/1"
    /GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = "video/x-raw\,\ width\=\(int\)720\,\ height\=\(int\)576\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)50/1\,\ format\=\(string\)YV12"
    /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = "video/x-raw\,\ width\=\(int\)720\,\ height\=\(int\)576\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)50/1\,\ format\=\(string\)YV12"
    /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstXvImageSink:autovideosink0-actual-sink-xvimage.GstPad:sink: caps = "video/x-raw\,\ width\=\(int\)720\,\ height\=\(int\)576\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)50/1\,\ format\=\(string\)YV12"
    /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink: caps = "video/x-raw\,\ width\=\(int\)720\,\ height\=\(int\)576\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)50/1\,\ format\=\(string\)YV12"
    /GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)UYVY\,\ width\=\(int\)720\,\ height\=\(int\)576\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)jpeg\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)50/1"
    /GstPipeline:pipeline0/GstDeinterlace:deinterlace0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)UYVY\,\ width\=\(int\)720\,\ height\=\(int\)576\,\ interlace-mode\=\(string\)interleaved\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)jpeg\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)25/1"
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...



  • Hello,

    Could you share the video?

    BR
    Margarita
  • Hello,

    Thank you! I will check it and I will get back to you.

    BR
    Margarita
  • Thank you very much
  • Hello,

    Please try this pipeline it is working for me:

    gst-launch-1.0 filesrc location=captured.yuv ! videoparse width=720 height=288 format=uyvy ! videoconvert ! autovideosink

    BR

    Margarita

  • Yes, I understand that it's very simple decision, but throwing out all even or odd fields is unacceptable.

  • As I understand, vpe plugin for gstreamer doesn't support deinterlacing?
  • Hello,

    Please check this guide :
    processors.wiki.ti.com/.../Processor_Training:_Multimedia
    With gst-inspect-1.0 vpe you could check the supported formats.

    BR
    Margarita