Skip to content
/ XPlayer Public

This is a simple video player based on ffmpeg.

License

Notifications You must be signed in to change notification settings

zgjsxx/XPlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XPlayer

c++ qt torch

1. introduction

This is a simple video player based on the opensource framework ffmpeg.

Currently, it supports the below features:

  • play video
  • seek videos
  • stop video
  • open subtitle file
  • alter the volume
  • go on the video
  • go back the video
  • change the UI background

Just play whatever you want.

2. Build and Run

This project is constructed with Qt 5.12.9. So it is recommended to install it with the same version.

Open the XPlayer.pro in Qt creator and then simple run it with the debug mode.

player

If everything goes well, it will show you the main UI.

player playe2r

3. Framework

This UI of this project is constructed with QT qml.

We use three thread to co-work to play the video. They are XDemuxThread, XVideoThread and XAudioThread.

The Demux thread is used to split the video element and audio element from the original video file. It uses av_read_frame to read AVpacket and then put it into video/audio packet queue according the stream index.

                     |------->AVPacket(video)

av_read_frame -------|

​                    |-------->AVPacket(audio)

In XVideoThread, it will get the AVPacket from the video queue. It uses the avcodec_send_packet/avcodec_receive_packetto decode the video AVPacket to AVframe. And then process it to QImage to show. In video thread, it receives the pts of the audio thread to sync video and audio.

In XAudioThread, it will get the AVPacket from the audio queue. It uses the avcodec_send_packet/avcodec_receive_packetto decode the audio AVPacket to AVframe. We need to resample the packet and then process it to QIODevice to play.

4.LICENSE

MIT license

About

This is a simple video player based on ffmpeg.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published