-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render nv12 issues #16
Comments
I've just tried your code: |
Sorry, made an update - there was an issue. |
Yes, yv12 is normal, thank you very much. |
Is the data after hard decoding is nv21? and I tried H. 265 video(HEVC format). Why not support hard decoding? I tried Win7 and Win10 and they weren't working, but not enough dxva2_mode. |
Just made some updates for H.265 stuff, probably it is fixed now: |
BTW here is a portable player prototype: |
Hello, can I use a simple SDL player to play nv12 data without hard decoding nv12, why use USE_HWACCEL hard decoding to convert to nv12, SDL playing rendering is not normal. My code is as follows:
#include <stdio.h>
#include "windows.h"
#include "ffmpeg_dxva2.h"
#define __STDC_CONSTANT_MACROS
extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
#include "libavdevice/avdevice.h"
#include "libavutil/avutil.h"
#include "libavutil/imgutils.h"
#include "libavfilter/avfilter.h"
#include "SDL/SDL.h"
};
#define USE_HWACCEL 0
static FILE *output_file = NULL;
int main(int argc, char* argv[])
{
AVFormatContext *pFormatCtx;
int i, videoindex;
AVCodecContext *pCodecCtx;
AVCodec *pCodec;
AVFrame *pFrame,pFrameTarget;
AVFramesw_frame = NULL;
uint8_t *out_buffer;
AVPacket *packet;
int y_size;
int ret, got_picture;
struct SwsContext *img_convert_ctx = nullptr;
#if USE_HWACCEL
////Add HwAccel
InputStream *ist = new InputStream();
ist->hwaccel_id = HWACCEL_AUTO;
ist->hwaccel_device = "dxva2";
ist->dec = pCodec;
ist->dec_ctx = pCodecCtx;
#else
pCodecCtx->opaque = nullptr;
pCodecCtx->thread_count = 2;
pCodecCtx->flags2 |= AV_CODEC_FLAG2_FAST;
#endif // USE_HWACCEL
if(avcodec_open2(pCodecCtx, pCodec,NULL)<0){
printf("Could not open codec.\n");
return -1;
}
}
The text was updated successfully, but these errors were encountered: