Avant

Showing posts with label ffmpeg. Show all posts
Showing posts with label ffmpeg. Show all posts

Thursday, October 5, 2023

Resizing video using FFMPEG and Nvidia GPU

Recently I had to resize a rather large 4k H.265 video file to 1080p H.265 file. This is what I used. SO much faster than using the CPU for decoding!

ffmpeg.exe -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i <input file> -resize 1920x1080 -c:v hevc_nvenc -preset fast -rc vbr -acodec copy <output file>

Wednesday, June 21, 2023

Merge dashcam video file segments into a large MP4 file

As most dashcams save videos in 2-5 minute segments, sometimes you need to stich them together to create a full-length video - e.g. road trip footage. 

To do this, the best solution is to use FFmpeg's concat function.

Step 1: Create a file containing the list of segment file names (in Windows Command Prompt)

(for %i in (*.mp4) do @echo file '%i') > mylist.txt

Step 2: Run ffmpeg to create the output file

ffmpeg -f concat -i mylist.txt -c copy output.mp4