Skip to content

Instantly share code, notes, and snippets.

@MarsMSJ
Last active March 28, 2024 17:17
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MarsMSJ/9f52129d2e8f8eda95efad3fba6704e7 to your computer and use it in GitHub Desktop.
Save MarsMSJ/9f52129d2e8f8eda95efad3fba6704e7 to your computer and use it in GitHub Desktop.
Convert your WebM (VP9) files to ProRes

Convert your WebM to ProRes

Like many of you lucky enough to purchase a PS5, I have been enjoying my time with the new console. One feature I started playing with is the video game capture feature via the "Create" button. I have been capturing my favorite clips here and there and selected the best ones to include a video I want to share. Unfortunately, I ran into trouble. None of my video editing applications (FCPX, DaVinci) support the WebM container. My favorite clips were all captured using WebM.

If you like me have all your favorite clips stuck in WebM then I have a solution for you. FFmpeg! This free software includes a ProRes encoder that simple enough to use works on Davinci Resolve (free version available) and Adobe Premiere! (FCPX of course supports ProRes.) See links below.

MacOS (and Linux)

On the MacOS, you can use the following command (Bash) to convert all WebM files in the current directory to ProRes.

for i in *.webm; do ffmpeg -i "$i" -pix_fmt yuv422p10le -c:v prores -profile:v 3 -vendor ap10 "$(basename "$i" .webm)".mov; done

Windows

The good news is that DaVinci Resolve (Windows/MacOS) supports ProRes! On Windows you can run the following command:

ffmpeg.exe -i webm_file_name.webm -pix_fmt yuv422p10le -c:v prores -profile:v 3 -vendor ap10 prores_file_name.mov

Stick to H264

Seriously, H264 is supported by just about everything. At 1080P, the benefits of VP9 aren't tangible enough to be worth the incompatability headache. Not to mention, it is highly likely your videos will be viewed on an SDR screen at resolutions lower than UHD 4K HDR.

To those terrible websites

I ran into a lot of websites asking me to download dodgy software or download new versions of "Adobe Flash." Avoid them like the plague. FFmpeg is open source and free for personal use. If a command line is not for you, VLC is an open-source free alternative that is able to convert WebM to other containers/codecs supported by your video editing software

Links

FFmpeg
DaVinci Resolve
VLC media player

@nileshkk9
Copy link

Does it correct the muted colour issue as well, when converting webm to other formats?

@semahawk
Copy link

semahawk commented Sep 4, 2022

@nileshkk9 from https://www.reddit.com/r/PS5/comments/jydlpu/playstation_5_video_capture_in_webm_and_conversion/

The issue is that the PS5 webm file format uses a BT.2020 colour space (basically HDR). My video editing software doesn't know how to interpret this so the colours look very muted (poor contrast). We need to convert to BT.709 colour space (SDR or standard dynamic range).

ffmpeg -i test.webm -vf zscale=tin=smpte2084:min=bt2020nc:pin=bt2020:rin=tv:t=smpte2084:m=bt2020nc:p=bt2020:r=tv,zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p -c:v libx264 -crf 15 -preset slower test.mp4

This also leads to jellyfin/jellyfin#415 which contains some more information

@xtchall
Copy link

xtchall commented Nov 13, 2022

Aborted my encode halfway when 700MB webm was at 45GB mov..

@kjn70
Copy link

kjn70 commented Jan 23, 2023

Thank you for this! I've been wrestling with how to work with PS5 WebM exports in MacOS. Does this preserve the HDR if I work within a wide color gamut project in FCPX?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment