Skip to content

Instantly share code, notes, and snippets.

@ssg
Last active December 15, 2025 07:12
Show Gist options
  • Select an option

  • Save ssg/f0db499cfc0c5f09139c10378c9b4cee to your computer and use it in GitHub Desktop.

Select an option

Save ssg/f0db499cfc0c5f09139c10378c9b4cee to your computer and use it in GitHub Desktop.
PowerShell FFMPEG command to convert all BMW driver recorder dashcam videos to a known container format
# converts all ".ts" MPEGTS videos in current directory and its subdirectories to .MP4 container format
# it doesn't re-encode the video, uses the original, so the file size remains the same and there is
# absolutely no quality loss.
# if you want to compress your videos (i don't recommend it since that might affect quality) remove the "-c copy"
# parameter and add yours if needed.
dir *.ts -r | % { ffmpeg -i $_.FullName -y -c copy $([System.IO.Path]::ChangeExtension($_.FullName, '.mp4')) }
# high quality, possibly visually not lossy, but still lossy version:
# dir *.ts -r | % { ffmpeg -i $_.FullName -y -c:v libx264 -crf 18 -preset slow $([System.IO.Path]::ChangeExtension($_.FullName, '.mp4')) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment