Skip to content

🎥 Make videos programmatically with React

fix tests

Jonny Burgerf71659ef0854
diff --git a/packages/media-parser/src/test/m3u8-multiple-audio-streams.test.ts b/packages/media-parser/src/test/m3u8-multiple-audio-streams.test.ts
index f8582011a6..eae7f570a6 100644
--- a/packages/media-parser/src/test/m3u8-multiple-audio-streams.test.ts
+++ b/packages/media-parser/src/test/m3u8-multiple-audio-streams.test.ts
@@ -1,5 +1,6 @@
import {exampleVideos} from '@remotion/example-videos';
import {expect, test} from 'bun:test';
+import path from 'path';
import {nodeReader} from '../node';
import {parseMedia} from '../parse-media';
@@ -27,7 +28,10 @@ test('separate video and audio streams', async () => {
groupId: 'aud1',
language: 'en',
name: 'English',
- src: 'audio.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio.m3u8',
+ ),
id: 0,
},
],
@@ -36,7 +40,10 @@ test('separate video and audio streams', async () => {
height: 1080,
width: 1920,
},
- src: 'video.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'video.m3u8',
+ ),
},
],
});
@@ -54,7 +61,10 @@ test('multiple audio streams', async () => {
expect(m3uStreams).toEqual([
{
- src: 'video/10000kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'video/10000kbit.m3u8',
+ ),
averageBandwidth: null,
bandwidth: 10285391,
codecs: ['avc1.4d4033', 'mp4a.40.2'],
@@ -67,7 +77,10 @@ test('multiple audio streams', async () => {
groupId: 'surround',
language: 'en',
name: 'English',
- src: 'audio/surround/en/320kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/surround/en/320kbit.m3u8',
+ ),
id: 0,
},
{
@@ -77,14 +90,20 @@ test('multiple audio streams', async () => {
groupId: 'surround',
language: 'dubbing',
name: 'Dubbing',
- src: 'audio/stereo/none/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/none/128kbit.m3u8',
+ ),
id: 1,
},
],
id: 0,
},
{
- src: 'video/6000kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'video/6000kbit.m3u8',
+ ),
averageBandwidth: null,
bandwidth: 6214307,
codecs: ['avc1.4d4028', 'mp4a.40.2'],
@@ -97,7 +116,10 @@ test('multiple audio streams', async () => {
groupId: 'surround',
language: 'en',
name: 'English',
- src: 'audio/surround/en/320kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/surround/en/320kbit.m3u8',
+ ),
id: 0,
},
{
@@ -107,14 +129,20 @@ test('multiple audio streams', async () => {
groupId: 'surround',
language: 'dubbing',
name: 'Dubbing',
- src: 'audio/stereo/none/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/none/128kbit.m3u8',
+ ),
id: 1,
},
],
id: 1,
},
{
- src: 'video/4000kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'video/4000kbit.m3u8',
+ ),
averageBandwidth: null,
bandwidth: 4149264,
codecs: ['avc1.4d4028', 'mp4a.40.2'],
@@ -127,7 +155,10 @@ test('multiple audio streams', async () => {
groupId: 'surround',
language: 'en',
name: 'English',
- src: 'audio/surround/en/320kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/surround/en/320kbit.m3u8',
+ ),
id: 0,
},
{
@@ -137,14 +168,20 @@ test('multiple audio streams', async () => {
groupId: 'surround',
language: 'dubbing',
name: 'Dubbing',
- src: 'audio/stereo/none/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/none/128kbit.m3u8',
+ ),
id: 1,
},
],
id: 2,
},
{
- src: 'video/1500kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'video/1500kbit.m3u8',
+ ),
averageBandwidth: null,
bandwidth: 1558322,
codecs: ['avc1.4d401f', 'mp4a.40.2'],
@@ -157,7 +194,10 @@ test('multiple audio streams', async () => {
groupId: 'surround',
language: 'en',
name: 'English',
- src: 'audio/surround/en/320kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/surround/en/320kbit.m3u8',
+ ),
id: 0,
},
{
@@ -167,14 +207,20 @@ test('multiple audio streams', async () => {
groupId: 'surround',
language: 'dubbing',
name: 'Dubbing',
- src: 'audio/stereo/none/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/none/128kbit.m3u8',
+ ),
id: 1,
},
],
id: 3,
},
{
- src: 'video/1100kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'video/1100kbit.m3u8',
+ ),
averageBandwidth: null,
bandwidth: 1144430,
codecs: ['avc1.4d401f', 'mp4a.40.2'],
@@ -187,7 +233,10 @@ test('multiple audio streams', async () => {
groupId: 'surround',
language: 'en',
name: 'English',
- src: 'audio/surround/en/320kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/surround/en/320kbit.m3u8',
+ ),
id: 0,
},
{
@@ -197,14 +246,21 @@ test('multiple audio streams', async () => {
groupId: 'surround',
language: 'dubbing',
name: 'Dubbing',
- src: 'audio/stereo/none/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/none/128kbit.m3u8',
+ ),
+
id: 1,
},
],
id: 4,
},
{
- src: 'video/800kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'video/800kbit.m3u8',
+ ),
averageBandwidth: null,
bandwidth: 831270,
codecs: ['avc1.4d4015', 'mp4a.40.2'],
@@ -217,7 +273,10 @@ test('multiple audio streams', async () => {
groupId: 'stereo',
language: 'en',
name: 'English',
- src: 'audio/stereo/en/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/en/128kbit.m3u8',
+ ),
id: 0,
},
{
@@ -227,14 +286,20 @@ test('multiple audio streams', async () => {
groupId: 'stereo',
language: 'dubbing',
name: 'Dubbing',
- src: 'audio/stereo/none/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/none/128kbit.m3u8',
+ ),
id: 1,
},
],
id: 5,
},
{
- src: 'video/500kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'video/500kbit.m3u8',
+ ),
averageBandwidth: null,
bandwidth: 520929,
codecs: ['avc1.4d4015', 'mp4a.40.2'],
@@ -247,7 +312,10 @@ test('multiple audio streams', async () => {
groupId: 'stereo',
language: 'en',
name: 'English',
- src: 'audio/stereo/en/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/en/128kbit.m3u8',
+ ),
id: 0,
},
{
@@ -257,14 +325,20 @@ test('multiple audio streams', async () => {
groupId: 'stereo',
language: 'dubbing',
name: 'Dubbing',
- src: 'audio/stereo/none/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/none/128kbit.m3u8',
+ ),
id: 1,
},
],
id: 6,
},
{
- src: 'video/250kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'video/250kbit.m3u8',
+ ),
averageBandwidth: null,
bandwidth: 258157,
codecs: ['avc1.4d400d', 'mp4a.40.2'],
@@ -277,7 +351,10 @@ test('multiple audio streams', async () => {
groupId: 'stereo',
language: 'en',
name: 'English',
- src: 'audio/stereo/en/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/en/128kbit.m3u8',
+ ),
id: 0,
},
{
@@ -287,7 +364,10 @@ test('multiple audio streams', async () => {
groupId: 'stereo',
language: 'dubbing',
name: 'Dubbing',
- src: 'audio/stereo/none/128kbit.m3u8',
+ src: path.resolve(
+ path.dirname(exampleVideos.separatedAudio),
+ 'audio/stereo/none/128kbit.m3u8',
+ ),
id: 1,
},
],