This article introduces a self-made ffplay transplant to VC under the Open Source project: Ffplayfor MFC. This project will ffmpeg the Ffplay player (FFPLAY.C) in the project to the VC environment. And using MFC to do a simple set of interfaces. It can complete a player's basic flow of video playback: Solution protocol, unpacking, video/audio decoding, AV synchronization, AV output. There are also some control functions: play, pause/resume, forward, rewind, stop, frame-by-screen, fullscreen, etc., as well as some simple video stream analysis functions: Video decoding analysis and audio decoding analysis. This program allows you to learn the principles of video player, as well as the SDL and Windows Messaging mechanisms.
Platform: VC2010
Class Library: Ffmpeg,mfc
Project Home
sourceforge:https://sourceforge.net/projects/ffplayformfc/
Github:https://github.com/leixiaohua1020/ffplaymfc
Open source China: Http://git.oschina.net/leixiaohua1020/ffplay-for-MFC
csdn Project Download
Ffplay for MFC 1.0.0 (Stable)-This version uses the FFmpeg 2012 class library to stabilize
http://download.csdn.net/detail/leixiaohua1020/7452437
Ffplay for MFC 1.0.1--This version uses FFmpeg's May 2014 class library, supports HEVC and vp9,debug under stability, release under the current problem.
http://download.csdn.net/detail/leixiaohua1020/7452493
Note: The issue under release has been suggested and resolved by netizens. Here's how to fix it:
VC Project Properties, linker->optimization->references option, change to No (/OPT:NOREF).
Note: The above two items due to errors, missing a SDL.dll file, go to the SDL official website
http://www.libsdl.org/download-1.2.php
Download a runtime libraries
Add:
This project original code introduction can refer to: Ffplay for MFC code Memo
Update Record ==============================
Version 1.1 (2014.7.10)
* Part of the interface has been replaced
* Original project Support Unicode encoding
* Fixed bug in release
* Added two macros to define "Int64_min Int64_max", if no WIN7SDK is installed, there may be a situation where the definition cannot be found.
Csdn on a copy: Http://download.csdn.net/detail/leixiaohua1020/7764509PUDN also sent a copy: http://www.pudn.com/downloads644/ Sourcecode/multimedia/detail2605167.html
I. Main interface
The main interface of the program is shown in the figure. At the top is the URL of the input. The middle is the list of parameters for the video. Below is the control button for the video.
1.1 Enter URL
Enter a URL box to enter the URL of the video. The video source can be a local video or a network stream. Clicking the file button to the right of the input box makes it easy to select local files and get their URLs (here is the path information). Alternatively, you can drag the local video file directly into the dialog box, or you can get the URL to the video.
1.2 List of parameters
Package Format Parameters
INPUT type: Enter the transport protocol used by the video audio. Example: Rtp,file (file), http,rtmp.
Encapsulation Format: The package format used by AV. Example: AVI,FLV,MKV,RMVB.
Bit rate: The bitrate of the AV. Example 1Mbps.
Duration: The length of time the audio is viewed.
MetaData: Visual audio meta-data information.
Video Parameters
Output pixel format: decoded pixel data format. Example: Yuv420p,rgb24,uyvy.
Encoding method: The compression encoding standard used in video. Example: H.264,MPEG2.
Frame rate: The number of video images per second. Example: 25fps.
Screen Size: The resolution of the screen. Example: 1920x1080,720x576.
Decoding analysis: Displays the details of each video frame as a list.
Audio Parameters
Sample rate: The number of sample points per second. Example: 44.1khz,48khz.
Encoding: The compression encoding standard used by audio. Example: Aac,mp3,wma.
Number of channels: number of channels.
Decoding analysis: Displays the details of each audio frame as a list.
1.3 control Buttons
The control buttons contain: Start, rewind, pause/resume, forward, stop, frame-by-screen, fullscreen.
In addition, the top of the row control button contains a progress bar for video playback. You can control the playback of the video by dragging the progress bar.
two. video playback window
Video playback takes the SDL display.
three. Video Decoding analysis window
The Video decoding Analysis window list shows some information about each video frame: Sequence number, frame type, key frame, stream sequence number, PTS. The different frame types are identified using different background colors: I frames use red, p frames use blue, and B frames use green. As shown in the figure.
four. Audio Decoding Analysis window
The Audio Decoding Analysis window list shows some information about each audio frame: sequence number, size, PTS, and so on. As shown in the figure.
Five. System Support Information window
The System Support Information window list displays the system support information. Includes system support: protocol, encapsulation format, video decoder, audio decoder, and other decoders (subtitle decoder). For example, the list of protocols is shown, which shows that the protocol types supported by this program include HTTP,FILE,MMS,RTP and so on.
For example, from the list of encapsulated formats, you can see that the system supports encapsulation formats such as FLV. Each list contains information such as serial numbers, abbreviations, full names, extensions, private data size, and so on.
Six. Menu
The menu on the upper end of the program contains richer options. Altogether divided into 6 parts of the function: file, play control, play window, view, language, help . The following are described separately.
file : Open the file.
Playback Control : The control function during video playback. Includes: Play, pause/resume, stop, frame-by-screen, fullscreen. Also includes a variety of fast-forward rewind operations: Fast forward 10 seconds, 1 points, 10 points; rewind 10 seconds, 1 points, 10 points.
Playback window : Various options related to the Playback window. You can set the content that the Playback window displays, as well as the window's size, aspect ratio. The Playback window displays the video screen by default. It is also possible to graphically display audio information, including the waveform of the audio, as well as the Rdft transform graph of the audio.
The audio waveform shows the effect as shown in the figure:
The Rdft transform diagram of the audio shows the effect as shown in the figure:
View : Contains several windows in a program. Contains video decoding analysis window, audio decoding Analysis window, System Support information window.
language : contains several languages supported by the program.
Help : Contains support information for the program.
seven. English interface
The English interface of the system is shown in the figure. There are opportunities to add additional languages later.
Main interface
Video Decoding Analysis window
Audio Decoding Analysis window
System Support Information window
Project Home
sourceforge:https://sourceforge.net/projects/ffplayformfc/
Github:https://github.com/leixiaohua1020/ffplaymfc
Open source China: Http://git.oschina.net/leixiaohua1020/ffplay-for-MFC