I'm having trouble transcoding audio in Superstreamer #188
-
I'm seeing a consistent failure of the audio transcoding task in Superstreamer. Here is how I'm creating a pipeline. import * as wmill from "windmill-client"
type Stream =
| {
type: "video";
codec: string;
height: number;
bitrate: number;
}
| {
type: "audio";
language: string;
codec: string;
bitrate: number;
};
export function generateVideoStreams(sourceHeight: number) {
const videoProfiles = [
{ height: 1080, bitrate: 500000 },
{ height: 720, bitrate: 300000 },
{ height: 360, bitrate: 100000 },
{ height: 160, bitrate: 10000 }
];
return videoProfiles
.filter(profile => profile.height <= sourceHeight)
.map(profile => ({
type: "video",
codec: "h264",
height: profile.height,
bitrate: profile.bitrate
}));
}
export function generateAudioStreams(): Stream[] {
return [
{
type: "audio",
codec: "aac",
language: "en",
bitrate: 300000
}
];
}
function normalizeVideoUrl(video_url: string): string {
// Return as-is if it starts with http or https
if (/^https?:\/\//.test(video_url)) {
return video_url;
}
// Remove leading slash if present
const normalizedPath = video_url.replace(/^\/+/, '');
// Prepend S3 scheme
return `s3://${normalizedPath}`;
}
export async function main(video_url: string, video_height: number) {
let SUPERSTREAMER_API_URL = (await wmill.getVariable('f/fp/SUPERSTREAMER_API_URL'))
let SUPERSTREAMER_API_TOKEN = (await wmill.getVariable('f/fp/SUPERSTREAMER_API_TOKEN'))
video_url = normalizeVideoUrl(video_url)
const streams = generateVideoStreams(video_height).concat(generateAudioStreams());
let res = await fetch(`${SUPERSTREAMER_API_URL}/jobs/pipeline`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${SUPERSTREAMER_API_TOKEN}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
inputs: [
{
type: "video",
path: video_url,
height: video_height
},
{
type: "audio",
path: video_url,
language: "en"
}
],
streams,
group: "fp",
language: "english",
concurrency: 1,
public: false,
})
})
let data = await res.json()
return { body: data, done: true }
} Pipeline shows an error
Transcode shows an error
ffmpeg(audio,en) shows an error
So it looks like there is something going wrong with the ffmpeg command, but I'm not sure what. |
Beta Was this translation helpful? Give feedback.
Answered by
insanity54
May 14, 2025
Replies: 1 comment 1 reply
-
Oh I think I found the problem. The test video I'm using has no audio track |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
insanity54
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh I think I found the problem. The test video I'm using has no audio track