Skip to content

aliakseis/FFmpegPlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FFmpegPlayer

A simple FFmpeg based player. The player core is generic and made with multiplatformity in mind. UI / video / audio layer is MFC/Win32 specific. It turns out that there is no need to use multimedia libraries. There is also a Qt based demo example included. It offers:

  • Basic Playback Controls: Play/Pause, Stop.
  • Next/Previous Frame: Step through the video one frame at a time during pause.
  • Speed Change: Increase or decrease the playback speed without altering the pitch of the audio.
  • Separate Video and Audio Inputs: Ability to load and play video and audio from separate sources.
  • Audio Track Selection: Choose between different audio tracks if available.
  • Fragment Selection for Export: Mark in and out points to select a part of the video for exporting.
  • Repeated Playing: Loop the entire video/playlist or selected fragment continuously.
  • Subtitles: Load and display subtitle files in various formats.
  • Super Resolution: Enhance the resolution of the video using upscaling techniques.
  • Codec Support: Compatibility with a wide range of video and audio codecs.
  • Streaming Support: Ability to stream video from online sources.

Semi transparent, click through full screen mode introduced. It is invokable by holding ctrl+shift while pressing full screen button.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Visual Studio 2017 or higher.
  • Intel SDK For OpenCL Applications installation is required for the super resolution functionality intergated.

Installing

Be sure to download git submodules.

To get a development env running:

Install vcpkg from https://github.com/Microsoft/vcpkg.

.\vcpkg integrate install

Install Boost, FFmpeg, OpenCV etc... :

vcpkg install boost
vcpkg install ffmpeg[ffmpeg,x264,nonfree,gpl,vpx,webp,zlib,xml2]
...

YouTube view support using https://github.com/pytube/pytube.git is turned on by default. It can be turned off by commenting define YOUTUBE_EXPERIMENT in YouTuber.cpp. Python is also needed otherwise:

vcpkg install python3

The matching Python version has to be installed and added to the PATH environment variable for the accessory DLLs to be accessible.

It is also possible that Boost::Python stuff will have to be enabled:

vcpkg install --featurepackages --recurse boost[python]

You may need to remove pytube stuff from your profile folder for the player application to set up the latest version, for example, by invoking remove_pytube.cmd.

You can also "patch" Python stuff by creating %LOCALAPPDATA%\git-subst.cfg mapping file that contains, for example,

https://github.com/pytube/pytube/archive/master.zip = https://github.com/aliakseis/pytube/archive/refs/heads/master.zip

Resource for SAN / non-SNI experiments:

https://github.com/pytube/pytube/archive/master.zip = https://github.com/aliakseis/pytube/archive/refs/heads/SAN.zip

Sometimes it is needed to visit pytube issues list and apply fixes, for example

Take into account https://www.psiphon3.com if you encounter HTTP Error 429.

Just in case: "In fact in boost-python, the default behavior is that even when debug boost libraries are created, these libraries are linked to the release pythonX.dll/lib - by intention, according to the docs." pybind/pybind11#1295

Tiny demos here: https://www.youtube.com/watch?v=dySA4yEGdEc https://www.youtube.com/watch?v=t5iW2ZsEzrA

Tip: hold Ctrl+Shift while submitting File Open dialog to choose a separate audio file. It works for the file opening from the Windows Explorer as well.

Please take into account specific Windows 10 behavior while opening Internet shortcuts: https://community.spiceworks.com/topic/1968971-opening-web-links-downloading-1-item-to-zcrksihu You can avoid this by dragging and dropping them.

Note that the FFmpeg patch speeds up HEVC decoding without GPU support by ~10%:

image

Bonus tip

Playing YouTube videos in browsers may result in poor performance on slow hardware. Assign a keyboard shortcut to the FFmpeg player by editing its shortcut. Hover your mouse over the YouTube link in Firefox and bring up the shortcut. A player pop-up window will appear, starting the video playback. The same can be achieved in Chrome with some tweaking. Start Chrome with this flag: --force-renderer-accessibility and / or set up IAccessible2 COM proxy stub DLL.

redline