libav: where to get a reference to AV_PIX_FMT_NV12 when using cuda/cuvid?What are the differences and similarities between ffmpeg, libav, and avconv?libav/ffmpeg: avcodec_decode_video2() returns -1 when separating demultiplexing and decodingRGB-frame encoding - FFmpeg/libavConverting RGB frames to YUV420P using FFmpeg/C++Transcode of H.264 to VP8 using libav* has incorrect frame rateData loss while converting from jpeg to BGRA using ffmpegFFMPEG API — How much do stream parameters change frame-to-frame?Saving raw YUV420P frame FFmpeg/LibavLibav (ffmpeg) copying decoded video timestamps to encoderLibAV converting a streaming audio file to PCM

LINQ Extension methods MinBy and MaxBy

Where should I draw the line on follow up questions from previous employer

How to query field names from custom object by data type?

Break down the phrase "shitsurei shinakereba naranaindesu"

Questions about Noun+が+Adjective

What is this "opened" cube called?

Why haven't the British protested Brexit as ardently as the Hong Kong protesters?

Large molecule dataset

Can authors email you PDFs of their textbook for free?

Colored grid with coordinates on all sides?

How do I get my neighbour to stop disturbing with loud music?

Create a list of snaking numbers under 50,000

Sum and average calculator

Divide Numbers by 0

Given a specific computer system, is it possible to estimate the actual precise run time of a piece of Assembly code

When you have to wait for a short time

Ways you can end up paying interest on a credit card if you pay the full amount back in due time

How can I store milk for long periods of time?

Can I leave a large suitcase at TPE during a 4-hour layover, and pick it up 4.5 days later when I come back to TPE on my way to Taipei downtown?

Should a TA point out a professor's mistake while attending their lecture?

Is Borg adaptation only temporary?

How smart contract transactions work?

How to load files as a quickfix window at start-up

Can two aircraft be allowed to stay on the same runway at the same time?



libav: where to get a reference to AV_PIX_FMT_NV12 when using cuda/cuvid?


What are the differences and similarities between ffmpeg, libav, and avconv?libav/ffmpeg: avcodec_decode_video2() returns -1 when separating demultiplexing and decodingRGB-frame encoding - FFmpeg/libavConverting RGB frames to YUV420P using FFmpeg/C++Transcode of H.264 to VP8 using libav* has incorrect frame rateData loss while converting from jpeg to BGRA using ffmpegFFMPEG API — How much do stream parameters change frame-to-frame?Saving raw YUV420P frame FFmpeg/LibavLibav (ffmpeg) copying decoded video timestamps to encoderLibAV converting a streaming audio file to PCM






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Say I'm using av_hwdevice_find_type_by_name("cuda"), as in here. I need to convert the decoded frames to RGB using a SwsContext. I know, by experience, that when using the cuda/cuvid decoder I get frames in the AV_PIX_FMT_NV12 format, even though every struct I look at says either AV_PIX_FMT_NONE or AV_PIX_FMT_YUV420P.



On what field of what struct can I get the AV_PIX_FMT_NV12 value so I can remove my hardcoded source format on my call to SwsContext.sws_scale? Thanks!



Update:



Looks like I can get it by:



AVCodecContext* avctx;
...
frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
AVPixelFormat pixel_fmt = frames_ctx->sw_format;


...once at least one frame has been decoded. Not sure if it's the correct way though.










share|improve this question
































    0















    Say I'm using av_hwdevice_find_type_by_name("cuda"), as in here. I need to convert the decoded frames to RGB using a SwsContext. I know, by experience, that when using the cuda/cuvid decoder I get frames in the AV_PIX_FMT_NV12 format, even though every struct I look at says either AV_PIX_FMT_NONE or AV_PIX_FMT_YUV420P.



    On what field of what struct can I get the AV_PIX_FMT_NV12 value so I can remove my hardcoded source format on my call to SwsContext.sws_scale? Thanks!



    Update:



    Looks like I can get it by:



    AVCodecContext* avctx;
    ...
    frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
    AVPixelFormat pixel_fmt = frames_ctx->sw_format;


    ...once at least one frame has been decoded. Not sure if it's the correct way though.










    share|improve this question




























      0












      0








      0


      0






      Say I'm using av_hwdevice_find_type_by_name("cuda"), as in here. I need to convert the decoded frames to RGB using a SwsContext. I know, by experience, that when using the cuda/cuvid decoder I get frames in the AV_PIX_FMT_NV12 format, even though every struct I look at says either AV_PIX_FMT_NONE or AV_PIX_FMT_YUV420P.



      On what field of what struct can I get the AV_PIX_FMT_NV12 value so I can remove my hardcoded source format on my call to SwsContext.sws_scale? Thanks!



      Update:



      Looks like I can get it by:



      AVCodecContext* avctx;
      ...
      frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
      AVPixelFormat pixel_fmt = frames_ctx->sw_format;


      ...once at least one frame has been decoded. Not sure if it's the correct way though.










      share|improve this question
















      Say I'm using av_hwdevice_find_type_by_name("cuda"), as in here. I need to convert the decoded frames to RGB using a SwsContext. I know, by experience, that when using the cuda/cuvid decoder I get frames in the AV_PIX_FMT_NV12 format, even though every struct I look at says either AV_PIX_FMT_NONE or AV_PIX_FMT_YUV420P.



      On what field of what struct can I get the AV_PIX_FMT_NV12 value so I can remove my hardcoded source format on my call to SwsContext.sws_scale? Thanks!



      Update:



      Looks like I can get it by:



      AVCodecContext* avctx;
      ...
      frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
      AVPixelFormat pixel_fmt = frames_ctx->sw_format;


      ...once at least one frame has been decoded. Not sure if it's the correct way though.







      ffmpeg libav






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 at 0:11







      Simon Labrecque

















      asked Mar 27 at 21:30









      Simon LabrecqueSimon Labrecque

      4176 silver badges11 bronze badges




      4176 silver badges11 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0















          As for CUDA, your best bet will be when see AV_PIX_FMT_YUV420P on AVHWFramesContext::sw_format consider it as AV_PIX_FMT_NV12 and when AV_PIX_FMT_YUV420P10 it is actually AV_PIX_FMT_P010.



          As far as I know, neither CUDA nor NVDEC(was CUVID) support anything other than 420 format as decoded frames.






          share|improve this answer

























          • That's basically what I'm already doing and what I want to avoid (eg, assuming something based on prior knowledge). But see my update above, I can actually get the AV_PIX_FMT_NV12 at runtime now. Just wondering if it's the correct/universal way.

            – Simon Labrecque
            Mar 29 at 18:33











          • Perhaps after decoding, what you did is correct way. I was assuming before decoding.

            – the kamilz
            Apr 1 at 7:11










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55386758%2flibav-where-to-get-a-reference-to-av-pix-fmt-nv12-when-using-cuda-cuvid%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0















          As for CUDA, your best bet will be when see AV_PIX_FMT_YUV420P on AVHWFramesContext::sw_format consider it as AV_PIX_FMT_NV12 and when AV_PIX_FMT_YUV420P10 it is actually AV_PIX_FMT_P010.



          As far as I know, neither CUDA nor NVDEC(was CUVID) support anything other than 420 format as decoded frames.






          share|improve this answer

























          • That's basically what I'm already doing and what I want to avoid (eg, assuming something based on prior knowledge). But see my update above, I can actually get the AV_PIX_FMT_NV12 at runtime now. Just wondering if it's the correct/universal way.

            – Simon Labrecque
            Mar 29 at 18:33











          • Perhaps after decoding, what you did is correct way. I was assuming before decoding.

            – the kamilz
            Apr 1 at 7:11















          0















          As for CUDA, your best bet will be when see AV_PIX_FMT_YUV420P on AVHWFramesContext::sw_format consider it as AV_PIX_FMT_NV12 and when AV_PIX_FMT_YUV420P10 it is actually AV_PIX_FMT_P010.



          As far as I know, neither CUDA nor NVDEC(was CUVID) support anything other than 420 format as decoded frames.






          share|improve this answer

























          • That's basically what I'm already doing and what I want to avoid (eg, assuming something based on prior knowledge). But see my update above, I can actually get the AV_PIX_FMT_NV12 at runtime now. Just wondering if it's the correct/universal way.

            – Simon Labrecque
            Mar 29 at 18:33











          • Perhaps after decoding, what you did is correct way. I was assuming before decoding.

            – the kamilz
            Apr 1 at 7:11













          0














          0










          0









          As for CUDA, your best bet will be when see AV_PIX_FMT_YUV420P on AVHWFramesContext::sw_format consider it as AV_PIX_FMT_NV12 and when AV_PIX_FMT_YUV420P10 it is actually AV_PIX_FMT_P010.



          As far as I know, neither CUDA nor NVDEC(was CUVID) support anything other than 420 format as decoded frames.






          share|improve this answer













          As for CUDA, your best bet will be when see AV_PIX_FMT_YUV420P on AVHWFramesContext::sw_format consider it as AV_PIX_FMT_NV12 and when AV_PIX_FMT_YUV420P10 it is actually AV_PIX_FMT_P010.



          As far as I know, neither CUDA nor NVDEC(was CUVID) support anything other than 420 format as decoded frames.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 29 at 13:48









          the kamilzthe kamilz

          9121 gold badge8 silver badges13 bronze badges




          9121 gold badge8 silver badges13 bronze badges















          • That's basically what I'm already doing and what I want to avoid (eg, assuming something based on prior knowledge). But see my update above, I can actually get the AV_PIX_FMT_NV12 at runtime now. Just wondering if it's the correct/universal way.

            – Simon Labrecque
            Mar 29 at 18:33











          • Perhaps after decoding, what you did is correct way. I was assuming before decoding.

            – the kamilz
            Apr 1 at 7:11

















          • That's basically what I'm already doing and what I want to avoid (eg, assuming something based on prior knowledge). But see my update above, I can actually get the AV_PIX_FMT_NV12 at runtime now. Just wondering if it's the correct/universal way.

            – Simon Labrecque
            Mar 29 at 18:33











          • Perhaps after decoding, what you did is correct way. I was assuming before decoding.

            – the kamilz
            Apr 1 at 7:11
















          That's basically what I'm already doing and what I want to avoid (eg, assuming something based on prior knowledge). But see my update above, I can actually get the AV_PIX_FMT_NV12 at runtime now. Just wondering if it's the correct/universal way.

          – Simon Labrecque
          Mar 29 at 18:33





          That's basically what I'm already doing and what I want to avoid (eg, assuming something based on prior knowledge). But see my update above, I can actually get the AV_PIX_FMT_NV12 at runtime now. Just wondering if it's the correct/universal way.

          – Simon Labrecque
          Mar 29 at 18:33













          Perhaps after decoding, what you did is correct way. I was assuming before decoding.

          – the kamilz
          Apr 1 at 7:11





          Perhaps after decoding, what you did is correct way. I was assuming before decoding.

          – the kamilz
          Apr 1 at 7:11








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55386758%2flibav-where-to-get-a-reference-to-av-pix-fmt-nv12-when-using-cuda-cuvid%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현