dusty-nv / jetson-inference

Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson.
https://developer.nvidia.com/embedded/twodaystoademo
MIT License
7.85k stars 2.98k forks source link

8k (6240*4160 resolution) .mp4 file and use videoSource::Create() failed #1468

Closed pcb9382 closed 1 year ago

pcb9382 commented 2 years ago

I now have an 8k (62404160 resolution) .mp4 file and use videoSource::Create() for NVDEC accelerated decoding, `videoSource inputStream; videoOutput* outputStream; if(argc>1) { commandLine cmdLine(argc, argv); inputStream = videoSource::Create(cmdLine,ARG_POSITION(0)); outputStream= videoOutput::Create(cmdLine,ARG_POSITION(0)); } else { argc=7; argv[0]=""; argv[1]="--input-width=7680"; argv[2]="--input-height=4320"; argv[3]="--input-codec=h264"; argv[4]="--input-rtsp-latency=10000"; argv[5]="--input-rate=15"; //argv[5]="rtsp://admin:ADMIN123456@192.168.1.64:554"; argv[6]="file:///home/pcb/test/vlc.mp4"; commandLine cmdLine(argc, argv); inputStream = videoSource::Create(cmdLine,ARG_POSITION(0)); outputStream= videoOutput::Create("1234.avi"); }

// create input/output streams
//videoSource* inputStream = videoSource::Create(argc, argv, ARG_POSITION(0));
//videoSource* inputStream = videoSource::Create("v4l2:///dev/video0");
//videoSource* inputStream = videoSource::Create("rtsp://admin:ADMIN123456@192.168.1.64:554");

if( !inputStream )
    return 0;

// capture/display loop
int i=0;
//void *nextFrame = NULL;

while( true )
{
    uchar3* nextFrame = NULL;  // can be uchar3, uchar4, float3, float4
    uchar3* nextFrame1 = NULL;
    auto start = std::chrono::system_clock::now();
    if( !inputStream->Capture(&nextFrame,1000) )
        continue;
    if( !cudaAllocMapped(&nextFrame1, inputStream->GetWidth(), inputStream->GetHeight()) )
        return false;
    cudaConvertColor(nextFrame, IMAGE_RGB8,nextFrame1, IMAGE_BGR8, inputStream->GetWidth(), inputStream->GetHeight());
    auto end = std::chrono::system_clock::now();
    std::cout << "inference time: " << std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << "ms" << std::endl;
    if( outputStream != NULL )
    {
        auto start1 = std::chrono::system_clock::now();
        cv::Mat image(inputStream->GetHeight(),inputStream->GetWidth(),CV_8UC3,nextFrame1);
        auto end1 = std::chrono::system_clock::now();
        std::cout << "convert time: " << std::chrono::duration_cast<std::chrono::milliseconds>(end1 - start1).count() << "ms" << std::endl;
        //outputStream->Render(nextFrame, inputStream->GetWidth(), inputStream->GetHeight());
        //cv::imshow("123",image);
        //cv::waitKey(1);
        // update status bar
        //char str[256];
        std::cout<<i<<"Video View,width:"<<inputStream->GetWidth()<<" heigth:"<<inputStream->GetHeight()<<" Rate"<<outputStream->GetFrameRate()<<std::endl;
        i++;
        //sprintf(str, "Video Viewer (%ux%u) | %.1f FPS", inputStream->GetWidth(), inputStream->GetHeight(), outputStream->GetFrameRate());
        //outputStream->SetStatus(str); 

        // check if the user quit
        //if( !outputStream->IsStreaming() )
        //  break;
    }
    CUDA(cudaFreeHost(nextFrame1));
    if( !inputStream->IsStreaming() )
        break;
}`

but the following error occurs: [gstreamer] initialized gstreamer, version 1.14.5.0 [gstreamer] gstDecoder -- creating decoder for /home/pcb/test/vlc.mp4 Opening in BLOCKING MODE

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:45.172: gst_caps_is_empty: assertion 'GST_IS_CAPS (caps)' failed

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:45.172: gst_caps_truncate: assertion 'GST_IS_CAPS (caps)' failed

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:45.172: gst_caps_fixate: assertion 'GST_IS_CAPS (caps)' failed

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:45.172: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:45.172: gst_structure_get_string: assertion 'structure != NULL' failed

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:45.173: gst_mini_object_unref: assertion 'mini_object != NULL' failed NvMMLiteOpen : Block : BlockType = 261 NVMEDIA: Reading vendor.tegra.display-size : status: 6 NvMMLiteBlockCreate : Block : BlockType = 261 [gstreamer] gstDecoder -- failed to discover stream info [gstreamer] gstDecoder -- pipeline string: [gstreamer] filesrc location=/home/pcb/test/vlc.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! nvvidconv ! video/x-raw(memory:NVMM), width=(int)7680, height=(int)4320, format=(string)NV12 ! videorate drop-only=true max-rate=15 ! appsink name=mysink [video] created gstDecoder from file:///home/pcb/test/vlc.mp4

gstDecoder video options:

-- URI: file:///home/pcb/test/vlc.mp4

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:46.003: gst_caps_is_empty: assertion 'GST_IS_CAPS (caps)' failed

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:46.014: gst_caps_truncate: assertion 'GST_IS_CAPS (caps)' failed

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:46.015: gst_caps_fixate: assertion 'GST_IS_CAPS (caps)' failed

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:46.015: gst_caps_get_structure: assertion 'GST_IS_CAPS (caps)' failed

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:46.016: gst_structure_get_string: assertion 'structure != NULL' failed

(rt_test.out:26598): GStreamer-CRITICAL **: 11:02:46.017: gst_mini_object_unref: assertion 'mini_object != NULL' failed NvMMLiteOpen : Block : BlockType = 261 NVMEDIA: Reading vendor.tegra.display-size : status: 6 NvMMLiteBlockCreate : Block : BlockType = 261 [gstreamer] gstreamer message stream-start ==> pipeline0 [gstreamer] gstreamer stream status CREATE ==> src [gstreamer] gstreamer stream status ENTER ==> src [gstreamer] gstreamer message duration-changed ==> h264parse1 [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [gstreamer] gstDecoder -- failed to retrieve next image buffer [1] + Done "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-dxdu410x.i0h" 1>"/tmp/Microsoft-MIEngine-Out-piuyumdh.ivv"

Do you have an idea to solve my problem? I thank you in advance,thanks!

dusty-nv commented 2 years ago

Hi @pcb9382, which Jetson are you using? Have you confirmed in it's module datasheet that it supports 8K decode?

Have you tried a standalone gstreamer pipeline with gst-launch-1.0 that works for decode on your video?