shinyoshiaki / werift-webrtc

WebRTC Implementation for TypeScript (Node.js), includes ICE/DTLS/SCTP/RTP/SRTP/WEBM/MP4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Whether it can transfer the raw stream to the Web side

Canees opened this issue · comments

commented

Get the original stream through ffmpeg and add it to the channel for Web-based presentation

I saw the ffmpeg example, which specifies the encoding format, but I need the browser to negotiate the encoding format with it

exp:

    const video= ffmpeg('/dev/video0')
        .size(`480x240`)
        .outputOptions(['-pix_fmt yuv420p'])

    const audio = ffmpeg("plughw:1,0")
        .inputFormat("alsa")
        .audioChannels(1)
        .audioFrequency(48000)
        .audioCodec("pcm_s16le")
        .outputFormat("s16le")

        .format("rawvideo")

There is a sample code to send the video generated by ffmpeg to the browser for your reference.

command

npx ts-node-dev examples/mediachannel/sendonly/ffmpeg.ts
commented

There is a sample code to send the video generated by ffmpeg to the browser for your reference.

command

npx ts-node-dev examples/mediachannel/sendonly/ffmpeg.ts

Thanks, I'll try