
Recherche avancée
Autres articles (104)
-
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
MediaSPIP Player : problèmes potentiels
22 février 2011, parLe lecteur ne fonctionne pas sur Internet Explorer
Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)
Sur d’autres sites (11732)
-
avcodec/x86/vvc : add alf filter luma and chroma avx2 optimizations
13 mai 2024, par Wu Jianhuaavcodec/x86/vvc : add alf filter luma and chroma avx2 optimizations
ff_vvc_alf_filter_luma_4x4_10_c : 135
ff_vvc_alf_filter_luma_4x4_10_avx2 : 54
ff_vvc_alf_filter_luma_4x8_10_c : 268
ff_vvc_alf_filter_luma_4x8_10_avx2 : 106
ff_vvc_alf_filter_luma_4x12_10_c : 400
ff_vvc_alf_filter_luma_4x12_10_avx2 : 160
ff_vvc_alf_filter_luma_4x16_10_c : 535
ff_vvc_alf_filter_luma_4x16_10_avx2 : 213
ff_vvc_alf_filter_luma_4x20_10_c : 646
ff_vvc_alf_filter_luma_4x20_10_avx2 : 262
ff_vvc_alf_filter_luma_4x24_10_c : 783
ff_vvc_alf_filter_luma_4x24_10_avx2 : 309
ff_vvc_alf_filter_luma_4x28_10_c : 908
ff_vvc_alf_filter_luma_4x28_10_avx2 : 361
ff_vvc_alf_filter_luma_4x32_10_c : 1039
ff_vvc_alf_filter_luma_4x32_10_avx2 : 412
ff_vvc_alf_filter_luma_8x4_10_c : 260
ff_vvc_alf_filter_luma_8x4_10_avx2 : 53
ff_vvc_alf_filter_luma_8x8_10_c : 516
ff_vvc_alf_filter_luma_8x8_10_avx2 : 105
ff_vvc_alf_filter_luma_8x12_10_c : 779
ff_vvc_alf_filter_luma_8x12_10_avx2 : 157
ff_vvc_alf_filter_luma_8x16_10_c : 1038
ff_vvc_alf_filter_luma_8x16_10_avx2 : 210
ff_vvc_alf_filter_luma_8x20_10_c : 1293
ff_vvc_alf_filter_luma_8x20_10_avx2 : 259
ff_vvc_alf_filter_luma_8x24_10_c : 1553
ff_vvc_alf_filter_luma_8x24_10_avx2 : 309
ff_vvc_alf_filter_luma_8x28_10_c : 1815
ff_vvc_alf_filter_luma_8x28_10_avx2 : 361
ff_vvc_alf_filter_luma_8x32_10_c : 2067
ff_vvc_alf_filter_luma_8x32_10_avx2 : 419
ff_vvc_alf_filter_luma_12x4_10_c : 390
ff_vvc_alf_filter_luma_12x4_10_avx2 : 54
ff_vvc_alf_filter_luma_12x8_10_c : 773
ff_vvc_alf_filter_luma_12x8_10_avx2 : 107
ff_vvc_alf_filter_luma_12x12_10_c : 1159
ff_vvc_alf_filter_luma_12x12_10_avx2 : 155
ff_vvc_alf_filter_luma_12x16_10_c : 1550
ff_vvc_alf_filter_luma_12x16_10_avx2 : 207
ff_vvc_alf_filter_luma_12x20_10_c : 1970
ff_vvc_alf_filter_luma_12x20_10_avx2 : 260
ff_vvc_alf_filter_luma_12x24_10_c : 2379
ff_vvc_alf_filter_luma_12x24_10_avx2 : 309
ff_vvc_alf_filter_luma_12x28_10_c : 2763
ff_vvc_alf_filter_luma_12x28_10_avx2 : 362
ff_vvc_alf_filter_luma_12x32_10_c : 3158
ff_vvc_alf_filter_luma_12x32_10_avx2 : 419
ff_vvc_alf_filter_luma_16x4_10_c : 523
ff_vvc_alf_filter_luma_16x4_10_avx2 : 53
ff_vvc_alf_filter_luma_16x8_10_c : 1049
ff_vvc_alf_filter_luma_16x8_10_avx2 : 103
ff_vvc_alf_filter_luma_16x12_10_c : 1566
ff_vvc_alf_filter_luma_16x12_10_avx2 : 159
ff_vvc_alf_filter_luma_16x16_10_c : 2078
ff_vvc_alf_filter_luma_16x16_10_avx2 : 211
ff_vvc_alf_filter_luma_16x20_10_c : 2631
ff_vvc_alf_filter_luma_16x20_10_avx2 : 259
ff_vvc_alf_filter_luma_16x24_10_c : 3149
ff_vvc_alf_filter_luma_16x24_10_avx2 : 316
ff_vvc_alf_filter_luma_16x28_10_c : 3631
ff_vvc_alf_filter_luma_16x28_10_avx2 : 359
ff_vvc_alf_filter_luma_16x32_10_c : 4233
ff_vvc_alf_filter_luma_16x32_10_avx2 : 428
ff_vvc_alf_filter_luma_20x4_10_c : 649
ff_vvc_alf_filter_luma_20x4_10_avx2 : 106
ff_vvc_alf_filter_luma_20x8_10_c : 1294
ff_vvc_alf_filter_luma_20x8_10_avx2 : 206
ff_vvc_alf_filter_luma_20x12_10_c : 1936
ff_vvc_alf_filter_luma_20x12_10_avx2 : 310
ff_vvc_alf_filter_luma_20x16_10_c : 2594
ff_vvc_alf_filter_luma_20x16_10_avx2 : 411
ff_vvc_alf_filter_luma_20x20_10_c : 3234
ff_vvc_alf_filter_luma_20x20_10_avx2 : 517
ff_vvc_alf_filter_luma_20x24_10_c : 3894
ff_vvc_alf_filter_luma_20x24_10_avx2 : 621
ff_vvc_alf_filter_luma_20x28_10_c : 4542
ff_vvc_alf_filter_luma_20x28_10_avx2 : 722
ff_vvc_alf_filter_luma_20x32_10_c : 5205
ff_vvc_alf_filter_luma_20x32_10_avx2 : 832
ff_vvc_alf_filter_luma_24x4_10_c : 774
ff_vvc_alf_filter_luma_24x4_10_avx2 : 104
ff_vvc_alf_filter_luma_24x8_10_c : 1546
ff_vvc_alf_filter_luma_24x8_10_avx2 : 206
ff_vvc_alf_filter_luma_24x12_10_c : 2318
ff_vvc_alf_filter_luma_24x12_10_avx2 : 312
ff_vvc_alf_filter_luma_24x16_10_c : 3104
ff_vvc_alf_filter_luma_24x16_10_avx2 : 411
ff_vvc_alf_filter_luma_24x20_10_c : 3893
ff_vvc_alf_filter_luma_24x20_10_avx2 : 513
ff_vvc_alf_filter_luma_24x24_10_c : 4681
ff_vvc_alf_filter_luma_24x24_10_avx2 : 616
ff_vvc_alf_filter_luma_24x28_10_c : 5474
ff_vvc_alf_filter_luma_24x28_10_avx2 : 721
ff_vvc_alf_filter_luma_24x32_10_c : 6271
ff_vvc_alf_filter_luma_24x32_10_avx2 : 832
ff_vvc_alf_filter_luma_28x4_10_c : 907
ff_vvc_alf_filter_luma_28x4_10_avx2 : 103
ff_vvc_alf_filter_luma_28x8_10_c : 1797
ff_vvc_alf_filter_luma_28x8_10_avx2 : 206
ff_vvc_alf_filter_luma_28x12_10_c : 2708
ff_vvc_alf_filter_luma_28x12_10_avx2 : 309
ff_vvc_alf_filter_luma_28x16_10_c : 3632
ff_vvc_alf_filter_luma_28x16_10_avx2 : 413
ff_vvc_alf_filter_luma_28x20_10_c : 4537
ff_vvc_alf_filter_luma_28x20_10_avx2 : 519
ff_vvc_alf_filter_luma_28x24_10_c : 5463
ff_vvc_alf_filter_luma_28x24_10_avx2 : 616
ff_vvc_alf_filter_luma_28x28_10_c : 6372
ff_vvc_alf_filter_luma_28x28_10_avx2 : 719
ff_vvc_alf_filter_luma_28x32_10_c : 7274
ff_vvc_alf_filter_luma_28x32_10_avx2 : 823
ff_vvc_alf_filter_luma_32x4_10_c : 1029
ff_vvc_alf_filter_luma_32x4_10_avx2 : 104
ff_vvc_alf_filter_luma_32x8_10_c : 2060
ff_vvc_alf_filter_luma_32x8_10_avx2 : 206
ff_vvc_alf_filter_luma_32x12_10_c : 3112
ff_vvc_alf_filter_luma_32x12_10_avx2 : 307
ff_vvc_alf_filter_luma_32x16_10_c : 4161
ff_vvc_alf_filter_luma_32x16_10_avx2 : 413
ff_vvc_alf_filter_luma_32x20_10_c : 5211
ff_vvc_alf_filter_luma_32x20_10_avx2 : 514
ff_vvc_alf_filter_luma_32x24_10_c : 6238
ff_vvc_alf_filter_luma_32x24_10_avx2 : 614
ff_vvc_alf_filter_luma_32x28_10_c : 7261
ff_vvc_alf_filter_luma_32x28_10_avx2 : 720
ff_vvc_alf_filter_luma_32x32_10_c : 8312
ff_vvc_alf_filter_luma_32x32_10_avx2 : 819
ff_vvc_alf_filter_chroma_4x4_10_c : 70
ff_vvc_alf_filter_chroma_4x4_10_avx2 : 53
ff_vvc_alf_filter_chroma_4x8_10_c : 139
ff_vvc_alf_filter_chroma_4x8_10_avx2 : 104
ff_vvc_alf_filter_chroma_4x12_10_c : 208
ff_vvc_alf_filter_chroma_4x12_10_avx2 : 155
ff_vvc_alf_filter_chroma_4x16_10_c : 275
ff_vvc_alf_filter_chroma_4x16_10_avx2 : 218
ff_vvc_alf_filter_chroma_4x20_10_c : 344
ff_vvc_alf_filter_chroma_4x20_10_avx2 : 257
ff_vvc_alf_filter_chroma_4x24_10_c : 411
ff_vvc_alf_filter_chroma_4x24_10_avx2 : 309
ff_vvc_alf_filter_chroma_4x28_10_c : 481
ff_vvc_alf_filter_chroma_4x28_10_avx2 : 361
ff_vvc_alf_filter_chroma_4x32_10_c : 545
ff_vvc_alf_filter_chroma_4x32_10_avx2 : 411
ff_vvc_alf_filter_chroma_8x4_10_c : 138
ff_vvc_alf_filter_chroma_8x4_10_avx2 : 53
ff_vvc_alf_filter_chroma_8x8_10_c : 274
ff_vvc_alf_filter_chroma_8x8_10_avx2 : 106
ff_vvc_alf_filter_chroma_8x12_10_c : 422
ff_vvc_alf_filter_chroma_8x12_10_avx2 : 158
ff_vvc_alf_filter_chroma_8x16_10_c : 545
ff_vvc_alf_filter_chroma_8x16_10_avx2 : 206
ff_vvc_alf_filter_chroma_8x20_10_c : 683
ff_vvc_alf_filter_chroma_8x20_10_avx2 : 257
ff_vvc_alf_filter_chroma_8x24_10_c : 816
ff_vvc_alf_filter_chroma_8x24_10_avx2 : 312
ff_vvc_alf_filter_chroma_8x28_10_c : 951
ff_vvc_alf_filter_chroma_8x28_10_avx2 : 359
ff_vvc_alf_filter_chroma_8x32_10_c : 1098
ff_vvc_alf_filter_chroma_8x32_10_avx2 : 409
ff_vvc_alf_filter_chroma_12x4_10_c : 204
ff_vvc_alf_filter_chroma_12x4_10_avx2 : 53
ff_vvc_alf_filter_chroma_12x8_10_c : 410
ff_vvc_alf_filter_chroma_12x8_10_avx2 : 104
ff_vvc_alf_filter_chroma_12x12_10_c : 614
ff_vvc_alf_filter_chroma_12x12_10_avx2 : 155
ff_vvc_alf_filter_chroma_12x16_10_c : 814
ff_vvc_alf_filter_chroma_12x16_10_avx2 : 210
ff_vvc_alf_filter_chroma_12x20_10_c : 1017
ff_vvc_alf_filter_chroma_12x20_10_avx2 : 258
ff_vvc_alf_filter_chroma_12x24_10_c : 1221
ff_vvc_alf_filter_chroma_12x24_10_avx2 : 308
ff_vvc_alf_filter_chroma_12x28_10_c : 1423
ff_vvc_alf_filter_chroma_12x28_10_avx2 : 366
ff_vvc_alf_filter_chroma_12x32_10_c : 1624
ff_vvc_alf_filter_chroma_12x32_10_avx2 : 410
ff_vvc_alf_filter_chroma_16x4_10_c : 272
ff_vvc_alf_filter_chroma_16x4_10_avx2 : 52
ff_vvc_alf_filter_chroma_16x8_10_c : 541
ff_vvc_alf_filter_chroma_16x8_10_avx2 : 105
ff_vvc_alf_filter_chroma_16x12_10_c : 812
ff_vvc_alf_filter_chroma_16x12_10_avx2 : 155
ff_vvc_alf_filter_chroma_16x16_10_c : 1091
ff_vvc_alf_filter_chroma_16x16_10_avx2 : 206
ff_vvc_alf_filter_chroma_16x20_10_c : 1354
ff_vvc_alf_filter_chroma_16x20_10_avx2 : 257
ff_vvc_alf_filter_chroma_16x24_10_c : 1637
ff_vvc_alf_filter_chroma_16x24_10_avx2 : 313
ff_vvc_alf_filter_chroma_16x28_10_c : 1899
ff_vvc_alf_filter_chroma_16x28_10_avx2 : 359
ff_vvc_alf_filter_chroma_16x32_10_c : 2161
ff_vvc_alf_filter_chroma_16x32_10_avx2 : 410
ff_vvc_alf_filter_chroma_20x4_10_c : 339
ff_vvc_alf_filter_chroma_20x4_10_avx2 : 103
ff_vvc_alf_filter_chroma_20x8_10_c : 681
ff_vvc_alf_filter_chroma_20x8_10_avx2 : 207
ff_vvc_alf_filter_chroma_20x12_10_c : 1013
ff_vvc_alf_filter_chroma_20x12_10_avx2 : 307
ff_vvc_alf_filter_chroma_20x16_10_c : 1349
ff_vvc_alf_filter_chroma_20x16_10_avx2 : 415
ff_vvc_alf_filter_chroma_20x20_10_c : 1685
ff_vvc_alf_filter_chroma_20x20_10_avx2 : 522
ff_vvc_alf_filter_chroma_20x24_10_c : 2037
ff_vvc_alf_filter_chroma_20x24_10_avx2 : 622
ff_vvc_alf_filter_chroma_20x28_10_c : 2380
ff_vvc_alf_filter_chroma_20x28_10_avx2 : 733
ff_vvc_alf_filter_chroma_20x32_10_c : 2712
ff_vvc_alf_filter_chroma_20x32_10_avx2 : 838
ff_vvc_alf_filter_chroma_24x4_10_c : 408
ff_vvc_alf_filter_chroma_24x4_10_avx2 : 104
ff_vvc_alf_filter_chroma_24x8_10_c : 818
ff_vvc_alf_filter_chroma_24x8_10_avx2 : 207
ff_vvc_alf_filter_chroma_24x12_10_c : 1219
ff_vvc_alf_filter_chroma_24x12_10_avx2 : 308
ff_vvc_alf_filter_chroma_24x16_10_c : 1648
ff_vvc_alf_filter_chroma_24x16_10_avx2 : 420
ff_vvc_alf_filter_chroma_24x20_10_c : 2061
ff_vvc_alf_filter_chroma_24x20_10_avx2 : 525
ff_vvc_alf_filter_chroma_24x24_10_c : 2437
ff_vvc_alf_filter_chroma_24x24_10_avx2 : 617
ff_vvc_alf_filter_chroma_24x28_10_c : 2832
ff_vvc_alf_filter_chroma_24x28_10_avx2 : 722
ff_vvc_alf_filter_chroma_24x32_10_c : 3271
ff_vvc_alf_filter_chroma_24x32_10_avx2 : 830
ff_vvc_alf_filter_chroma_28x4_10_c : 476
ff_vvc_alf_filter_chroma_28x4_10_avx2 : 104
ff_vvc_alf_filter_chroma_28x8_10_c : 948
ff_vvc_alf_filter_chroma_28x8_10_avx2 : 205
ff_vvc_alf_filter_chroma_28x12_10_c : 1420
ff_vvc_alf_filter_chroma_28x12_10_avx2 : 310
ff_vvc_alf_filter_chroma_28x16_10_c : 1889
ff_vvc_alf_filter_chroma_28x16_10_avx2 : 423
ff_vvc_alf_filter_chroma_28x20_10_c : 2372
ff_vvc_alf_filter_chroma_28x20_10_avx2 : 513
ff_vvc_alf_filter_chroma_28x24_10_c : 2843
ff_vvc_alf_filter_chroma_28x24_10_avx2 : 618
ff_vvc_alf_filter_chroma_28x28_10_c : 3307
ff_vvc_alf_filter_chroma_28x28_10_avx2 : 724
ff_vvc_alf_filter_chroma_28x32_10_c : 3801
ff_vvc_alf_filter_chroma_28x32_10_avx2 : 827
ff_vvc_alf_filter_chroma_32x4_10_c : 543
ff_vvc_alf_filter_chroma_32x4_10_avx2 : 105
ff_vvc_alf_filter_chroma_32x8_10_c : 1084
ff_vvc_alf_filter_chroma_32x8_10_avx2 : 206
ff_vvc_alf_filter_chroma_32x12_10_c : 1621
ff_vvc_alf_filter_chroma_32x12_10_avx2 : 309
ff_vvc_alf_filter_chroma_32x16_10_c : 2173
ff_vvc_alf_filter_chroma_32x16_10_avx2 : 408
ff_vvc_alf_filter_chroma_32x20_10_c : 2703
ff_vvc_alf_filter_chroma_32x20_10_avx2 : 513
ff_vvc_alf_filter_chroma_32x24_10_c : 3245
ff_vvc_alf_filter_chroma_32x24_10_avx2 : 612
ff_vvc_alf_filter_chroma_32x28_10_c : 3795
ff_vvc_alf_filter_chroma_32x28_10_avx2 : 722
ff_vvc_alf_filter_chroma_32x32_10_c : 4339
ff_vvc_alf_filter_chroma_32x32_10_avx2 : 820Signed-off-by : Wu Jianhua <toqsxw@outlook.com>
-
Error transcoding with FFmpeg : Error : Output format hls is not available
6 mai 2024, par asif mohmdI am using FFmpeg library to transcode a video file into multiple resolutions and create an HLS (HTTP Live Streaming) master playlist.


It takes a video file as input but its does give me the output with HLS playlist.I got a error called "Output format hls is not available". Only the Output directory is creating


I am using FFMpeg 7.0 full build version and also tried older versions and ffmpeg essentials and also tried chocolatey.


if i remove the implementation of HLS from this code.it will create 4 different resolution videos in my output.


Note:I just tried this same code on my friend MAC Book by only changing the setffmpegPath : "ffmpeg.setFfmpegPath("C :\ffmpeg\bin\ffmpeg.exe") ;" to his ffmpeg directory.
Its working perfectly in his mac book


import "dotenv/config";
import * as fs from "fs";
import * as path from "path";
import ffmpeg from "fluent-ffmpeg";
import crypto from "crypto";

ffmpeg.setFfmpegPath("C:\\ffmpeg\\bin\\ffmpeg.exe");

export const FFmpegTranscoder = async (file: any): Promise<any> => {
 try {
 console.log("Starting script");
 console.time("req_time");

 const randomName = (bytes = 32) =>
 crypto.randomBytes(bytes).toString("hex");
 const fileName = randomName();
 const directoryPath = path.join(__dirname, "..", "..", "input");
 const filePath = path.join(directoryPath, `${fileName}.mp4`);

 if (!fs.existsSync(directoryPath)) {
 fs.mkdirSync(directoryPath, { recursive: true });
 }

 const paths = await new Promise<any>((resolve, reject) => {
 fs.writeFile(filePath, file, async (err) => {
 if (err) {
 console.error("Error saving file:", err);
 throw err;
 }
 console.log("File saved successfully:", filePath);

 try {
 const outputDirectoryPath = await transcodeWithFFmpeg(
 fileName,
 filePath
 );
 resolve({ directoryPath, filePath, fileName, outputDirectoryPath });
 } catch (error) {
 console.error("Error transcoding with FFmpeg:", error);
 }
 });
 });
 return paths;
 } catch (e: any) {
 console.log(e);
 }
};

const transcodeWithFFmpeg = async (fileName: string, filePath: string) => {
 const directoryPath = path.join(
 __dirname,
 "..",
 "..",
 `output/hls/${fileName}`
 );

 if (!fs.existsSync(directoryPath)) {
 fs.mkdirSync(directoryPath, { recursive: true });
 }

 const resolutions = [
 {
 resolution: "256x144",
 videoBitrate: "200k",
 audioBitrate: "64k",
 },
 {
 resolution: "640x360",
 videoBitrate: "800k",
 audioBitrate: "128k",
 },
 {
 resolution: "1280x720",
 videoBitrate: "2500k",
 audioBitrate: "192k",
 },
 {
 resolution: "1920x1080",
 videoBitrate: "5000k",
 audioBitrate: "256k",
 },
 ];

 const variantPlaylists: { resolution: string; outputFileName: string }[] = [];

 for (const { resolution, videoBitrate, audioBitrate } of resolutions) {
 console.log(`HLS conversion starting for ${resolution}`);
 const outputFileName = `${fileName}_${resolution}.m3u8`;
 const segmentFileName = `${fileName}_${resolution}_%03d.ts`;

 await new Promise<void>((resolve, reject) => {
 ffmpeg(filePath)
 .outputOptions([
 `-c:v h264`,
 `-b:v ${videoBitrate}`,
 `-c:a aac`,
 `-b:a ${audioBitrate}`,
 `-vf scale=${resolution}`,
 `-f hls`,
 `-hls_time 10`,
 `-hls_list_size 0`,
 `-hls_segment_filename ${directoryPath}/${segmentFileName}`,
 ])
 .output(`${directoryPath}/${outputFileName}`)
 .on("end", () => resolve())
 .on("error", (err) => reject(err))
 .run();
 });
 const variantPlaylist = {
 resolution,
 outputFileName,
 };
 variantPlaylists.push(variantPlaylist);
 console.log(`HLS conversion done for ${resolution}`);
 }
 console.log(`HLS master m3u8 playlist generating`);

 let masterPlaylist = variantPlaylists
 .map((variantPlaylist) => {
 const { resolution, outputFileName } = variantPlaylist;
 const bandwidth =
 resolution === "256x144"
 ? 264000
 : resolution === "640x360"
 ? 1024000
 : resolution === "1280x720"
 ? 3072000
 : 5500000;
 ``;
 return `#EXT-X-STREAM-INF:BANDWIDTH=${bandwidth},RESOLUTION=${resolution}\n${outputFileName}`;
 })
 .join("\n");
 masterPlaylist = `#EXTM3U\n` + masterPlaylist;

 const masterPlaylistFileName = `${fileName}_master.m3u8`;

 const masterPlaylistPath = `${directoryPath}/${masterPlaylistFileName}`;
 fs.writeFileSync(masterPlaylistPath, masterPlaylist);
 console.log(`HLS master m3u8 playlist generated`);
 return directoryPath;
};
</void></any></any>


My console.log is :


Starting script
 HLS conversion starting for 256x144
 Error transcoding with FFmpeg: Error: Output format hls is not available
 at C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\fluent-ffmpeg\lib\capabilities.js:589:21
 at nextTask (C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\async\dist\async.js:5791:13)
 at next (C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\async\dist\async.js:5799:13)
 at C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\async\dist\async.js:329:20
 at C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\fluent-ffmpeg\lib\capabilities.js:549:7
 at handleExit (C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\fluent-ffmpeg\lib\processor.js:170:11)
 at ChildProcess.<anonymous> (C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\fluent-ffmpeg\lib\processor.js:184:11)
 at ChildProcess.emit (node:events:518:28)
 at ChildProcess.emit (node:domain:488:12)
 at Process.ChildProcess._handle.onexit (node:internal/child_process:294:12) 
</anonymous>


I am using Windows 11 and FFMpeg version 7.0. I repeatedly checked, using CMD commands, that my FFMpeg was installed correctly and confirmed the environment variables path, experimented with various FFMpeg versions, and tried with FFMpeg full build Chocolatey package.


In Command Line its working perfectly :


PS C:\Users\asifa\Desktop\test fmmpeg> ffmpeg -hide_banner -y -i .\SampleVideo_1280x720_30mb.mp4 -vf scale=w=640:h=360:force_original_aspect_ratio=decrease -c:a aac -b:v 800k -c:v h264 -b:a 128k -f hls -hls_time 14 -hls_list_size 0 -hls_segment_filename beach/480p_%03d.ts beach/480p.m3u8
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\SampleVideo_1280x720_30mb.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 creation_time : 1970-01-01T00:00:00.000000Z
 encoder : Lavf53.24.2
 Duration: 00:02:50.86, start: 0.000000, bitrate: 1474 kb/s
 Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 1086 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
 Metadata:
 creation_time : 1970-01-01T00:00:00.000000Z
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
 Metadata:
 creation_time : 1970-01-01T00:00:00.000000Z
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 000001ef1288ec00] using SAR=1/1
[libx264 @ 000001ef1288ec00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001ef1288ec00] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 000001ef1288ec00] 264 - core 164 r3190 7ed753b - H.264/MPEG-4 AVC codec - Copyleft 2003-2024 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=11 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=800 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, hls, to 'beach/480p.m3u8':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf61.1.100
 Stream #0:0(und): Video: h264, yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 800 kb/s, 25 fps, 90k tbn (default)
 Metadata:
 creation_time : 1970-01-01T00:00:00.000000Z
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 encoder : Lavc61.3.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/800000 buffer size: 0 vbv_delay: N/A
 Stream #0:1(und): Audio: aac (LC), 48000 Hz, 5.1, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 1970-01-01T00:00:00.000000Z
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
 encoder : Lavc61.3.100 aac
[hls @ 000001ef12482040] Opening 'beach/480p_000.ts' for writing speed=15.5x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_001.ts' for writing speed=17.9x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_002.ts' for writing speed=17.3x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_003.ts' for writing speed=19.4x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_004.ts' for writing speed=19.3x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_005.ts' for writing speed=19.2x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_006.ts' for writing
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_007.ts' for writing speed=19.4x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_008.ts' for writing speed=19.5x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_009.ts' for writing speed=19.5x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_010.ts' for writing speed=19.4x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[hls @ 000001ef12482040] Opening 'beach/480p_011.ts' for writing/A =19.4x
[hls @ 000001ef12482040] Opening 'beach/480p.m3u8.tmp' for writing
[out#0/hls @ 000001ef11d4e880] video:17094KiB audio:2680KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
frame= 4271 fps=485 q=-1.0 Lsize=N/A time=00:02:50.76 bitrate=N/A speed=19.4x
[libx264 @ 000001ef1288ec00] frame I:45 Avg QP:10.29 size: 60418
[libx264 @ 000001ef1288ec00] frame P:1914 Avg QP:14.53 size: 5582
[libx264 @ 000001ef1288ec00] frame B:2312 Avg QP:20.63 size: 1774
[libx264 @ 000001ef1288ec00] consecutive B-frames: 22.9% 11.9% 8.6% 56.6%
[libx264 @ 000001ef1288ec00] mb I I16..4: 15.6% 32.1% 52.2%
[libx264 @ 000001ef1288ec00] mb P I16..4: 0.3% 3.4% 1.2% P16..4: 20.3% 10.0% 13.1% 0.0% 0.0% skip:51.8%
[libx264 @ 000001ef1288ec00] mb B I16..4: 0.1% 0.9% 0.4% B16..8: 17.2% 5.6% 2.8% direct: 2.0% skip:71.0% L0:41.5% L1:44.1% BI:14.4%
[libx264 @ 000001ef1288ec00] final ratefactor: 16.13
[libx264 @ 000001ef1288ec00] 8x8 transform intra:58.4% inter:51.7%
[libx264 @ 000001ef1288ec00] coded y,uvDC,uvAC intra: 86.7% 94.3% 78.8% inter: 12.6% 15.0% 4.5%
[libx264 @ 000001ef1288ec00] i16 v,h,dc,p: 17% 42% 14% 28%
[libx264 @ 000001ef1288ec00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 19% 11% 6% 7% 8% 8% 9% 9%
[libx264 @ 000001ef1288ec00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 18% 12% 6% 9% 9% 8% 8% 7%
[libx264 @ 000001ef1288ec00] i8c dc,h,v,p: 44% 24% 20% 12%
[libx264 @ 000001ef1288ec00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 000001ef1288ec00] ref P L0: 78.3% 9.7% 8.8% 3.2%
[libx264 @ 000001ef1288ec00] ref B L0: 92.5% 6.0% 1.5%
[libx264 @ 000001ef1288ec00] ref B L1: 97.1% 2.9%
[libx264 @ 000001ef1288ec00] kb/s:819.63
[aac @ 000001ef128f7c80] Qavg: 452.137



When I use the
.on('start', (cmdline) => console.log(cmdline))}
code with the-f hls
command, the error "Output format hls is not available" appears, as previously mentioned. But my Console.log looks like this if I run my code without using-f hls
command :

Without -f hls command


await new Promise<void>((resolve, reject) => {
 ffmpeg(filePath)
 .outputOptions([
 `-c:v h264`,
 `-b:v ${videoBitrate}`,
 `-c:a aac`,
 `-b:a ${audioBitrate}`,
 `-vf scale=${resolution}`,
 
 `-hls_time 10`,
 `-hls_list_size 0`,
 `-hls_segment_filename ${directoryPath}/${segmentFileName}`,
 ])
 .output(`${directoryPath}/${outputFileName}`)
 .on('start', (cmdline) => console.log(cmdline)) 
 .on("end", () => resolve())
 .on("error", (err) => reject(err))
 .run();
});
</void>


Console.log is :


`Starting script
File saved successfully: C:\Users\asifa\Desktop\Genius Grid\Transcode-service\input\c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1.mp4
HLS conversion starting for 256x144
ffmpeg -i C:\Users\asifa\Desktop\Genius Grid\Transcode-service\input\c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1.mp4 -y -c:v h264 -b:v 200k -c:a aac -b:a 64k -vf scale=256x144 -hls_time 10 -hls_list_size 0 -hls_segment_filename C:\Users\asifa\Desktop\Genius Grid\Transcode-service\output\hls\c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1/c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1_256x144_%03d.ts C:\Users\asifa\Desktop\Genius Grid\Transcode-service\output\hls\c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1/c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1_256x144.m3u8
Error transcoding with FFmpeg: Error: ffmpeg exited with code 2880417800: Unrecognized option 'hls_segment_filename C:\Users\asifa\Desktop\Genius Grid\Transcode-service\output\hls\c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1/c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1_256x144_%03d.ts'.
Error splitting the argument list: Option not found`



-
node.js ffmpeg spawn child_process unexpected data output and not possible to kill or stop
1er septembre 2021, par PLNR
I'm rather new to backend stuff, so please excuse, if my question is trivial.

For an Intranet project, I want to present a video element in a webpage (React, HLS.js Player) with the possibility reload the stream in case it hung.

The video sources are mpeg-ts streams delivered as udp multicast.

A small node.js / express server should handle the ffmpeg commands, to transcode the multicast to hls to display them in a browser.



My Problem is, that I am unable to stop the process...

I've tried to SIGINT, SIGTERM the process with it's pid, but the encoding is just going on.

Here is the code I wrote for transcoding so far :


const express = require("express");
const { spawn, exec } = require("child_process");
const cors = require("cors");
const process = require("process")

let ls;
let pid;

const app = express();

app.use(cors());

app.get('/cam/:source', (body) => {
 const cam = body.params.source;
 console.log(cam);

 let source = "udp://239.1.1.1:4444";
 let stream = "/var/www/html/streams/tmp/cam1.m3u8"


 stream = spawn("ffmpeg", ["-re", "-i", source, "-c:v", "libx264", "-crf", "21", "-preset", "veryfast", "-c:a", "aac", "-b:a", "128k", "-ac", "2", "-f", "hls", "-hls_list_size", "5", "-hls_flags", "delete_segments", stream], {detached: true});

 pid = stream.pid;

 stream.stdout.on("data", data => {
 console.log(`stdout: ${data}`);
 });

 stream.stderr.on("data", data => {
 console.log(`stderr: ${data}`);
 console.log("pid: ", pid);
 });

 stream.on("error", error => {
 console.log(`error: ${error.message}`);
 });

 stream.on("close", code => {
 console.log(`child process exited with code ${code}`);
 });
})

app.get('/cam/quit', () => {
 process.kill(pid, 'SIGINT')
})

app.listen(5000, ()=> {
 console.log('Listening');
})



On requesting the /cam/quit i would expect the process to stop... but it doesn't.

I've tried :

app.get('/cam/quit', () => {
 process.kill(pid, 'SIGINT')
})



app.get('/cam/quit', () => {
 process.kill(stream.pid, 'SIGINT')
})



app.get('/cam/quit', () => {
 stream.kill(pid, 'SIGINT')
})



app.get('/cam/quit', () => {
 stream.kill(0, 'SIGINT')
})



But none of this worked... do I miss something ? Is there something I need to change ?


Problem 2 - Output :

The output is emitted on stderr... even the process is working as expected.

This is maybe only cosmetics, but it makes me wondering.

Here is the terminal output :

[nodemon] starting `node server.js`
Listening
camera stream reloaded
stderr: ffmpeg version 4.3.2-0+deb11u1ubuntu1 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10 (Ubuntu 10.2.1-20ubuntu1)
 configuration: --prefix=/usr --extra-version=0+deb11u1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100

pid: 4206
stderr: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'udp://239.1.1.1':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 creation_time : 
pid: 4206
stderr: 1970-01-01T00:00:00.000000Z
 encoder : Lavf52.54.0
 Duration: 01:55:59.20, start: 0.000000, bitrate: 1436 kb/s
 Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 720x384 [SAR 1:1 DAR 15:8], 1272 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
 Metadata:
 creation_time : 1970-01-01T00:00:00.000000Z
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
 Metadata:
 creation_time : 1970-01-01T00:00:00.000000Z
 handler_name : SoundHandler

pid: 4206
stderr: Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help

pid: 4206
stderr: [libx264 @ 0x5616b38b5440] using SAR=1/1

pid: 4206
stderr: [libx264 @ 0x5616b38b5440] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2

pid: 4206
stderr: [libx264 @ 0x5616b38b5440] profile High, level 3.0, 4:2:0, 8-bit

pid: 4206
stderr: [libx264 @ 0x5616b38b5440] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=21.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, hls, to '/var/www/html/streams/tmp/aft.m3u8':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.45.100
 Stream #0:0(und): Video: h264 (libx264), yuv420p, 720x384 [SAR 1:1 DAR 15:8], q=-1--1, 25 fps, 90k tbn, 25 tbc (default)
 Metadata:
 creation_time : 1970-01-01T00:00:00.000000Z
 handler_name : VideoHandler
 encoder : Lavc58.91.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
 Stream #0:1(und): Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 1970-01-01T00:00:00.000000Z
 handler_name : SoundHandler
 encoder : Lavc58.91.100 aac

pid: 4206
stderr: frame= 8 fps=0.0 q=0.0 size=N/A time=00:00:00.46 bitrate=N/A speed=0.931x 
pid: 4206
stderr: frame= 21 fps= 21 q=26.0 size=N/A time=00:00:00.96 bitrate=N/A speed=0.95x 
pid: 4206
stderr: frame= 33 fps= 22 q=26.0 size=N/A time=00:00:01.49 bitrate=N/A speed=0.982x 
pid: 4206
stderr: frame= 46 fps= 23 q=26.0 size=N/A time=00:00:02.00 bitrate=N/A speed=0.989x 
pid: 4206
stderr: frame= 58 fps= 23 q=26.0 size=N/A time=00:00:02.49 bitrate=N/A speed=0.986x 
pid: 4206



and so on...



Any help would be highly appreciated !

Many thanks in advance