Rotate video (videoflip) in Gstreamer

Rotate video (videoflip) in Gstreamer

  • Hello,

    I would like to rotate a video in my Gstreamer pipeline (using RR SDK 2011Q2 on DM365).

    When trying this, I am getting an error ("WARNING: erroneous pipeline: could not link v4l2src0 to videoflip0"):

    ipipe-client run-config-script dm365_mt9p031_config;

    gst-launch -e v4l2src always-copy=false chain-ipipe=false ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720' ! videoflip method="rotate-180" ! dmaiaccel ! dmaienc_mpeg2 ! dmaiperf ! mpegpsmux ! filesink location=video.mpeg

     

    It seems that videoflip does not accept NV12 images so I have tried the following:

    gst-launch -e v4l2src always-copy=false chain-ipipe=false ! 'video/x-raw-yuv,format=(fourcc)NV12,width=1280,height=720' ! ffmpegcolorspace ! videoflip method="rotate-180" ! ffmpegcolorspace ! dmaiaccel ! dmaienc_mpeg2 ! dmaiperf ! mpegpsmux ! filesink location=video2.mpeg 

    But now I am getting 0 frame/s...

    Any suggestion?

  • Hi,

    Well, this probably won't work. The reason this platforms require special plugins is to avoid memory operations on the ARM side as much as possible, and if you try to do a colorspace conversion and video flip on the ARM of a 720P stream it will run at 0.05 frames per second at best...

    If you want to flip the video you can try checking if any on the datasheets for the codecs allow rotation when encoding, then it's a matter of implementing that functionality on the plugin.

    PD: psmux is a dog right now, so you will also get bad performance by using it.

    Diego