Recherche avancée

Médias (0)

Mot : - Tags -/api

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

Autres articles (32)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Encodage et transformation en formats lisibles sur Internet

    10 avril 2011

    MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
    Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
    Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

Sur d’autres sites (4314)

  • ffmpeg - mpegts Multicast [closed]

    7 juin 2024, par Miguel Duarte

    I'm generating a multicast stream with this command :

    


    ffmpeg -hwaccel_device 1 -format_code Hi50 -re -f decklink -i 'DeckLink Duo (1)' -pix_fmt yuv420p -c:v h264_nvenc -profile:v high -b:v 3500k -rc 2 -cbr true -maxrate 3500k -bufsize 7000k -c:a mp2 -b:a 192k -f mpegts "udp://239.1.1.2:5000?ttl=2&pkt_size=1316"


    


    My problem is that if I open this stream on a device with a 100Mb/s connection, it's heavily pixelated. The same stream on a 1Gb/s device displays fine.

    


    I have other multicast streams from our ISP and they display fine regardless of connection speed.

    


    Has someone come across this issue ? This seems ffmpeg related.

    


    I tried several settings, bitrates, etc. Also playing on VLC, OBS. Same result.

    


    Version :

    


    ffmpeg version N-111519-gefa6cec759


    


    Thanks in advance.

    


  • Could not find ffmpeg executable, tried "/srv/linux-x64/ffmpeg"

    20 mai 2024, par Alan

    I am trying to run my docker image on AWS EC2 Instance. However, I am having a trouble with the image file. When I run a task in AWS ECS, it says :

    


    Could not find ffmpeg executable, tried "/srv/linux-x64/ffmpeg", "/srv/app/node_modules/@ffmpeg-installer/linux-x64/ffmpeg" and "/srv/app/node_modules/@ffmpeg-installer/linux-x64/ffmpeg"


    


    This is my Dockerfile :

    


    FROM node:latest as server
WORKDIR /srv/app
COPY ./server/package*.json ./
RUN apt-get update && apt-get install -y 'ffmpeg'
RUN npm install
COPY ./server .
RUN npm run build

FROM node:latest as client
WORKDIR /srv/app
COPY ./client/package*.json ./
RUN npm install
COPY ./client .
RUN npm run build

FROM node:latest as production
WORKDIR /srv/app
RUN mkdir /public
COPY --from=server /srv/app/dist ./
COPY --from=client /srv/app/dist ./public
ENV NODE_ENV=production
EXPOSE 5000
CMD ["node", "app.js"]


    


    This is my package.json :

    


      },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@ffmpeg-installer/ffmpeg": "^1.1.0",
    "@types/ffmpeg": "^1.0.7",
    "@types/fluent-ffmpeg": "^2.1.24"
  }


    


    This is how I used ffmpeg in my code :

    


    import ffmpegPath from '@ffmpeg-installer/ffmpeg';
import ffmpeg from 'fluent-ffmpeg';
ffmpeg.setFfmpegPath(ffmpegPath.path);


    


    Please help me fix this error.

    


  • C# server problem with FFmpeg Visual Studio 2022

    16 mai 2024, par seanofdead

    Hello everyone I've spent countless hours on my server I'm trying to create that will share video from one stream to another client computer. That is the goal anyway. I'm using Visual Studio 2022 most recent update. Currently this is my code

    


    using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using FFmpeg.AutoGen;
using NLog;

public class VideoStreamServer
{
    private const int Port = 5000;
    private TcpListener server;
    private FFmpegVideoEncoder encoder;
    private static readonly Logger logger = LogManager.GetCurrentClassLogger();

    public VideoStreamServer()
    {
        // Initialize FFmpeg network components
        Console.WriteLine("Initializing FFmpeg network components...");
        int result = ffmpeg.avformat_network_init();
        if (result != 0)
        {
            throw new ApplicationException($"Failed to initialize FFmpeg network components: {result}");
        }

        // Initialize encoder
        encoder = new FFmpegVideoEncoder(1920, 1080, AVCodecID.AV_CODEC_ID_H264); // Screen size & codec
    }

    public static void Main()
    {
        // Initialize NLog
        var logger = LogManager.GetCurrentClassLogger();
        logger.Info("Application started");

        var server = new VideoStreamServer();
        server.Start().Wait();
    }

    public async Task Start()
    {
        server = new TcpListener(IPAddress.Any, Port);
        server.Start();
        logger.Info($"Server started on port {Port}...");

        try
        {
            while (true)
            {
                TcpClient client = await server.AcceptTcpClientAsync();
                logger.Info("Client connected...");
                _ = HandleClientAsync(client);
            }
        }
        catch (Exception ex)
        {
            logger.Error(ex, "An error occurred");
        }
    }

    private async Task HandleClientAsync(TcpClient client)
    {
        using (client)
        using (NetworkStream netStream = client.GetStream())
        {
            try
            {
                await encoder.StreamEncodedVideoAsync(netStream);
            }
            catch (IOException ex)
            {
                logger.Error(ex, $"Network error: {ex.Message}");
                // Additional logging and recovery actions
            }
            catch (Exception ex)
            {
                logger.Error(ex, $"Unexpected error: {ex.Message}");
                // Log and handle other exceptions
            }
            finally
            {
                // Ensure all resources are cleaned up properly
                client.Close();
                logger.Info("Client connection closed properly.");
            }
        }
    }
}

public class FFmpegVideoEncoder
{
    private readonly int width;
    private readonly int height;
    private readonly AVCodecID codecId;
    private static readonly Logger logger = LogManager.GetCurrentClassLogger();

    public FFmpegVideoEncoder(int width, int height, AVCodecID codecId)
    {
        this.width = width;
        this.height = height;
        this.codecId = codecId;
        InitializeEncoder();
    }

    private void InitializeEncoder()
    {
        // Initialize FFmpeg encoder here
        logger.Debug("FFmpeg encoder initialized");
    }

    public async Task StreamEncodedVideoAsync(NetworkStream netStream)
    {
        // Initialize reusable buffers for efficiency
        byte[] buffer = new byte[4096];

        // Capture and encode video frames
        while (true)
        {
            try
            {
                // Simulate capture and encoding
                byte[] videoData = new byte[1024]; // This would come from the encoder

                // Simulate streaming
                for (int i = 0; i < videoData.Length; i += buffer.Length)
                {
                    int chunkSize = Math.Min(buffer.Length, videoData.Length - i);
                    Buffer.BlockCopy(videoData, i, buffer, 0, chunkSize);
                    await netStream.WriteAsync(buffer, 0, chunkSize);
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Error streaming video data");
                throw; // Rethrow to handle in the calling function
            }

            await Task.Delay(1000 / 30); // For 30 FPS
        }
    }
}


    


    When I build no issues but when i run it in debug mode I get this error

    


    System.DllNotFoundException
  HResult=0x80131524
  Message=Unable to load DLL 'avformat.59 under C:\Users\phlfo\Downloads\cfolder\server\ConsoleApp\bin\Debug\': The specified module could not be found.
  Source=FFmpeg.AutoGen
  StackTrace:
   at FFmpeg.AutoGen.ffmpeg.LoadLibrary(String libraryName, Boolean throwException)
   at FFmpeg.AutoGen.ffmpeg.<>c.<.cctor>b__7_0(String libraryName)
   at FFmpeg.AutoGen.ffmpeg.<>c.<.cctor>b__7_242()
   at FFmpeg.AutoGen.ffmpeg.avformat_network_init()
   at VideoStreamServer..ctor() in C:\Users\phlfo\Downloads\cfolder\server\ConsoleApp\Program.cs:line 20
   at VideoStreamServer.Main() in C:\Users\phlfo\Downloads\cfolder\server\ConsoleApp\Program.cs:line 36


    


    I have FFmpeg.AutoGen package installed through VS i originally started with 7.0 but then switched to 5.0 to see if an older version might work (it did not). I also have the files in the same directory as the .exe for testing purposes as seen in the screenshot. Can someone please help me figure out this error.
enter image description here