trickyc0d3r / tgcalls-next

Community fork of tgcallsjs with built-in GramJS support.

Home Page:https://tgcalls-next.github.io/tgcalls

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tgcalls-next

npm

TGCalls Next is a community fork of tgcallsjs, which is merged with gram-tgcalls to support GramJS directly.

Documentation

The documentation is available at https://tgcalls-next.github.io/tgcalls.

Example Usage

import { createReadStream } from "fs";
import { TelegramClient } from "telegram";
import { TGCalls, Stream } from "tgcalls-next";

const client = new TelegramClient(session, 0, "", {});

(async () => {
  await client.start();

  const tgcalls = new TGCalls(client, -1234567890);
  const stream = new Stream({ audio: createReadStream("audio.raw"), video: createReadStream("video.raw"), ... })

  await tgcalls.stream(stream);
})();

Required Media Properties

Audio

  • Format: s16le
  • Channels: 1
  • Bitrate: 65K or what you provided in the StreamOptions

Video

  • Format: rawvideo
  • Dimensions: min 640x360, max 1280x720
  • FPS: min 24, max 30

Conversion w/ FFmpeg

Audio

ffmpeg -i [input] -f s16le -ac 1 -ar 65K [output]

Video

ffmpeg -i [input] -f rawvideo -r 24 -vf scale=640:-1 [output]

Both

ffmpeg -i [input video with sound] -f rawvideo -r 24 -vf scale=640:-1 [video output] -f s16le -ac 1 -ar 65K [audio output]

Please note that the above commands are using default values of configurable options.

About

Community fork of tgcallsjs with built-in GramJS support.

https://tgcalls-next.github.io/tgcalls

License:GNU Lesser General Public License v3.0


Languages

Language:TypeScript 100.0%