@remotion/renderer
Advanced tools
Comparing version 4.0.235 to 4.0.236
@@ -31,4 +31,11 @@ "use strict"; | ||
const generateFfmpegArgs = ({ hasPreencoded, proResProfileName, pixelFormat, x264Preset, codec, crf, videoBitrate, encodingMaxRate, encodingBufferSize, colorSpace, hardwareAcceleration, indent, logLevel, }) => { | ||
const encoderSettings = (0, get_codec_name_1.getCodecName)(codec, hardwareAcceleration === 'required' || | ||
hardwareAcceleration === 'if-possible'); | ||
const encoderSettings = (0, get_codec_name_1.getCodecName)({ | ||
codec, | ||
encodingMaxRate, | ||
encodingBufferSize, | ||
crf, | ||
hardwareAcceleration, | ||
indent, | ||
logLevel, | ||
}); | ||
if (encoderSettings === null) { | ||
@@ -35,0 +42,0 @@ throw new TypeError(`encoderSettings is null: ${JSON.stringify(codec)} (hwaccel = ${hardwareAcceleration})`); |
import type { Codec } from './codec'; | ||
import type { LogLevel } from './log-level'; | ||
import type { HardwareAccelerationOption } from './options/hardware-acceleration'; | ||
export type CodecSettings = { | ||
@@ -6,2 +8,15 @@ encoderName: string; | ||
}; | ||
export declare const getCodecName: (codec: Codec, preferredHwAcceleration: boolean) => CodecSettings | null; | ||
export declare const hasSpecifiedUnsupportedHardwareQualifySettings: ({ encodingMaxRate, encodingBufferSize, crf, }: { | ||
encodingMaxRate: string | null; | ||
encodingBufferSize: string | null; | ||
crf: unknown; | ||
}) => "crf" | "encodingBufferSize" | "encodingMaxRate" | null; | ||
export declare const getCodecName: ({ codec, encodingMaxRate, encodingBufferSize, crf, hardwareAcceleration, logLevel, indent, }: { | ||
codec: Codec; | ||
hardwareAcceleration: HardwareAccelerationOption; | ||
encodingMaxRate: string | null; | ||
encodingBufferSize: string | null; | ||
crf: unknown; | ||
logLevel: LogLevel; | ||
indent: boolean; | ||
}) => CodecSettings | null; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getCodecName = void 0; | ||
const getCodecName = (codec, preferredHwAcceleration) => { | ||
exports.getCodecName = exports.hasSpecifiedUnsupportedHardwareQualifySettings = void 0; | ||
const logger_1 = require("./logger"); | ||
const hasSpecifiedUnsupportedHardwareQualifySettings = ({ encodingMaxRate, encodingBufferSize, crf, }) => { | ||
if (encodingBufferSize !== null) { | ||
return 'encodingBufferSize'; | ||
} | ||
if (encodingMaxRate !== null) { | ||
return 'encodingMaxRate'; | ||
} | ||
if (crf !== null && typeof crf !== 'undefined') { | ||
return 'crf'; | ||
} | ||
return null; | ||
}; | ||
exports.hasSpecifiedUnsupportedHardwareQualifySettings = hasSpecifiedUnsupportedHardwareQualifySettings; | ||
const getCodecName = ({ codec, encodingMaxRate, encodingBufferSize, crf, hardwareAcceleration, logLevel, indent, }) => { | ||
const preferredHwAcceleration = hardwareAcceleration === 'required' || | ||
hardwareAcceleration === 'if-possible'; | ||
const unsupportedQualityOption = (0, exports.hasSpecifiedUnsupportedHardwareQualifySettings)({ | ||
encodingMaxRate, | ||
encodingBufferSize, | ||
crf, | ||
}); | ||
if (hardwareAcceleration === 'required' && unsupportedQualityOption) { | ||
throw new Error(`When using hardware accelerated encoding, the option "${unsupportedQualityOption}" with hardware acceleration is not supported. Disable hardware accelerated encoding or use "if-possible" instead.`); | ||
} | ||
const warnAboutDisabledHardwareAcceleration = () => { | ||
if (hardwareAcceleration === 'if-possible' && unsupportedQualityOption) { | ||
logger_1.Log.warn({ indent, logLevel }, `${indent ? '' : '\n'}Hardware accelerated encoding disabled - "${unsupportedQualityOption}" option is not supported with hardware acceleration`); | ||
} | ||
}; | ||
if (codec === 'prores') { | ||
if (preferredHwAcceleration && process.platform === 'darwin') { | ||
if (preferredHwAcceleration && | ||
process.platform === 'darwin' && | ||
!unsupportedQualityOption) { | ||
return { encoderName: 'prores_videotoolbox', hardwareAccelerated: true }; | ||
} | ||
warnAboutDisabledHardwareAcceleration(); | ||
return { encoderName: 'prores_ks', hardwareAccelerated: false }; | ||
} | ||
if (codec === 'h264') { | ||
if (preferredHwAcceleration && | ||
process.platform === 'darwin' && | ||
!unsupportedQualityOption) { | ||
return { encoderName: 'h264_videotoolbox', hardwareAccelerated: true }; | ||
} | ||
warnAboutDisabledHardwareAcceleration(); | ||
return { encoderName: 'libx264', hardwareAccelerated: false }; | ||
} | ||
if (codec === 'h265') { | ||
if (preferredHwAcceleration && | ||
process.platform === 'darwin' && | ||
!unsupportedQualityOption) { | ||
return { encoderName: 'hevc_videotoolbox', hardwareAccelerated: true }; | ||
} | ||
warnAboutDisabledHardwareAcceleration(); | ||
return { encoderName: 'libx265', hardwareAccelerated: false }; | ||
@@ -16,0 +60,0 @@ } |
@@ -6,3 +6,3 @@ { | ||
"name": "@remotion/renderer", | ||
"version": "4.0.235", | ||
"version": "4.0.236", | ||
"description": "Render Remotion videos using Node.js or Bun", | ||
@@ -22,4 +22,4 @@ "main": "dist/index.js", | ||
"ws": "8.17.1", | ||
"@remotion/streaming": "4.0.235", | ||
"remotion": "4.0.235" | ||
"@remotion/streaming": "4.0.236", | ||
"remotion": "4.0.236" | ||
}, | ||
@@ -31,20 +31,20 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@testing-library/dom": "^8.16.0", | ||
"@testing-library/react": "13.3.0", | ||
"@testing-library/dom": "10.4.0", | ||
"@testing-library/react": "16.1.0", | ||
"@happy-dom/global-registrator": "14.5.1", | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1", | ||
"react": "19.0.0", | ||
"react-dom": "19.0.0", | ||
"@types/ws": "8.5.10", | ||
"eslint": "9.14.0", | ||
"@remotion/eslint-config-internal": "4.0.235", | ||
"@remotion/example-videos": "4.0.235" | ||
"@remotion/example-videos": "4.0.236", | ||
"@remotion/eslint-config-internal": "4.0.236" | ||
}, | ||
"optionalDependencies": { | ||
"@remotion/compositor-darwin-arm64": "4.0.235", | ||
"@remotion/compositor-linux-arm64-gnu": "4.0.235", | ||
"@remotion/compositor-linux-x64-gnu": "4.0.235", | ||
"@remotion/compositor-linux-x64-musl": "4.0.235", | ||
"@remotion/compositor-win32-x64-msvc": "4.0.235", | ||
"@remotion/compositor-linux-arm64-musl": "4.0.235", | ||
"@remotion/compositor-darwin-x64": "4.0.235" | ||
"@remotion/compositor-darwin-arm64": "4.0.236", | ||
"@remotion/compositor-linux-arm64-gnu": "4.0.236", | ||
"@remotion/compositor-linux-x64-musl": "4.0.236", | ||
"@remotion/compositor-win32-x64-msvc": "4.0.236", | ||
"@remotion/compositor-linux-x64-gnu": "4.0.236", | ||
"@remotion/compositor-linux-arm64-musl": "4.0.236", | ||
"@remotion/compositor-darwin-x64": "4.0.236" | ||
}, | ||
@@ -51,0 +51,0 @@ "keywords": [ |
1504342
40463
+ Added@remotion/compositor-darwin-arm64@4.0.236(transitive)
+ Added@remotion/compositor-darwin-x64@4.0.236(transitive)
+ Added@remotion/compositor-linux-arm64-gnu@4.0.236(transitive)
+ Added@remotion/compositor-linux-arm64-musl@4.0.236(transitive)
+ Added@remotion/compositor-linux-x64-gnu@4.0.236(transitive)
+ Added@remotion/compositor-linux-x64-musl@4.0.236(transitive)
+ Added@remotion/compositor-win32-x64-msvc@4.0.236(transitive)
+ Added@remotion/streaming@4.0.236(transitive)
+ Addedremotion@4.0.236(transitive)
- Removed@remotion/compositor-darwin-arm64@4.0.235(transitive)
- Removed@remotion/compositor-darwin-x64@4.0.235(transitive)
- Removed@remotion/compositor-linux-arm64-gnu@4.0.235(transitive)
- Removed@remotion/compositor-linux-arm64-musl@4.0.235(transitive)
- Removed@remotion/compositor-linux-x64-gnu@4.0.235(transitive)
- Removed@remotion/compositor-linux-x64-musl@4.0.235(transitive)
- Removed@remotion/compositor-win32-x64-msvc@4.0.235(transitive)
- Removed@remotion/streaming@4.0.235(transitive)
- Removedremotion@4.0.235(transitive)
Updated@remotion/streaming@4.0.236
Updatedremotion@4.0.236