FFmpeg+SDL+Qt builds a simple video player

This article mainly describes how to use FFmpeg, SDL, and Qt to build a simple video player. FFmpeg is an open source library for audio and video processing. It provides a C interface for audio and video encoding, decoding, encapsulation, and stream processing. In this tutorial, FFmpeg is mainly used to decapsulate and decode video […]

C# .Net6 specifies WSDL, generates Webservice, and calls the interface service

C# .Net6 specifies WSDL and calls this interface service. IDE: Microsoft Visual Studio Community 2022 (64-bit) Platform: .Net6 Protocol: Soap protocol Xml format Function A front-end computer program needs to be developed to interact with the hardware program. The known conditions are: the embedded colleague provides another agreed *.wsdl file as the Webservice interface protocol […]

SDL2 draws mp4 files parsed by ffmpeg

Article directory 1.FFMPEG uses the command line to convert mp4 to yuv420 2.ffmpeg parses mp4 into yuv data 2.1 Core API: 3.SDL2 performs yuv drawing to the screen 3.1 Core API 4. Complete code 5. Effect display 6.SDL2 incident response supplement 6.1 Processing method-01 6.2 Processing method-02 This project adopts the producer-consumer model. The producer […]

SDL rendering video files

Related functions include header files #include<SDL.h> related functions Initialize SDL //Initialize SDL SDL_Init(SDL_INIT_VIDEO); //Exit SDL SDL_Quit(); Two ways to create a window //Create a window, specify some properties of the window, and return the window handle SDL_CreateWindow(title,x,y,w,h,SDL_WINDOW_SHOWN|SDL_WINDOW_BORDER); //Create a window from an existing window SDL_CreateWindowForm(hwnd); So far the window has been created but will not […]

Video playback library based on ffmpeg and SDL

Due to work needs, the self-encapsulated ffmpeg-based video codec library shows that the SDL library is used. Can play local files or network streams, support multi-port playback, support text overlay, screenshots, video recording, etc. Header file code: #pragma once #ifdef __DLLEXPORT #define __DLL_EXP _declspec(dllexport) #else #define __DLL_EXP _declspec(dllimport) #endif #include <stdio.h> #include <string> using namespace […]

C++ ffmpeg+SDL audio and video playback encapsulation class

1. Include the necessary header files. #define SDL_MAIN_HANDLED //Avoid main redefinition file extern “C” { #include “./ffmpeg/include/libavformat/avformat.h” #include “./ffmpeg/include/libswscale/swscale.h” #include “./ffmpeg/include/libavcodec/avcodec.h” #include “./ffmpeg/include/libavcodec/codec.h” #include “./ffmpeg/include/libavutil/avutil.h” #include “./ffmpeg/include/libavutil/time.h” #include “./ffmpeg/include/libavutil/frame.h” #include “./ffmpeg/include/libavutil/opt.h” #include “./ffmpeg/include/libavutil/samplefmt.h” #include “./ffmpeg/include/libswresample/swresample.h” #include “./sdl/include/SDL.h” } #pragma comment(lib,”./ffmpeg/lib/x64/debug/avcodec.lib”) #pragma comment(lib,”./ffmpeg/lib/x64/debug/avdevice.lib”) #pragma comment(lib,”./ffmpeg/lib/x64/debug/avfilter.lib”) #pragma comment(lib,”./ffmpeg/lib/x64/debug/avformat.lib”) #pragma comment(lib,”./ffmpeg/lib/x64/debug/avutil.lib”) #pragma comment(lib,”./ffmpeg/lib/x64/debug/swresample.lib”) #pragma comment(lib,”./ffmpeg/lib/x64/debug/swscale.lib”) #pragma comment(lib, “Mfuuid.lib”) […]

[Qt SDL-related issues] The solution to the main function conflict caused by the introduction of SDL by Qt

Directory Title common mistakes Detailed error report solution Analyze the reason About the initialization of SDL No problem in theory, why are warnings often reported? SDL main function related source code Conclusion Common mistakes Detailed error report SDL/include/SDL_main.h:143: warning: “main” redefined 143 | #define main SDL_main Solution This problem is due to the definition of […]