How to use Video SDK

Dear Sir,

I am using Video Codec SDK to develop application to decode video from RTSP stream.

My application is similar to AppDec in your examples, exception that the input stream is from RTSP.

FFmpegDemuxer has been established successful and received video data, but when I transfer video data to NvDecode I do not get any decoded frame return. Is there any mistake in my steps?

Thanks for your support.

Is AppDec working find at your end for normal decoding?

Dear Sir,

At the moment I can’t resolved my problem. I have run AppDec with input from file, but the output file have no decoded frame. Is there any conflict between library of cuda and video SDK?

My develop enviroment as below:

  • Ubuntu 16.04
  • Cuda-9.2
  • CuDNN 7.4
  • Video SDK 8.2

Thanks for your help!

Dear Sir,

I can not resolve my problem with AppDec when the input source is rtsp.
And I have another question about NvEncode.

In my application, I have to switch video output file to new one, when the size of output file has reached the specific value (ex 3M).
And I don’t want to release cuda resources, only reset to Encoder to beginning state. How can I do it?

THanks & Brgs,
TungTH

Comment below code using rtsp for input source
//CheckInputFile(szInFilePath);

Hi,

I have done as you recommended before. But when I call decode function, its doesn’t return any decoded frame.

Brgs,
TungTH

  1. your rtsp stream is right?

  2. I just start like this:

./AppDec
-i rtsp://admin:Abcd1234@192.167.2.222:554
-o out.yuv
-resize 1920x1080

replay video file:

ffplay -f rawvideo -video_size 1920x1080 out.yuv

Hi,

I answer your question as follow:

  1. My RTSP Stream is right. I have used FFmpegDemuxer + libavcodec (with hardware accl) to decode my RTSP stream and the result is OK

  2. I have used AppDec as you recommend and the result as below:
    ./AppDec -i rtsp://root:xxxx@xxxx/axis-media/media.amp -o out.yuv -resize 1920x1080
    GPU in use: GeForce GTX 1050 Ti
    Decode with demuxing.
    [INFO ][13:55:36] Media format: RTSP input (rtsp)
    [rtsp @ 0x1bfb880] UDP timeout, retrying with TCP
    [INFO ][13:55:48] Demux video result: 429891
    [INFO ][13:55:48] Demux video result: 67373
    [INFO ][13:55:48] Demux video result: 77933
    [INFO ][13:55:48] Demux video result: 61037
    [INFO ][13:55:48] Demux video result: 71685
    [INFO ][13:55:48] Demux video result: 68049
    [INFO ][13:55:48] Demux video result: 57717
    [INFO ][13:55:48] Demux video result: 67309
    [INFO ][13:55:48] Demux video result: 72753
    [INFO ][13:55:48] Demux video result: 62245
    [INFO ][13:55:48] Demux video result: 73657
    [INFO ][13:55:48] Demux video result: 72329
    [INFO ][13:55:48] Demux video result: 59233
    [INFO ][13:55:48] Demux video result: 67717
    [INFO ][13:55:48] Demux video result: 69017
    [INFO ][13:55:48] Demux video result: 59353
    [INFO ][13:55:48] Demux video result: 71077
    [INFO ][13:55:48] Demux video result: 70881
    [INFO ][13:55:48] Demux video result: 58961
    [INFO ][13:55:48] Demux video result: 67973
    [INFO ][13:55:48] Demux video result: 65617
    [INFO ][13:55:48] Demux video result: 57313
    [INFO ][13:55:48] Demux video result: 68893
    [INFO ][13:55:48] Demux video result: 71277
    [INFO ][13:55:48] Demux video result: 60869
    [INFO ][13:55:48] Demux video result: 71417
    [INFO ][13:55:48] Demux video result: 68641
    [INFO ][13:55:48] Demux video result: 56569
    [INFO ][13:55:48] Demux video result: 67489
    [INFO ][13:55:48] Demux video result: 70653
    [INFO ][13:55:48] Demux video result: 60437
    [INFO ][13:55:48] Demux video result: 72121
    [INFO ][13:55:49] Demux video result: 419093
    [INFO ][13:55:49] Demux video result: 52985
    [INFO ][13:55:49] Demux video result: 66197
    [INFO ][13:55:49] Demux video result: 72481
    [INFO ][13:55:49] Demux video result: 63533
    [INFO ][13:55:49] Demux video result: 78789
    [INFO ][13:55:49] Demux video result: 77877
    [INFO ][13:55:49] Demux video result: 63281
    [INFO ][13:55:49] Demux video result: 73557
    [INFO ][13:55:49] Demux video result: 72709
    [INFO ][13:55:49] Demux video result: 61913
    [INFO ][13:55:49] Demux video result: 80273
    [INFO ][13:55:50] Demux video result: 80465
    [INFO ][13:55:50] Demux video result: 66181
    [INFO ][13:55:50] Demux video result: 75841
    [INFO ][13:55:50] Demux video result: 72269
    [INFO ][13:55:50] Demux video result: 60101
    [INFO ][13:55:50] Demux video result: 71361
    [INFO ][13:55:50] Demux video result: 74477
    [INFO ][13:55:50] Demux video result: 62785
    [INFO ][13:55:50] Demux video result: 72869
    [INFO ][13:55:50] Demux video result: 68977
    [INFO ][13:55:50] Demux video result: 57801
    [INFO ][13:55:50] Demux video result: 68033
    [INFO ][13:55:50] Demux video result: 69965
    [INFO ][13:55:50] Demux video result: 59509
    [INFO ][13:55:50] Demux video result: 72505
    [INFO ][13:55:50] Demux video result: 73193
    [INFO ][13:55:50] Demux video result: 61145
    [INFO ][13:55:51] Demux video result: 69645
    [INFO ][13:55:51] Demux video result: 71153
    [INFO ][13:55:51] Demux video result: 62173
    [INFO ][13:55:51] Demux video result: 421997
    [INFO ][13:55:51] Demux video result: 72761
    [INFO ][13:55:51] Demux video result: 61637
    [INFO ][13:55:51] Demux video result: 76817
    [INFO ][13:55:51] Demux video result: 75789
    [INFO ][13:55:51] Demux video result: 63777
    [INFO ][13:55:51] Demux video result: 79389

It’s demuxed OK, but nFrameReturned when call function dec.Decode(pVideo, nVideoBytes, &ppFrame, &nFrameReturned) is 0. So none video frame is writen to file

Thanks for your consideration

Brgs,
TungTH

You can comment one line or write in the loop:

// if (!nFrame && nFrameReturned)
LOG(INFO) << dec.GetVideoInfo();

for get more decoder info.

I have done as you recommended, but the result is empty :(

do {
demuxer.Demux(&pVideo, &nVideoBytes);
LOG(INFO) << "Demux video result: " << nVideoBytes;
dec.Decode(pVideo, nVideoBytes, &ppFrame, &nFrameReturned);
//if (!nFrame && nFrameReturned)
LOG(INFO) << dec.GetVideoInfo();

    for (int i = 0; i < nFrameReturned; i++) {
        if (bOutPlanar) {
            ConvertToPlanar(ppFrame[i], dec.GetWidth(), dec.GetHeight(), dec.GetBitDepth());
        }
        fpOut.write(reinterpret_cast<char*>(ppFrame[i]), dec.GetFrameSize());
    }
    nFrame += nFrameReturned;
} while (nVideoBytes);

The result:
GPU in use: GeForce GTX 1050 Ti
Decode with demuxing.
[INFO ][16:04:18] Media format: RTSP input (rtsp)
[rtsp @ 0x146e800] UDP timeout, retrying with TCP
[INFO ][16:04:31] Demux video result: 406681
[INFO ][16:04:31]
[INFO ][16:04:31] Demux video result: 66917
[INFO ][16:04:31]
[INFO ][16:04:31] Demux video result: 69877
[INFO ][16:04:31]
[INFO ][16:04:31] Demux video result: 53517
[INFO ][16:04:31]
[INFO ][16:04:31] Demux video result: 64557
[INFO ][16:04:31]
[INFO ][16:04:31] Demux video result: 71429
[INFO ][16:04:31]
[INFO ][16:04:31] Demux video result: 58065
[INFO ][16:04:31]

Sorry, i can’t help more.

Hi All,

I have been debugged AppDec application with my RTSP Streaming and I saw that, its not calling HandleVideoSequence function to create decoder.

Does anyone can have me to resolved my problem.

Thanks,
TUngTH