Hi everyone !
I would like to create a new topic with a list of your FFMPEG scripts that you are using for converting your video files and get them working correctly on different client devices. Feel free to share your scripts 
Here is a script I devlopped with a friend of mine. Im using it to remux my avi and mp4 files to mkv container. this is not for converting video and audio.
Language used: Python
Before running this script on your librairie please test it before with 2 or 3 files. This script will delete the sources files one by one once remuxing is done.
How to use:
- Create a Python file with the code provided bellow.
- Call the script and add the directory path of your videos.
Per example: script.py d:\
Hereās my script to remux mkv files to mp4 if the video is h264, otherwise it will transcode using ffmpeg. Converts audio to AAC. This is meant to get files playable in most devices. The formats can be changed so you could use it for almost any container. Also has options to extract subtitles in certain languages. I compiled my own version of ffmpeg with libfdk_aac, which canāt be distributed, but you can find versions with lib_faac.
Coded in Python. Run with the files or directories to convert as arguments. It will search recursively and look for files that end in video format extensions.
Change Extension to .py
Before running set the remover variable to False to ensure your files arenāt deleted.
Example Usage:
python.exe mp4ffmpeg.py File1.mkv D:/Video/Movies File2.avi
Iām new to all this ffmpeg stuff. But it happens that I download videos with audio_ts and video splitted up.
Is there a script or way, I can convert all these into a single .mkv file, for use by Plex?
@Dariz said:
Iām new to all this ffmpeg stuff. But it happens that I download videos with audio_ts and video splitted up.Is there a script or way, I can convert all these into a single .mkv file, for use by Plex?
Yes look for the application āmakemkvā its free
@ngovil21 said:
Hereās my script to remux mkv files to mp4 if the video is h264, otherwise it will transcode using ffmpeg. Converts audio to AAC. This is meant to get files playable in most devices. The formats can be changed so you could use it for almost any container. Also has options to extract subtitles in certain languages. I compiled my own version of ffmpeg with libfdk_aac, which canāt be distributed, but you can find versions with lib_faac.Coded in Python. Run with the files or directories to convert as arguments. It will search recursively and look for files that end in video format extensions.
Change Extension to .py
Before running set the remover variable to False to ensure your files arenāt deleted.
Example Usage:
python.exe mp4ffmpeg.py File1.mkv D:/Video/Movies File2.avi
Does it work if I use it for a mkv file with more than 1 audio track ?
@igowas
It should work if you set the audio codec to copy. If you want to transcode the audio, then it will need the audio tracks to be mapped, I think. Currently if it transcodes, it will only get the first audio track. You can add -map 0 as a parameter to get all of the streams.
Check here on how to use map:
http://ffmpeg.org/ffmpeg.html#Advanced-options
@ngovil21
Cool I give it a try !
FFMPEG script to convert to HEVC/H265 for Plex ⦠output Direct Plays on 4K/UHD devices over LAN/WiFi. Written in PHP.
http://satalink.blogspot.com/2016/10/ffmpeg-hevch265-tivo-bolt-direct-play.html
@Satalink said:
FFMPEG script to convert to HEVC/H265 for Plex ⦠output Direct Plays on 4K/UHD devices over LAN/WiFi. Written in PHP.http://satalink.blogspot.com/2016/10/ffmpeg-hevch265-tivo-bolt-direct-play.html
What are the client devices you are using to direct play a x265 file. I tried with a powerfull server and the CPU usage was really too high. ( Chrome cast, roku and Web are not really good for x265 )
@Satalink said:
FFMPEG script to convert to HEVC/H265 for Plex ⦠output Direct Plays on 4K/UHD devices over LAN/WiFi. Written in PHP.http://satalink.blogspot.com/2016/10/ffmpeg-hevch265-tivo-bolt-direct-play.html
You should also add -temporal-aq 1 to the list of options to pass to nvenc_h264 or nvenc_h265. It is supported in any version of ffmpeg from the last 2-3~ weeks.
Explanation ripped from NVENC_VideoEncoder_API_ProgGuide.pdf, as itās behind a registration wall on Nvidiaās developer page.
8.2 TEMPORAL ADAPTIVE QUANTIZATION (T-AQ)
This feature tries to adjust encoding QP based on temporal characteristics of the
sequence. Temporal AQ improves the quality of encoded frames by adjusting QP for
regions which are constant or have low motion across frames but have high spatial
detail, such that they become better reference for future frames. Allocating extra bits to
such regions in reference frames is better than allocating them to the residuals in
referred frames because it helps improve the overall encoded video quality. If majority
of the region within a frame has little or no motion, but has high spatial details (e.g.
high-detail non-moving background) enabling temporal AQ will benefit the most.One of the potential disadvantages of temporal AQ is that enabling temporal AQ may
result in high fluctuation of bits consumed per frame within a GOP. I/P-frames will
consume more bits than average P-frame size and B-frames will consume lesser bits.
Although target bitrate will be maintained at the GOP level, the frame size will fluctuate
from one frame to next within a GOP more than it would without temporal AQ. If a
strict CBR profile is required for every frame size within a GOP, it is not recommended
to enable temporal AQ. Additionally, since some of the complexity estimation is
performed in CUDA, there may be some performance impact when temporal AQ is
enabled.