transcodeVideoStream -> transcodeVideo

This commit is contained in:
Alex Gleason 2025-02-27 20:08:26 -06:00
parent 25d5db8db6
commit 044930cc8d
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 4 additions and 4 deletions

View file

@ -1,8 +1,8 @@
import { transcodeVideoStream } from './transcode.ts'; import { transcodeVideo } from './transcode.ts';
Deno.test('transcodeVideoStream', async () => { Deno.test('transcodeVideo', async () => {
await using file = await Deno.open(new URL('./buckbunny.mp4', import.meta.url)); await using file = await Deno.open(new URL('./buckbunny.mp4', import.meta.url));
const output = await transcodeVideoStream(file.readable); const output = await transcodeVideo(file.readable);
await Deno.writeFile(new URL('./buckbunny-transcoded.mp4', import.meta.url), output); await Deno.writeFile(new URL('./buckbunny-transcoded.mp4', import.meta.url), output);
}); });

View file

@ -1,4 +1,4 @@
export async function transcodeVideoStream(input: ReadableStream<Uint8Array>): Promise<ReadableStream<Uint8Array>> { export async function transcodeVideo(input: ReadableStream<Uint8Array>): Promise<ReadableStream<Uint8Array>> {
const opts = { const opts = {
'i': 'pipe:0', // Read input from stdin 'i': 'pipe:0', // Read input from stdin
'c:v': 'libx264', // Convert to H.264 'c:v': 'libx264', // Convert to H.264