Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
7th May 2015, 10:17 | #1 | Link |
Registered User
Join Date: Oct 2014
Posts: 43
|
How to use GPU decoding 264 stream, any open source code?
hello,every dear friend!
I want to use GPU to decode 264 stream encoded by x264 library, I wonder if there is any open source code for GPU decoding 264 stream? Any idea? Thank you very much! Best regards |
7th May 2015, 19:31 | #3 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,251
|
The so-called "GPU decoding" almost always does not actually run on the GPU, but uses a dedicated hardware H.264 decoder (i.e. a separate piece of silicon) that just happens to be integrated with the GPU. This has the important consequence that you do not need to write your own GPU shader/kernel code for H.264 decoding (e.g. via CUDA or OpenCL), since the "programmable" part of the GPU is not even used. Instead, you just use the "hardwired" H.264 decoding routines that already are burnt into the silicon. And you can use the hardware H.264 decoder via standard programming interfaces, such as DXVA, CUVID or VDPAU. So it's the DXVA, CUVID or VDPAU SDK that you need to look into for code samples, I suppose...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 7th May 2015 at 21:19. |
24th May 2015, 10:46 | #4 | Link | |
Registered User
Join Date: Oct 2014
Posts: 43
|
Quote:
Now I wonder if I can decode 8bit/10bit 264 encoded data by "NVIDIA VIDEO CODEC SDK" as shown below link, would you please give me some great advices? Thank you very much! https://developer.nvidia.com/nvidia-video-codec-sdk |
|
24th May 2015, 11:37 | #5 | Link | |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,368
|
Quote:
Decoding is done through NVCUVID, which is part of the CUDA Toolkit
__________________
LAV Filters - open source ffmpeg based media splitter and decoders |
|
26th May 2015, 08:20 | #6 | Link | |
Registered User
Join Date: Oct 2014
Posts: 43
|
Quote:
Thank you very much! |
|
26th May 2015, 08:50 | #7 | Link |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,368
|
Only 8-bit, 10-bit decoding for H264 is not supported by hardware.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders |
27th May 2015, 22:27 | #9 | Link |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,425
|
LAV Filters is a finished implementation of NVCUVID through CUDA Toolkit, it is well tested so if all you need is a direct show filter to implement CUVID, LAV is already available.
LAV also has DXVA2 support, so it works on AMD or Intel GPUs as well. It also has software decoding to fall back to if the format is not compatible with hardware decoding. Better depends on what you want it to do and how you are implementing it. If you want CUVID decoding integrated into your own application and don't care about DXVA2 or software decoding using the CUDA Toolkit will give you more control but would be more work.
__________________
madVR options explained |
28th May 2015, 08:06 | #11 | Link | |
Registered User
Join Date: Oct 2014
Posts: 43
|
Quote:
Thank you! |
|
28th May 2015, 12:26 | #12 | Link |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,425
|
Yes, but remember CUDA is Nvidia only.
__________________
madVR options explained |
2nd June 2015, 11:19 | #13 | Link |
Registered User
Join Date: Oct 2014
Posts: 43
|
hi, now I want to use the GTX980 to decode 264, then there is a decoding sample named cudaDecodeGL in CUDA samples, there is no error when making.
When I ran cudaDecodeGL, the error showed below, why is it, would you please give me some advices? Thank you very much! > Device 0: < GeForce GTX 980 >, Compute SM 5.2 detected >> initGL() creating window [1280 x 720] MapSMtoCores for SM 5.2 is undefined. Default to use 128 Cores/SM > Using CUDA/GL Device [0]: GeForce GTX 980 > Using GPU Device: GeForce GTX 980 has SM 5.2 compute capability Total amount of global memory: 4095.3125 MB >> modInitCTX<NV12ToARGB_drvapi64.ptx > initialized OK >> modGetCudaFunction< CUDA file: NV12ToARGB_drvapi64.ptx > CUDA Kernel Function (0x027f5940) = < NV12ToARGB_drvapi > >> modGetCudaFunction< CUDA file: NV12ToARGB_drvapi64.ptx > CUDA Kernel Function (0x027f3050) = < Passthru_drvapi > cuvidCtxLockCreate failed: 100 cudaDecodeGL: videoDecodeGL.cpp:1039: void initCudaVideo(): Assertion `0' failed. Aborted (core dumped) // and the function source code is below void initCudaVideo() { // bind the context lock to the CUDA context CUresult result = cuvidCtxLockCreate(&g_CtxLock, g_oContext); if (result != CUDA_SUCCESS) { printf("cuvidCtxLockCreate failed: %d\n", result); assert(0); } size_t totalGlobalMem; size_t freeMem; cuMemGetInfo(&freeMem,&totalGlobalMem); printf(" Free memory: %4.4f MB\n", (float)freeMem/(1024*1024)); std::auto_ptr<VideoDecoder> apVideoDecoder(new VideoDecoder(g_pVideoSource->format(), g_oContext, g_eVideoCreateFlags, g_CtxLock)); std::auto_ptr<VideoParser> apVideoParser(new VideoParser(apVideoDecoder.get(), g_pFrameQueue, &g_oContext)); g_pVideoSource->setParser(*apVideoParser.get()); g_pVideoParser = apVideoParser.release(); g_pVideoDecoder = apVideoDecoder.release(); // Create a Stream ID for handling Readback if (g_bReadback) { checkCudaErrors(cuStreamCreate(&g_ReadbackSID, 0)); checkCudaErrors(cuStreamCreate(&g_KernelSID, 0)); printf(">> initCudaVideo()\n"); printf(" CUDA Streams (%s) <g_ReadbackSID = %p>\n", ((g_ReadbackSID == 0) ? "Disabled" : "Enabled"), g_ReadbackSID); printf(" CUDA Streams (%s) <g_KernelSID = %p>\n", ((g_KernelSID == 0) ? "Disabled" : "Enabled"), g_KernelSID); } } |
3rd June 2015, 10:10 | #15 | Link | |
Registered User
Join Date: Oct 2014
Posts: 43
|
Quote:
Ubuntu 14.04.2 LTS CUDA 6.5 nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2011 NVIDIA Corporation Built on Thu_Jan_12_14:41:45_PST_2012 Cuda compilation tools, release 4.1, V0.2.1221 NVIDIA Driver Version:346.35 And I am running in the local machine not remote way. Maybe CUDA version is too old for GeForce GTX 980 ? Need your advices again! Thank you very much! |
|
3rd June 2015, 15:12 | #16 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
Toolkit 6.5 should be fine.
I don't do linux so can't help you directly, but I found this following link where a guy has the same problem and gets a working solution. https://devtalk.nvidia.com/default/t...pu-undetected/ Surely worth a try. |
4th June 2015, 10:11 | #17 | Link | |
Registered User
Join Date: Oct 2014
Posts: 43
|
Quote:
|
|
Tags |
264, decoding, gpu |
Thread Tools | Search this Thread |
Display Modes | |
|
|