Hello,
I would like to join clips with ffmpeg that are of different characteristics (resolution, codec, frame-rate, GOP composition, etc.) The problem is that since they have different characteristics, the output video file is buggy and lags all over the place.
Can you tell me how I can batch uniform these clips' characteristics with ffmeg, so I can join them (still with ffmpeg) without these lags. (I precise that all the clips should be at 1920x1080p 24fps.)
Thank you!
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 8 of 8
Thread
-
-
iirc. something like:
Code:ffmpeg -i "path to input" -vf "scale=w=1920:h=1080:force_original_aspect_ratio=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,fps=fps=24" -c:v libx264 -preset slow -crf 22 -c:a copy "path to output"
Combining that with your batch should do the job. ('Yes', reencoding is necessary.)
Cu Selurusers currently on my ignore list: deadrats, Stears555 -
Thank you, Selur! Can you tell me how I can perform this task in batch for all the files of a specific folder?
I can prepare a list of all the videos' filepaths in a txt if it's necessary.Last edited by vmackey; 17th Feb 2024 at 05:10.
-
Without even knowing what OS you are using: no.
Also there have been multipe threads on how to use ffmpeg in batches, so you should be able to find a solution for this.
for Windows read: https://forum.videohelp.com/threads/356314-How-to-batch-convert-multiplex-any-files-with-ffmpeg
Also since you want to concatenate your files, using a loop to perfome this on all the files of a specific folder seems like the wrong approach to me.
You instead should create a contatenation file as source.
(there have been other threads how to concatenate stuff with ffmpeg, so with the forum search you should be able to figure this out)
Cu Selur
Ps.: maybe one of the ffmpeg GUIs already supports this.users currently on my ignore list: deadrats, Stears555 -
See your other thread:
https://forum.videohelp.com/threads/413448-How-to-batch-convert-files-with-ffmpeg -
It creates a temp directory to put newly encoded files into, with the same name, and creates file list for concat that could be used after. Trying to use standalone functions for everything, it is a good practice. It looks seemingly complicated but it only looks that way.
Code:@echo off rem do not use already existing directory name, because it will be deleted! set "temp_dir_name=converted_files" set "filelist=filelist.txt" set "temp_folder=%~dp0%temp_dir_name%" type NUL > %filelist% call :TEMP_FOLDER_MANAGMENT "%temp_folder%" for %%x in (*.mp4) do call :PROCESS "%%x" echo done ENDLOCAL&echo press any key to exit&pause>nul&exit :PROCESS <input filepath> set "output=%temp_folder%\%~nx1" call :ENCODE "%~1" "%output%" call :APPEND_TO_LIST "%output%" %filelist% goto :eof :APPEND_TO_LIST <filepath> <text file> if exist "%~1" if %~z1 gtr 0 echo file '%~1' >> %2 goto :eof :ENCODE <input filepath> <output filepath> rem just grabbing selurs line ffmpeg -i "%~1" -vf "scale=w=1920:h=1080:force_original_aspect_ratio=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,fps=fps=24" -c:v libx264 -preset slow -crf 22 -c:a copy "%~2" goto :eof :TEMP_FOLDER_MANAGMENT <directory> rem this creates directory or deletes what is inside if that directory exists if exist "%~1" DEL /F /Q "%~1"\*.* if not exist "%~1" echo creating temp folder: "%~1"& MD "%~1" if not exist "%~1" ( echo ERROR, temp directory name has illegal characters or could not be created echo. endlocal & echo press any key to exit ... & pause>nul & goto :eof ) goto :eof
Last edited by _Al_; 17th Feb 2024 at 12:30.
-
Together with hydra3333 there was recently a long topic, how to actually take all media-files (including images, rotate them, box them, possibly use transitions, respecting color spaces etc.) from a directory (and or subdirectories) and create a long video out of it. We ended up both having results. Both solutions kind of ended up in a crude form I think, working but needing to be oriented in it a bit. I never ended up forging it into a gui , maybe some other time revisiting it. I used python and I did not have to use intermediate files, creating video on the fly, frame by frame. Audio was constructed using second pass though (following text file instructions from the first pass), but that was much faster.
https://forum.videohelp.com/threads/408230-ffmpeg-avc-from-jpgs-of-arbitrary-dimension...g-aspect-ratio
Similar Threads
-
Merging clips based on time difference.
By mrmustachesir in forum Video ConversionReplies: 3Last Post: 30th Apr 2023, 07:45 -
Burning DVD of many short clips while merging some
By verella in forum Newbie / General discussionsReplies: 5Last Post: 27th Aug 2022, 05:01 -
I'd be interested in using FFMPEG to prepare a TS for ATSC broadcast
By Videogamer555 in forum DVB / IPTVReplies: 6Last Post: 19th May 2022, 05:08 -
join video clips ffmpeg cmd
By grabyea in forum Video ConversionReplies: 6Last Post: 13th Oct 2021, 17:35 -
FFMpeg merging audio files truncates output to shortest audio file
By Wayneos in forum Video ConversionReplies: 0Last Post: 3rd Jul 2019, 07:07