Recherche avancée

Médias (0)

Mot : - Tags -/tags

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

Autres articles (69)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • 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

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (7451)

  • 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.