Streaming video involves a complex pipeline of transcoding and networking.

My step is a Sinology NAS, with Plex Server installed, with ChromeCast devices all connected to Dumb TVs via HDMI with a Iphone Plex App that connects to the Plex Server via Wifi, everything is Wifi Connected. There is allot that can go wrong in this setup, but it is rock solid for me. My wife can watch films and stream multiple Channels.

If you’re running a Synology NAS using the Plex Server app, and then using the iPhone Plex app to cast to a Chromecast device connected to your TV, the setup works beautifully — except when newer videos exceed 2 GB in size.
To ensure smooth playback in this architecture, you’ll need to downsize the videos using the following command:

ffmpeg -i ".\Ash.mp4" -c:v libx264 -preset veryfast -crf 30 -vf "scale=-2:720" -c:a aac -b:a 96k -movflags +faststart "Ash_720p.mp4"

ffmpeg -i "%input%" -c:v libx264 -preset veryslow -crf 32 -vf "scale=-2:720" -r 20 -c:a aac -b:a 64k -movflags +faststart "%output%"

@echo off
setlocal enabledelayedexpansion

REM Check if input file is provided
if "%~1"=="" (
    echo Usage: Drag and drop an MP4 file onto this script, or run from terminal with a filename.
    pause
    exit /b
)

REM Get input file path and name
set "input=%~1"
set "filename=%~n1"
set "ext=%~x1"

REM Output file name
set "output=%filename%_720slow%ext%"

REM Run FFmpeg with compression settings
ffmpeg -i "%input%" -c:v libx264 -preset veryslow -crf 32 -vf "scale=-2:720" -r 20 -c:a aac -b:a 64k -movflags +faststart "%output%"

echo Done: %output%
pause

Check Nvida encoding

Microsoft Windows [Version 10.0.26100.4061]
(c) Microsoft Corporation. All rights reserved.

>ffmpeg -hide_banner -encoders | findstr nvenc
 V....D av1_nvenc            NVIDIA NVENC av1 encoder (codec av1)
 V....D h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V....D hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)

>ffmpeg -hide_banner -hwaccels
Hardware acceleration methods:
cuda
vaapi
dxva2
qsv
d3d11va
d3d12va


h264_nvenc, hevc_nvenc, and av1_nvenc: ✅ Installed and ready for GPU video encoding.

cuda: ✅ Available for GPU decoding and filters.

dxva2, d3d11va, etc.: Other GPU acceleration methods are available too.


ffmpeg -hwaccel cuda -i "input.mkv" -c:v h264_nvenc -preset fast -cq 30 -vf "scale=-2:720" -c:a aac -b:a 96k -movflags +faststart "output_720p.mp4"

Batch Script

@echo off
setlocal enabledelayedexpansion

:: Directory containing MKV files
set "input_dir=%~1"
if "%input_dir%"=="" set "input_dir=."

cd /d "%input_dir%"

for %%F in (*.mkv) do (
    set "input=%%F"
    set "filename=%%~nF"
    echo Processing !input!...

   ::  ffmpeg -i "!input!" -c:v libx264 -preset veryfast -crf 30 -vf "scale=-2:720" -c:a aac -b:a 96k -movflags +faststart "!filename!_720p.mp4"
)

ffmpeg -hwaccel cuda -i "input.mkv" -c:v h264_nvenc -preset fast -cq 30 -vf "scale=-2:720" -c:a aac -b:a 96k -movflags +faststart "output_720p.mp4"

echo Done.
pause