do deinterlace with TX1

I try to use TX1 to decode field frame. Can TX1 do deinterlace?

We have it supported. Please try gstreamer or MM APIs.

Could tell the gstreamer plugin name? Ifind “deinterlace”. Is it is hard “deinterlace”.

Hi Echo1900, it is done in decoder automatically.

But now I find when I use 720X576I25 stream, decoder out frame rate is 50.What canbe the reason

Hi Echo1900, please share the video file and command to reproduce the issue.

Dear DaneLLL:
I use code, not cmd, I put the code?

Yes, please share steps to reproduce the issue on r24.2.1.

Dear DaneLLL:
this is my code, I used ffmpeg to demux ts ,get es. How I update the ts file?

obj->pipeline = gst_pipeline_new("tx1-decoder");
    vidSrc = gst_element_factory_make("appsrc","ipcsrc");
    g_object_set (G_OBJECT (vidSrc), "emit-signals", FALSE, NULL);
    g_object_set (G_OBJECT (vidSrc), "block", FALSE,  NULL);

    if(params->decode_type == DECODE_H265)
    {
        esParse = gst_element_factory_make("h265parse","esParse");
        vidDec = gst_element_factory_make("omxh265dec","viddec");
    }
    else
    {
        esParse = gst_element_factory_make("h264parse","esParse");
        vidDec = gst_element_factory_make("omxh264dec","viddec");
    }

    vidConv = gst_element_factory_make("nvvidconv","convert");

    /*osd*/
    osd = gst_element_factory_make("textoverlay","osd");
    g_object_set (G_OBJECT (osd), "valignment", 3,  NULL); //Absolute x-position clamped to canvas - position
    g_object_set (G_OBJECT (osd), "halignment", 4,  NULL); //Absolute y-position clamped to canvas - position
    g_object_set (G_OBJECT (osd), "line-alignment", 0,  NULL); //left Alignment of text lines relative to each other
    g_object_set (G_OBJECT (osd), "font-desc", "Sans 16",  NULL);
    g_object_set (G_OBJECT (osd), "draw-shadow", FALSE,  NULL);

    yuvsink = gst_element_factory_make ("fakesink", "yuvsink");
    g_object_set (G_OBJECT(yuvsink), "signal-handoffs", TRUE, NULL);
    g_object_set (G_OBJECT(yuvsink), "can-activate-pull", TRUE, NULL);
    //g_object_set (G_OBJECT(yuvsink), "sync", TRUE,  NULL);
    //g_object_set (G_OBJECT(yuvsink), "async", TRUE,   NULL);
    g_signal_connect (yuvsink, "handoff", G_CALLBACK (get_yuv), obj);


    if (!(obj->pipeline) || !vidSrc || !esParse || !vidDec || !vidConv || !osd || !yuvsink)
    {  
        gst_object_unref (obj->pipeline); 
        return -1;  
    }
    gst_bin_add_many(GST_BIN(obj->pipeline), vidSrc, esParse, vidDec, vidConv, osd, yuvsink, NULL);


    /**********************************video link**********************************/
    gst_element_link_many(vidSrc,  esParse, vidDec, vidConv, NULL);


    GstCaps *conv2dispaly_caps = gst_caps_new_simple("video/x-raw",
                                                     "format", G_TYPE_STRING, "I420",
                                                     "width", G_TYPE_INT, params->window_width,
                                                     "height", G_TYPE_INT, params->window_height,
                                                     NULL);
    if(!conv2dispaly_caps)
    {
        gst_object_unref(obj->pipeline); 
        return -1;
    }

    if(!gst_element_link_filtered(vidConv, osd, conv2dispaly_caps))
    {
        gst_caps_unref(conv2dispaly_caps);
        gst_object_unref (obj->pipeline); 
        return -1;
    }
    gst_caps_unref(conv2dispaly_caps);

    gst_element_link(osd, yuvsink);


    /*start*/
    if (gst_element_set_state(obj->pipeline, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) 
    {  
        gst_object_unref(obj->pipeline); 
        return -1;
    }

========================================================
YUV CODE PART


    if (gst_buf_v != NULL)
    {
        //info = GstMapInfo();
        success = gst_buffer_map(gst_buf_v, &info, (GstMapFlags)GST_MAP_READ);
        if (!success)
        {
            return -1 ;
        }
    }

    /* copy yuv */
       ================    

    gst_buffer_unmap(gst_buf_v, &info);

Hi Echo1900, please try a full gstreamer pipeline
gst-launch-1.0 filesrc location=test.ts ! tsdemux ! h264parse ! omxh264dec ! nvoverlaysink

If the issue is still present, could you upload it to dropbox or google drive so that we can download?

Hi DaneLLL,

 Thanks for your quick reply.I tested your cmd, get print as list.
 I also tried <b>'gst-launch-1.0 udpsrc port=12340 ! tsdemux ! h264parse ! omxh264dec ! nvvidconv ! omxh264enc ! mpegtsmux ! udpsink host=192.168.1.20 port =12340'</b>
 Nothing changed. I upload the file to <a target='_blank' rel='noopener noreferrer' href='https://drive.google.com/open?id=0B3cowdAKfs-6R09vM3ExVDVCbVE'>https://drive.google.com/open?id=0B3cowdAKfs-6R09vM3ExVDVCbVE</a>
TVMR: NVDEC LowCorner Freq = (576000 * 1024) 
TVMR: FrameRate = 3.969494 
TVMR: FrameRate = 3.898935 
TVMR: FrameRate = 3.670542 
TVMR: FrameRate = 2.983830

I tried ‘ffmpeg’ on TX1, ‘ffmpeg’ out is OK.

Hi Echo1900,
We can correctly play the video file on r24.2.1:

ubuntu@tegra-ubuntu:~$ gst-launch-1.0 filesrc location= GOP_III.ts ! tsdemux ! h264parse ! omxh264dec ! nvoverlaysink
Setting pipeline to PAUSED ...
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingPipeline is PREROLLING ...
NvMMLiteOpen : Block : BlockType = 261
TVMR: NvMMLiteTVMRDecBlockOpen: 7580: NvMMLiteBlockOpen
NvMMLiteBlockCreate : Block : BlockType = 261
TVMR: cbBeginSequence: 1166: BeginSequence  720x576, bVPR = 0, fFrameRate = 25.000000
TVMR: LowCorner Frequency = 100000
TVMR: cbBeginSequence: 1545: DecodeBuffers = 17, pnvsi->eCodec = 4, codec = 0
TVMR: cbBeginSequence: 1606: Display Resolution : (720x576)
TVMR: cbBeginSequence: 1607: Display Aspect Ratio : (785x576)
TVMR: cbBeginSequence: 1649: ColorFormat : 5
TVMR: cbBeginSequence:1663 ColorSpace = NvColorSpace_YCbCr601
TVMR: cbBeginSequence: 1761: Layout 3: Interlaced Output Resolution : (768x576)
TVMR: InterlaceBufferAlloc !!!!!!!!!!!!!!!!!!!!!
TVMR: TVMRInit: 100: frameWidth = 720, frameHeight = 576
TVMR: TVMRInit: 114: deinterlaceType = 2
TVMR: DeinterlaceThread: 827: DeinterlaceThread is created
TVMR: cbBeginSequence: 1868: NumOfSurfaces = 4, InteraceStream = 1, InterlaceEnabled = 1, bSecure = 0, MVC = 0 Semiplanar = 1, bReinit = 1, BitDepthForSurface = 8 LumaBitDepth = 8, ChromaBitDepth = 8, ChromaFormat = 5
Allocating new output: 768x576 (x 6), ThumbnailMode = 0
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
TVMR: FrameRate = 25
TVMR: NVDEC LowCorner Freq = (83333 * 1024)
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: NvMMLiteTVMRDecDoWork: 6466: NVMMLITE_TVMR: EOS detected
TVMR: TVMRBufferProcessing: 5444: Processing of EOS
TVMR: TVMRBufferProcessing: 5519: Processing of EOS Done
Got EOS from element "pipeline0".
Execution ended after 0:02:47.100497201
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
TVMR: TVMRFrameStatusReporting: 6067: Closing TVMR Frame Status Thread -------------
TVMR: TVMRVPRFloorSizeSettingThread: 5885: Closing TVMRVPRFloorSizeSettingThread -------------
TVMR: TVMRFrameDelivery: 5917: Closing TVMR Frame Delivery Thread -------------
TVMR: DeinterlaceThread: 903: Closing Deinterlace Thread
TVMR: NvMMLiteTVMRDecBlockClose: 7740: Done
Setting pipeline to NULL ...
Freeing pipeline ...
ubuntu@tegra-ubuntu:~$

ubuntu@tegra-ubuntu:~$ gst-launch-1.0 filesrc location= GOP_III.ts ! tsdemux ! h264parse ! omxh264dec ! nvoverlaysink
TVMR: InterlaceBufferAlloc !!!
Execution ended after 0:02:47.100497201

It detects it is an interlaced stream and the total playback time is correct.

HI DaneLLL,
We now use Jetpack Version 2.3.1:Linux for Tegra 24.2.1,Multimedia API v24.2.1.
So what can be the reason.

Hi Echo1900,
We have also verified Multimedia API v24.2.1 and it works well.

ubuntu@tegra-ubuntu:~$ export DISPLAY=:0
ubuntu@tegra-ubuntu:~$ cd tegra_multimedia_api/samples/00_video_decode/
ubuntu@tegra-ubuntu:~/tegra_multimedia_api/samples/00_video_decode$ ./video_decode ~/GOP_III.h264 H264
Set governor to performance before enabling profiler
Failed to query video capabilities: Bad address
NvMMLiteOpen : Block : BlockType = 261
TVMR: NvMMLiteTVMRDecBlockOpen: 7580: NvMMLiteBlockOpen
NvMMLiteBlockCreate : Block : BlockType = 261
Failed to query video capabilities: Bad address
Starting decoder capture loop thread
TVMR: cbBeginSequence: 1166: BeginSequence  720x576, bVPR = 0, fFrameRate = 25.000000
TVMR: LowCorner Frequency = 0
TVMR: cbBeginSequence: 1545: DecodeBuffers = 17, pnvsi->eCodec = 4, codec = 0
TVMR: cbBeginSequence: 1606: Display Resolution : (720x576)
TVMR: cbBeginSequence: 1607: Display Aspect Ratio : (785x576)
TVMR: cbBeginSequence: 1649: ColorFormat : 5
TVMR: cbBeginSequence:1663 ColorSpace = NvColorSpace_YCbCr601
TVMR: cbBeginSequence: 1790: SurfaceLayout = 3
TVMR: cbBeginSequence: 1868: NumOfSurfaces = 18, InteraceStream = 1, InterlaceEnabled = 0, bSecure = 0, MVC = 0 Semiplanar = 1, bReinit = 1, BitDepthForSurface = 8 LumaBitDepth = 8, ChromaBitDepth = 8, ChromaFormat = 5
Video Resolution: 720x576
libv4l2_nvvidconv (0):(765) (INFO) : Allocating (10) OUTPUT PLANE BUFFERS Layout=1
libv4l2_nvvidconv (0):(775) (INFO) : Allocating (10) CAPTURE PLANE BUFFERS Layout=0
Query and set capture successful
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: NvMMLiteTVMRDecDoWork: 6466: NVMMLITE_TVMR: EOS detected
Input file read complete
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: FrameRate = 25.000000
TVMR: TVMRBufferProcessing: 5444: Processing of EOS
TVMR: TVMRBufferProcessing: 5519: Processing of EOS Done
Exiting decoder capture loop thread
TVMR: TVMRFrameStatusReporting: 6067: Closing TVMR Frame Status Thread -------------
TVMR: TVMRVPRFloorSizeSettingThread: 5885: Closing TVMRVPRFloorSizeSettingThread -------------
TVMR: TVMRFrameDelivery: 5917: Closing TVMR Frame Delivery Thread -------------
TVMR: NvMMLiteTVMRDecBlockClose: 7740: Done
App run was successful
ubuntu@tegra-ubuntu:~/tegra_multimedia_api/samples/00_video_decode$

Please refer to the sample code and check your app.

Now I’am testing!!!

Hi.

Does gstreamer support directly deinterlace video input from CSI-2 port?

TX1 seem not support deinterlace and so we have to deinterlace by our own software.

Hi,

We do not support it.