ditto/packages/transcode/ffprobe.test.ts
2025-02-27 23:38:57 -06:00

18 lines
463 B
TypeScript

import { assertEquals } from '@std/assert';
import { ffprobe } from './ffprobe.ts';
Deno.test('ffprobe', async () => {
const uri = new URL('./buckbunny.mp4', import.meta.url);
const stream = ffprobe(uri, {
'v': 'error',
'select_streams': 'v:0',
'show_entries': 'stream=width,height',
'of': 'json',
});
const { streams: [dimensions] } = await new Response(stream).json();
assertEquals(dimensions, { width: 1920, height: 1080 });
});