Recherche avancée

Médias (91)

Sur d’autres sites (147)

  • How to use ffmpeg to extract frames from video and read as a list of images in python in memory without writing files

    11 octobre 2020, par yiy

    At my application server, I have a stream of Webm chunks coming from browsers that users record live videos. I want to analyze each frame simultaneously. So I used python to create a generator yielding the Webm file binaries to feed into ffmpeg. I use the command python convert.py | ffmpeg -i pipe: -r 1 output%3d.jpg to create a set of frames files. (The convert.py is just the generator to yield binary webm data for ffmpeg).

    


    My question is that how can I make the ffmpeg output to a new pipe that in python I can read as a list of images directly ?

    


  • Decoding and playing aac-eld, regular static and oddities

    5 novembre 2017, par comwizz2

    Sample :
    https://soundcloud.com/michael-rogers-43/440hz-scratchy

    I am using ffmpeg to decode some raw aac-eld frames and it seems whenever I try to play it, I get this odd regular popping sound linked above. I am not sure what could be causing this ? To hear a clean version go here and hit play :

    http://www.szynalski.com/tone-generator/

    I am just really not good at audio and have no idea what could cause such an odd but consistent distortion (have tried several tones, and music.)

    The source is supposed to be
    LR channel
    44100 rate

    ffmpeg outputs FTLP (Which oddly seems to be in a range >1 and < -1 at times.)
    Which I have tried converting by hand and using the resample lib.
    I just am not even sure where to start from here ?

  • The problem of code that generated typescript (node-fluent-ffmpeg module)

    10 décembre 2022, par Steve Rock

    This is my typescript code :

    &#xA;&#xA;

    import { NestFactory } from &#x27;@nestjs/core&#x27;;&#xA;import { AppModule } from &#x27;./app.module&#x27;;&#xA;import { FfmpegCommand } from &#x27;fluent-ffmpeg&#x27;&#xA;&#xA;async function bootstrap() {&#xA;  const app = await NestFactory.create(AppModule);&#xA;  let test&#xA;&#xA;  try {&#xA;    test = new FfmpegCommand(&#x27;./adventure.mkv&#x27;);&#xA;  } catch (error) {&#xA;    console.log(error);&#xA;&#xA;  }&#xA;&#xA;  await app.listen(3000);&#xA;}&#xA;&#xA;bootstrap();&#xA;

    &#xA;&#xA;

    Generated Javascript code :

    &#xA;&#xA;

    "use strict";&#xA;var __awaiter = (this &amp;&amp; this.__awaiter) || function (thisArg, _arguments, P, generator) {&#xA;    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }&#xA;    return new (P || (P = Promise))(function (resolve, reject) {&#xA;        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }&#xA;        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }&#xA;        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }&#xA;        step((generator = generator.apply(thisArg, _arguments || [])).next());&#xA;    });&#xA;};&#xA;Object.defineProperty(exports, "__esModule", { value: true });&#xA;const core_1 = require("@nestjs/core");&#xA;const app_module_1 = require("./app.module");&#xA;const fluent_ffmpeg_1 = require("fluent-ffmpeg");&#xA;function bootstrap() {&#xA;    return __awaiter(this, void 0, void 0, function* () {&#xA;        const app = yield core_1.NestFactory.create(app_module_1.AppModule);&#xA;        let test;&#xA;        try {&#xA;            test = new fluent_ffmpeg_1.FfmpegCommand(&#x27;./adventure.mkv&#x27;);&#xA;        }&#xA;        catch (error) {&#xA;            console.log(error);&#xA;        }&#xA;        yield app.listen(3000);&#xA;    });&#xA;}&#xA;bootstrap();&#xA;//# sourceMappingURL=main.js.map&#xA;

    &#xA;&#xA;

    When I run this application I've next error :

    &#xA;&#xA;

    main.ts:12&#xA;message :"fluent_ffmpeg_1.FfmpegCommand is not a constructor"&#xA;stack :"TypeError : fluent_ffmpeg_1.FfmpegCommand is not a constructor\n at c :\nest\dist\src\main.js:20:20\n at Generator.next ()\n at fulfilled (c :\nest\dist\src\main.js:5:58)\n at process._tickCallback (internal/process/next_tick.js:68:7)\n at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)\n at startup (internal/bootstrap/node.js:283:19)\n at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)"

    &#xA;&#xA;

    That's beacause this raw test = new fluent_ffmpeg_1.FfmpegCommand('./adventure.mkv'). When I change this on just test = new fluent_ffmpeg_1('./adventure.mkv') I haven't the error. Do you know how to fix it. If you know where are ffmpeg exapmles on typescript please share with me :)

    &#xA;