fix(video): prioritize h264 codec and fix pixi render blur
This commit is contained in:
@@ -809,7 +809,6 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
|
||||
blurFilter.resolution = app.renderer.resolution;
|
||||
blurFilter.blur = 0;
|
||||
const motionBlurFilter = new MotionBlurFilter([0, 0], 5, 0);
|
||||
videoContainer.filters = [blurFilter, motionBlurFilter];
|
||||
blurFilterRef.current = blurFilter;
|
||||
motionBlurFilterRef.current = motionBlurFilter;
|
||||
|
||||
@@ -1081,6 +1080,14 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
|
||||
motionIntensity,
|
||||
motionVector,
|
||||
);
|
||||
|
||||
const isMotionBlurActive = (motionBlurAmountRef.current || 0) > 0 && isPlayingRef.current;
|
||||
|
||||
if (isMotionBlurActive && blurFilterRef.current && motionBlurFilterRef.current && videoContainerRef.current) {
|
||||
videoContainerRef.current.filters = [blurFilterRef.current, motionBlurFilterRef.current];
|
||||
} else if (videoContainerRef.current) {
|
||||
videoContainerRef.current.filters = null;
|
||||
}
|
||||
};
|
||||
|
||||
app.ticker.add(ticker);
|
||||
|
||||
@@ -118,11 +118,15 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
|
||||
}, []);
|
||||
|
||||
const selectMimeType = () => {
|
||||
// H.264 first: hardware-accelerated on all modern devices, gives sharp
|
||||
// real-time output. AV1/VP9 are great for distribution but too
|
||||
// CPU-intensive for live 60 fps capture — they produce blurry frames
|
||||
// when the software encoder can't keep up.
|
||||
const preferred = [
|
||||
"video/webm;codecs=av1",
|
||||
"video/webm;codecs=h264",
|
||||
"video/webm;codecs=vp9",
|
||||
"video/webm;codecs=vp8",
|
||||
"video/webm;codecs=vp9",
|
||||
"video/webm;codecs=av1",
|
||||
"video/webm",
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user