Open w136111526 opened 5 years ago
I've just tried your code: https://github.com/aliakseis/SDL-example Seems to be working fine with small changes so far. However the SDL frame transfer functionality does not seem to be efficient, probably some tweaking is required.
Sorry, made an update - there was an issue. It seems to me that yv12 matches decoding needs better than nv12.
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: http://jell.yfish.us/
BTW here is a portable player prototype: https://github.com/aliakseis/FFmpegPlayer/tree/master/QtPlayer
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
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
else
endif // USE_HWACCEL
}