fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.63k stars 873 forks source link

ytdl-core stream's inputSeek isn't working correctly #1203

Closed Fyphen1223 closed 6 months ago

Fyphen1223 commented 1 year ago

Version information

Code to reproduce

async function main() {
    const stream = ytdl(ytdl.getURLVideoID(YouTube URL), {
        filter: format => format.audioCodec === 'opus' && format.container === 'webm',
        quality: 'highest',
        highWaterMark: 32 * 1024 * 1024,
    })
    .on('end', async function() {
        const seekStream = ffmpeg("./target.webm")
        .seekInput(200)
        .toFormat("webm")
        .pipe(fs.createWriteStream(`./seeked.webm`))
        .on('end', function() {
            console.log('file has been converted succesfully');
        });
        console.log("Finished");
    })
    .pipe(fs.createWriteStream("./target.webm"));
}
main();

Expected results

Should save seeked file to 'seeked,webm'.

Observed results

Just save 478Bytes file

Fyphen1223 commented 6 months ago

lol sry my bad