Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
7th February 2023, 18:55 | #1 | Link |
QfG Group Germany
Join Date: Oct 2018
Location: Germany
Posts: 245
|
Searching a tool for changing FPS in RAW stream.
Hi there,
I'm searching for a tool to manipulate/change the framerate of HEVC RAW streams (of course without reencoding). Nothing that changes the framerate in container only how mkvtoolnix will do it. Anyone here one idea?
__________________
|
12th March 2023, 07:01 | #3 | Link |
QfG Group Germany
Join Date: Oct 2018
Location: Germany
Posts: 245
|
Thanks. That it! I build a little Batch file for this and it works perfectly. Works directly with all supported FFMPEG Containers, Output as RAW STream (supports AVC/HEVC).
Code:
@echo off & setlocal SETLOCAL EnableDelayedExpansion CHCP 1252>nul mode con cols=120 lines=50 TITLE Video FPS Changer [Team QfG] v0.1 beta set "FFMPEGpath=%~dp0tools\ffmpeg.exe" set "FPS=" set "CODEC=HEVC" echo Copyright (c) 2023 TeamQfG echo. echo ==================================== echo Video FPS Changer echo ==================================== echo. IF "%~1"=="" ( echo. call :colortxt 0E "No Input File. Drag and Drop a file over this script." /n echo. goto :EXIT ) :START cls echo Copyright (c) 2023 TeamQfG echo. echo ==================================== echo Video FPS Changer echo ==================================== echo. echo. call :colortxt 0F " ==" & call :colortxt 0E " SET VIDEO CODEC " & echo =================================================================================================== echo. echo C. CODEC [%CODEC%] echo. call :colortxt 0F " ==" & call :colortxt 0E " SET NEW FRAMERATE AND START " & echo ======================================================================================= echo. echo 1. 23,976 echo 2. 24 echo 3. 25 echo. echo ====================================================================================================================== echo. echo Change Settings ^! CHOICE /C C123 /N /M "Select a Letter C, 1, 2, 3" if errorlevel 4 ( set "FPS=25" goto :CONVERT ) if errorlevel 3 ( set "FPS=24" goto :CONVERT ) if errorlevel 2 ( set "FPS=24/1.001" goto :CONVERT ) if errorlevel 1 ( if "%CODEC%"=="HEVC" set "CODEC=AVC" if "%CODEC%"=="AVC" set "CODEC=HEVC" ) goto :START :CONVERT cls echo Copyright (c) 2023 TeamQfG echo. echo ==================================== echo Video FPS Changer echo ==================================== echo. call :colortxt 0F " ==" & call :colortxt 0E " CONVERT FPS " & echo ======================================================================================================= echo. echo Changing FPS to %FPS%. Please wait... echo. "%FFMPEGpath%" -i "%~1" -loglevel error -stats -an -sn -dn -c copy -bsf:v hevc_metadata=tick_rate=%FPS%:num_ticks_poc_diff_one=1 "%~dpn1_[FPS CHANGED].%CODEC%" goto :EXIT :EXIT TIMEOUT 30 SETLOCAL DisableDelayedExpansion exit :colortxt setlocal enableDelayedExpansion ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :colorPrint Color Str [/n] setlocal set "s=%~2" call :colorPrintVar %1 s %3 exit /b :colorPrintVar Color StrVar [/n] if not defined DEL call :initColorPrint setlocal enableDelayedExpansion pushd . ': cd \ set "s=!%~2!" :: The single blank line within the following IN() clause is critical - DO NOT REMOVE for %%n in (^"^ ^") do ( set "s=!s:\=%%~n\%%~n!" set "s=!s:/=%%~n/%%~n!" set "s=!s::=%%~n:%%~n!" ) for /f delims^=^ eol^= %%s in ("!s!") do ( if "!" equ "" setlocal disableDelayedExpansion if %%s==\ ( findstr /a:%~1 "." "\'" nul <nul set /p "=%DEL%%DEL%%DEL%" ) else if %%s==/ ( findstr /a:%~1 "." "/.\'" nul <nul set /p "=%DEL%%DEL%%DEL%%DEL%%DEL%" ) else ( >colorPrint.txt (echo %%s\..\') findstr /a:%~1 /f:colorPrint.txt "." <nul set /p "=%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%%DEL%" ) ) if /i "%~3"=="/n" echo( popd exit /b :initColorPrint for /f %%A in ('"prompt $H&for %%B in (1) do rem"') do set "DEL=%%A %%A" <nul >"%temp%\'" set /p "=." subst ': "%temp%" >nul exit /b :cleanupColorPrint 2>nul del "%temp%\'" 2>nul del "%temp%\colorPrint.txt" >nul subst ': /d exit /b
__________________
Last edited by -QfG-; 12th March 2023 at 07:06. |
12th March 2023, 08:13 | #4 | Link | |
Registered User
Join Date: Dec 2013
Posts: 629
|
Thank you for the script, -QfG-. Will give it a go, as I currently work with separate small .cmd files for each framerate.
Quote:
FYI MKVToolNix can rewrite timestamps for raw AVC stream too. I do this in the GUI by both setting the proper "Default duration/FPS" and checking "Fix bitstream timing info". Last time I checked, does not work for HEVC. Maybe Mosu will add support for it someday. |
|
12th March 2023, 20:01 | #5 | Link | |
QfG Group Germany
Join Date: Oct 2018
Location: Germany
Posts: 245
|
Quote:
__________________
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|