Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (47)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • 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

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (10475)

  • Make gif (ffmpeg) using MOST RECENT 7 jpg files in a directory

    16 juillet 2019, par Brad Sullivan

    I have a bash script which runs on a cron, to take screenshots of my cctv 1x per day to do an annual timelapse. It all works, and I get a YTD sofar.gif of the very first screenshot to the very last screenshot — which is now quite long. I wanted to add a line to make last7days.gif so I could get a shorter weekly gif etc.

    I have searched this site and the web and can list the newest 7 files in terminal using : ls -1t | head -n 9 | tail -n 7 (this removes the .gif and .mov which are modified last) but I do not know how to make that vertical list of 7 filenames into a variable to make a gif using those file names

    # runs from a cronjob. saves live screenshot from CCTV to jpg, then updates the year-to-date movie

    if [ $# -ne 1 ]
    then
     echo "Usage: `basename $0` OUTDIR"
     exit 65
    fi

    doexit=0

    start=$(date +%s)
    end=$(date +%s)

    outdir=${1%/}
    mkdir $outdir
    echo "Capturing image..."

    counter=$(date +"%Y_%m_%d_%H-%M-%S");
    file=$outdir/$counter.jpg

    if response=$(curl --silent --write-out %{http_code} --max-time 600 'URL REDACTED' -o $file) ; then
       echo "Captured & saved $file!"
    else
       echo "Failed to capture $file"
    fi

    ffmpeg -hide_banner -loglevel panic -pattern_type glob -i $outdir/'*.jpg' $outdir/sofar.mov -y
    ffmpeg -hide_banner -loglevel panic -pattern_type glob -i $outdir/'*.jpg' $outdir/sofar.gif -y

    exit 1

    Currently, the last lines create a .gif using every image file, this works only because they are saved with the date in the filename.

    I want to add a line to create a .gif using just the most 7 recent images

  • not able to convert a specific .wav file to mp3 or m4a with sox, avconv

    25 juillet 2017, par astrograph

    At the office we have a project where we apply IoT technologies to a real bee hive.

    One of the features is to detect specific sounds the bees make when a new queen hatches. We have a special microphone in place, the algorithm is also implemented. For now we get a lot of false positives, and want to quickly be able to identify them, by listening to the audio files in the browser. Therefore I want to convert the .wav files to either .mp3 or .m4a

    The .wav file format seems to be quite strange, as I was not able to convert it to mp3 using avconv, sox or even audacity. The funny thing is, the Microsoft media player can play the .wav file fine.

    Here is the information soxi gives about the wav file :

    pi@raspberrypi:~ $ soxi Channel1.wav
    soxi WARN wav: wave header missing extended part of fmt chunk

    Input File     : 'Channel1.wav'
    Channels       : 1
    Sample Rate    : 6250
    Precision      : 24-bit
    Duration       : 00:01:21.00 = 506250 samples ~ 6075 CDDA sectors
    File Size      : 2.03M
    Bit Rate       : 200k
    Sample Encoding: 32-bit Floating Point PCM

    This is the avconv command I am trying to use :

    avconv -y -v quiet -i Channel1.wav -strict experimental -ar 44100 -ab 160k Channel1.m4a

    I also tried with sox :

    sox  -v 0.60 Channel1.wav -r 22050 Channel1.m4a

    but the output is mostly silent, with some random noise.

    The question is how can a wav file like this : https://drive.google.com/open?id=0B9YVh-jkOMLsQThERlI2emN2QWM be converted to an audio format using a raspberry pi that can be played in the browser ?

  • How to convert a Stream on the fly with FFMpegCore ?

    18 octobre 2023, par Adrian

    For a school project, I need to stream videos that I get from torrents while they are downloading on the server.
When the video is a .mp4 file, there's no problem, but I must also be able to stream .mkv files, and for that I need to convert them into .mp4 before sending them to the client, and I can't find a way to convert my Stream that I get from MonoTorrents with FFMpegCore into a Stream that I can send to my client.

    


    Here is the code I wrote to simply download and stream my torrent :

    


    var cEngine = new ClientEngine();

var manager = await cEngine.AddStreamingAsync(GenerateMagnet(torrent), ) ?? throw new Exception("An error occurred while creating the torrent manager");

await manager.StartAsync();
await manager.WaitForMetadataAsync();

var videoFile = manager.Files.OrderByDescending(f => f.Length).FirstOrDefault();
if (videoFile == null)
    return Results.NotFound();

var stream = await manager.StreamProvider!.CreateStreamAsync(videoFile, true);
return Results.File(stream, contentType: "video/mp4", fileDownloadName: manager.Name, enableRangeProcessing: true);


    


    I saw that the most common way to convert videos is by using ffmpeg. .NET has a package called FFMpefCore that is a wrapper for ffmpeg.

    


    To my previous code, I would add right before the return :

    


    if (!videoFile.Path.EndsWith(".mp4"))
{
    var outputStream = new MemoryStream();
    FFMpegArguments
        .FromPipeInput(new StreamPipeSource(stream), options =>
        {
            options.ForceFormat("mp4");
        })
        .OutputToPipe(new StreamPipeSink(outputStream))
        .ProcessAsynchronously();
    return Results.File(outputStream, contentType: "video/mp4", fileDownloadName: manager.Name, enableRangeProcessing: true);
}


    


    I unfortunately can't get a "live" Stream to send to my client.