• Stars
    star
    681
  • Rank 66,346 (Top 2 %)
  • Language
    C
  • Created almost 10 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

the simplest video player based on FFmpeg
最简单的基于FFmpeg的视频播放器 2
Simplest FFmpeg Player 2

雷霄骅 Lei Xiaohua
[email protected]
中国传媒大学/数字电视技术
Communication University of China / Digital TV Technology
http://blog.csdn.net/leixiaohua1020


本程序实现了视频文件的解码和显示(支持HEVC,H.264,MPEG2等)。
是最简单的FFmpeg视频解码方面的教程。
通过学习本例子可以了解FFmpeg的解码流程。
项目包含6个工程:
simplest_ffmpeg_player:标准版,FFmpeg学习的开始。
simplest_ffmpeg_player_su:SU(SDL Update)版,加入了简单的SDL的Event。
simplest_ffmpeg_decoder:一个包含了封装格式处理功能的解码器。使用了libavcodec和libavformat。
simplest_ffmpeg_decoder_pure:一个纯净的解码器。只使用libavcodec(没有使用libavformat)。
simplest_video_play_sdl2:使用SDL2播放YUV的例子。
simplest_ffmpeg_helloworld:输出FFmpeg类库的信息。

备注:
标准版在播放视频的时候,画面显示使用延时40ms的方式。这么做有两个后果:
(1)SDL弹出的窗口无法移动,一直显示是忙碌状态
(2)画面显示并不是严格的40ms一帧,因为还没有考虑解码的时间。
SU(SDL Update)版在视频解码的过程中,不再使用延时40ms的方式,而是创建了
一个线程,每隔40ms发送一个自定义的消息,告知主函数进行解码显示。这样做之后:
(1)SDL弹出的窗口可以移动了
(2)画面显示是严格的40ms一帧


This software is a simplest video player based on FFmpeg.
Suitable for beginner of FFmpeg.
Solutions contains 6 Project:
simplest_ffmpeg_player: Standard Version, suitable for biginner.
simplest_ffmpeg_player_su: SU(SDL Update)Version, Add SDL Event.
simplest_ffmpeg_decoder_pure: A pure decoder. Only use libavcodec (Without libavformat).
simplest_ffmpeg_decoder: A decoder that can demux container format. Uses libavcodec and libavformat.
simplest_video_play_sdl2: Example about using SDL2 play YUV data.
simplest_ffmpeg_helloworld: Output informations about FFmpeg libraries.

Remark:
Standard Version use's SDL_Delay() to control video's frame rate, it has 2
disadvantages:
(1)SDL's Screen can't be moved and always "Busy".
(2)Frame rate can't be accurate because it doesn't consider the time consumed 
by avcodec_decode_video2()
SU(SDL Update)Version solved 2 problems above. It create a thread to send SDL 
Event every 40ms to tell the main loop to decode and show video frames.

More Repositories

1

simplest_ffmpeg_mobile

ffmpeg examples in Android / IOS / WinPhone
C
1,926
star
2

VideoEye

open-source stream analysis software
C++
678
star
3

simplest_mediadata_test

samples to handling multimedia data
C++
542
star
4

simplest_ffmpeg_streamer

Simplest streamer based on FFmpeg
C
429
star
5

simplest_librtmp_example

Examples about usage of libRTMP
C
303
star
6

YUVplayer

Modified from a sourceforge project
C++
205
star
7

h264_analysis

A H.264 stream analysis software based on MFC
C++
182
star
8

simplest_ffmpeg_format

FFmpeg's mux/demux/remux examples
C
164
star
9

simplest_video_website

simplest video website based JavaEE and FFmpeg
Java
162
star
10

simplest_ffmpeg_video_encoder

the simplest video encoder based on FFmpeg
C
155
star
11

simplest_ffmpeg_video_filter

use FFmpeg's AVFilter to add watermark in a video file
C
129
star
12

simplest_flashmedia_example

simple examples about using flash player to play RTMP/HTTP/HLS
JavaScript
125
star
13

simplest_media_play

Examples about video/audio's playing
C
119
star
14

simplest_ffmpeg_device

FFmpeg's libavdevice examples
C
116
star
15

simplest_ffmpeg_audio_player

the simplest audio player based on FFmpeg
C
94
star
16

simplest_encoder

Examples about video encoders
C
93
star
17

ffplaymfc

C
79
star
18

leixiaohua1020.github.io

Shell
73
star
19

simplest_libvlc_example

Examples about libVLC
C
70
star
20

simplest_ffmpeg_mem_handler

ffmpeg's example about read/write from memory
C
53
star
21

simplest_directshow_example

Examples about DirectShow
C++
47
star
22

simplest_ffmpeg_audio_encoder

the simplest audio encoder based on FFmpeg
C
47
star
23

TIandSI

C
40
star
24

simplest_ffmpeg_picture_encoder

the simplest picture encoder based on FFmpeg
C
40
star
25

simplest_ffmpeg_swscale

Examples about handle pixel data using libswscale in FFmpeg.
C
36
star
26

simplest_keyframe_extractor

extract keyframe from input video data
C
15
star
27

simplest_ffmpeg_avutil

Examples about using of FFmpeg's libavutil
C
12
star
28

ffmpegmfc

8
star