Skip to content

Instantly share code, notes, and snippets.

View hnajafiz's full-sized avatar

hossein najafi hnajafiz

View GitHub Profile
@hnajafiz
hnajafiz / client.conf
Created June 1, 2024 12:32 — forked from deargle/client.conf
OpenVPN server.conf and client.conf
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
@hnajafiz
hnajafiz / ffmpeg-cheatsheet.md
Created September 9, 2020 09:11 — forked from nickkraakman/ffmpeg-cheatsheet.md
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@hnajafiz
hnajafiz / README.md
Created December 29, 2019 07:28 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@hnajafiz
hnajafiz / README.md
Created January 23, 2019 08:00 — forked from roachhd/README.md
Games on GitHub

Games on GitHub

Below is a list of open source games and game-related projects that can be found on GitHub - old school text adventures, educational games, 8-bit platform games, browser-based games, indie games, GameJam projects, add-ons/maps/hacks/plugins for commercial games, libraries, frameworks, engines, you name it.

Contributing

If you'd like to add a repository to the list, please create an Issue, or fork this repository and submit a pull request.

Help: MarkDown Help, Markdown Cheatsheet

@hnajafiz
hnajafiz / iframe-probe.py
Created November 20, 2018 05:44 — forked from alastairmccormack/iframe-probe.py
Shows GOP structure for video file using ffmpeg --show-frames output
#!/usr/bin/env python
#
# Shows GOP structure of video file. Useful for checking suitability for HLS and DASH packaging.
# Example:
#
# $ iframe-probe.py myvideo.mp4
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
# GOP: IPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 60 CLOSED
@hnajafiz
hnajafiz / ffmpeg_surfaces.patch
Created November 20, 2018 05:35 — forked from Snawoot/ffmpeg_surfaces.patch
Lower surfaces usage for nvenc encoding process
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index a3a2ef5..1691d15 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1157,7 +1157,7 @@ static av_cold int nvenc_setup_surfaces(AVCodecContext *avctx)
NvencContext *ctx = avctx->priv_data;
int i, res;
int num_mbs = ((avctx->width + 15) >> 4) * ((avctx->height + 15) >> 4);
- ctx->nb_surfaces = FFMAX((num_mbs >= 8160) ? 32 : 48,
+ ctx->nb_surfaces = FFMAX((num_mbs >= 8160) ? 8 : 12,
@hnajafiz
hnajafiz / install_ffmpeg_nvenc.sh
Created November 20, 2018 05:34 — forked from jniltinho/install_ffmpeg_nvenc.sh
Install FFMPEG 2.8.6 support NVENC on Ubuntu 16.04
#!/bin/bash
## Install FFMPEG 2.8.6 Ubuntu 16.04 64Bits
## http://www.linuxpro.com.br/2017/04/compile-ffmpeg-nvenc-ubuntu/
## Pacote Compilado no GITHUB: https://github.com/jniltinho/oficinadotux
## Run as root (sudo su)
## Check Nvidia ENC
## nvidia-smi dmon -i 0
## Test FFMPEG ENCODER NVENC (FFMPEG 2.8.6 NVIDIA-SDK 6.0.1)
@hnajafiz
hnajafiz / install_ffmpeg-obs_opensuse.sh
Last active November 20, 2018 05:34 — forked from jniltinho/install_ffmpeg-obs_opensuse.sh
Install FFMPEG GIT + NVENC + OBS -- OpenSUSE 42.2
#!/bin/bash
## Install FFMPEG GIT + OBS GIT OpenSUSE 42.2 64Bits
## http://www.diolinux.com.br/2016/07/como-instalar-o-ffmpeg-nvenc-no-ubuntu.html
## Pacote Compilado no GITHUB: https://github.com/jniltinho/oficinadotux/tree/master/ffmpeg_nvenc/opensuse
## Run as root (sudo su)
## Links
## http://www.regataos.com.br/
## https://gist.github.com/Brainiarc7/4b49f463a08377530df6cecb8171306a
## https://developer.nvidia.com/ffmpeg
@hnajafiz
hnajafiz / ffmpeg-minimalist-build-nvenc-static.md
Created November 20, 2018 05:34
Static FFmpeg build on Ubuntu 16.04 with Nvidia NVENC enabled.

Minimalist static FFmpeg build on Ubuntu 16.04 with Nvidia NVENC enabled.

Original guide with a standard build is here.

With this guide, I'm adding more instructions to enable support for NVIDIA CUVID and NVIDIA NPP for enhanced encode and decode performance.

First, prepare for the build and create the work space directory:

cd ~/

@hnajafiz
hnajafiz / install_ffmpeg-nvenc_obs.sh
Created November 20, 2018 05:33 — forked from jniltinho/install_ffmpeg-nvenc_obs.sh
Install FFMPEG GIT + NVENC SDK 8 + OBS GIT
#!/bin/bash
## Install FFMPEG GIT Ubuntu 16.04 64Bits
## http://www.linuxpro.com.br/2017/04/compile-ffmpeg-nvenc-ubuntu/
## Pacote Compilado no GITHUB: https://github.com/jniltinho/oficinadotux
## Run as root (sudo su)
## Links
## http://ftp.eq.uc.pt/software/Linux/deb-multimedia/pool/main/v/vid.stab/
## https://gist.github.com/Brainiarc7/4b49f463a08377530df6cecb8171306a
## https://developer.nvidia.com/ffmpeg