Recherche avancée

Médias (0)

Mot : - Tags -/flash

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

Autres articles (60)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (6482)

  • Could you please guide me on how to play a single sample of an audio file in C# using FFmpeg ?

    11 juillet 2023, par hello world

    What is the recommended approach for playing a single sample of an audio file in C# using FFmpeg ? I would like to incorporate FFmpeg into my C# application to play a specific sample from an audio file. Could someone provide an example or guide me on how to achieve this ? Any help would be appreciated.

    


    using System;
using System.Diagnostics;

public class AudioPlayer
{
    private string ffmpegPath;

    public AudioPlayer(string ffmpegPath)
    {
        this.ffmpegPath = ffmpegPath;
    }

    public void PlayAudioSample(string audioFilePath, TimeSpan samplePosition)
    {
        // Prepare FFmpeg process
        Process ffmpegProcess = new Process();
        ffmpegProcess.StartInfo.FileName = ffmpegPath;
        ffmpegProcess.StartInfo.Arguments = $"-ss {samplePosition} -i \"{audioFilePath}\" -t 1 -acodec pcm_s16le -f wav -";
        ffmpegProcess.StartInfo.RedirectStandardOutput = true;
        ffmpegProcess.StartInfo.RedirectStandardError = true;
        ffmpegProcess.StartInfo.UseShellExecute = false;
        ffmpegProcess.StartInfo.CreateNoWindow = true;

        // Start FFmpeg process
        ffmpegProcess.Start();

        // Play audio sample
        using (var audioOutput = new NAudio.Wave.WaveOutEvent())
        {
            using (var audioStream = new NAudio.Wave.RawSourceWaveStream(ffmpegProcess.StandardOutput.BaseStream, new NAudio.Wave.WaveFormat(44100, 16, 2)))
            {
                audioOutput.Init(audioStream);
                audioOutput.Play();
                while (audioOutput.PlaybackState == NAudio.Wave.PlaybackState.Playing)
                {
                    System.Threading.Thread.Sleep(100);
                }
            }
        }

        // Wait for FFmpeg process to exit
        ffmpegProcess.WaitForExit();
    }
}


    


  • How to Play AVI file in a Loop

    10 octobre 2019, par sam

    I am using ffMpeg to play AVI file.

    This is my code where i am reading the frame..

    i define my structure

    typedef struct {

       AVFormatContext *fmt_ctx;
       int stream_idx;
       AVStream *video_stream;
       AVCodecContext *codec_ctx;
       AVCodec *decoder;
       AVPacket *packet;
       AVFrame *av_frame;
       AVFrame *gl_frame;
       struct SwsContext *conv_ctx;
       GLuint frame_tex;
    }AppData;

    This is how i read frame.

    bool readFrame(AppData *data)
    {
       do {
           if (av_read_frame(data->fmt_ctx, data->packet) < 0) {
               av_free_packet(data->packet);
               return false;
           }

           if (data->packet->stream_index == data->stream_idx)
           {
               int frame_finished = 0;

               if (avcodec_decode_video2(data->codec_ctx, data->av_frame, &frame_finished,
                   data->packet) < 0) {
                   av_free_packet(data->packet);
                   return false;
               }

               if (frame_finished)
               {
                   if (!data->conv_ctx)
                   {
                       data->conv_ctx = sws_getContext(data->codec_ctx->width,
                           data->codec_ctx->height, data->codec_ctx->pix_fmt,
                           data->codec_ctx->width, data->codec_ctx->height, AV_PIX_FMT_RGBA,
                           SWS_BICUBIC, NULL, NULL, NULL);
                   }

                   sws_scale(data->conv_ctx, data->av_frame->data, data->av_frame->linesize, 0,
                       data->codec_ctx->height, data->gl_frame->data, data->gl_frame->linesize);

                   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, data->codec_ctx->width,
                       data->codec_ctx->height, GL_RGBA, GL_UNSIGNED_BYTE,
                       data->gl_frame->data[0]);

               }

           }
           av_free_packet(data->packet);

       } while (data->packet->stream_index != data->stream_idx);

       return true;

    }
    1. Currently the video plays and stops at the last frame, how can I reset the frame number to start frame once the whole video is played.
    2. How can I play the video by passing the frame number instead of automatic loop ?
  • Save video from rtsp and play in exoplayer simultaneously [closed]

    25 janvier 2024, par Julian Peña Gallego

    I am trying to receive a live stream via RTSP from an IP camera in Android Kotlin, I am recording the video to a local file with ffmpegkit but I must additionally view the live stream.

    


    When I record the live stream with ffmpeg without playing the stream through exoplayer it works fine, but when both processes are running there is packet loss in the video recording or in the exoplayer.

    


    Then I tried to get exoplayer to play the video that ffmpeg was recording, but it gave me an error since the file has not been closed yet.

    


    Could you provide me with a solution ? I have found on the internet that it is possible with server sockets but they do not indicate how to do it.