Recherche avancée

Médias (0)

Mot : - Tags -/médias

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (66)

Sur d’autres sites (13939)

  • Video overlay of several network inputs using ffmpeg

    1er juin 2018, par Hristo Ivanov

    I am writing my first program using the FFMPEG libraries, unfortunately it’s not a simple one.

    What I need is to :

    • capture several network inputs(udp).
    • demux the inputs.
    • overlay the video streams.
    • mix the audio(or some other logic).
    • encode the resulting streams.
    • remux the streams and write the result to file.

    For now I am playing with the ffmpeg.exe tool trying achieve this functionality. The command I have looks like this :

    .\ffmpeg.exe -threads auto -y -i input0 -i input1 \
       -filter_complex "[0:v]scale=1920x1080[v0];[1:v]scale=480x270[v1];[v0][v1]overlay=1440:810[v2]" \
       -map [v2] -map 0:a -c:v libx264 -preset ultrafast -c:a copy output.mp4

    When input0 and input1 are files the resulting output is correct, on the other hand, when the inputs are udp streams the resulting output is not correct, the video freezes most of the time.

    The file inputs are generated from the udp streams, using the following command :

    .\ffmpeg.exe -threads auto -y -i "udp://@ip:port" -c copy -f mpegts input1.mpg

    Question 1.
    Why is the above command not producing good ouput for udp streams ? What are the differences between the original stream and the dump of that stream for ffmpeg.exe.

    Question 2.
    Is there some argument/s that can fix the command ?

    Question 3.
    What kind of logic/algorithm is needed to correctly overlay two network streams.

  • how to change ffmpeg font in AWS lambda ?

    20 octobre 2023, par Exorcismus

    am trying to change font in ffmpeg, I have tried several approaches
in my lambda I included a fonts folder with required fonts files in .ttf

    


    // 👇 layer we've written
    // const fontsLayer = new lambda.LayerVersion(this, 'fonts-layer', {
    //   compatibleRuntimes: [
    //     lambda.Runtime.NODEJS_16_X,
    //   ],
    //   code: lambda.Code.fromAsset(path.join(RESOURCE_PATH, "mediaconvert-assets", "fonts")),
    //   description: 'Arial Arabic fonts',
    // });

    const mediaConvertLambda = new lambda.Function(this, "mediaconvert-handler", {
      layers: [layer],
      code: lambda.Code.fromAsset(path.join(RESOURCE_PATH, "mediaconvert-assets")),
      functionName: "mediaconvert-handler",
      handler: "index.handler",
      environment: {
        INDEX_NAME: "index",
        APP_ES_ENDPOINT: esdomain,
        FONTCONFIG_PATH: '/var/task/fonts',
        FONTCONFIG_FILE: "/var/task/fonts.conf"

      },
      timeout: Duration.seconds(120),
      memorySize: 3008,
      runtime: lambda.Runtime.NODEJS_16_X,
    });


    


    I tried to add fonts as layer and also read from /var/task/fonts but neither are working

    


    on the other hand in ffmpeg am using

    


    options: $tempCaptionPath:force_style='Fontname=Arial,OutlineColour=&H40000000,BorderStyle=3'

    


    I have also tried to set fontsdire='/opt/fonts' and fontsdire='/var/task/fonts' and still not working

    


  • Video overlay of several network streams using ffmpeg

    24 avril 2018, par Hristo Ivanov

    I am writing my first program using the FFMPEG libraries, unfortunately it is not a simple one.

    What I need is to :

    • capture several network inputs(udp).
    • demux the inputs.
    • overlay the video streams.
    • mix the audio(or some other logic).
    • encode the resulting streams.
    • remux the streams and write the result to file.

    For now I am playing with the ffmpeg.exe tool trying achieve this functionality. The command I have looks like this :

    .\ffmpeg.exe -threads auto -y -i input0 -i input1 \
       -filter_complex "[0:v]scale=1920x1080[v0];[1:v]scale=480x270[v1];[v0][v1]overlay=1440:810[v2]" \
       -map [v2] -map 0:a -c:v libx264 -preset ultrafast -c:a copy output.mp4

    When input0 and input1 are files the resulting output is correct, on the other hand, when the inputs are udp streams the resulting output is not correct, the video freezes most of the time.

    The file inputs are generated from the udp streams, using the following command :

    .\ffmpe_Last.exe -threads auto -y -i "udp://@ip:port" -c copy -f mpegts input1.mpg

    Question 1.
    Why is the above command not producing good ouput for upd streams ? What are the differences between the original stream and the dump of that stream for ffmpeg.exe.

    Question 2.
    Is there some argument/s that can fix the command ?

    Question 3.
    What logic/algorithm is needed to correctly overlay two network streams.