Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (19)

  • Création définitive du canal

    12 mars 2010, par

    Lorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
    A la validation, vous recevez un email vous invitant donc à créer votre canal.
    Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
    A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (3369)

  • discord.py Heroku FFmpeg issue

    6 avril 2022, par No.BoD

    hi I'm trying to deploy a discord bot on heroku. i'm using ffmpeg to stream music to a voice channel. i tried it local on my windows and got it working but when I deployed it on heroku, throws this exception and says nothing !

    


    I use these buildpacks :

    


      

    1. heroku/python
    2. 


    3. https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git
    4. 


    


    I appreciate if someone can help
    
here's a sample code :

    


    vid = pafy.new("https://www.youtube.com/watch?v=gdL7s0kw0SM")
print("Pafy Vid Created!")
audio = vid.getbestaudio()
print("Pafy Audio Created!")
try:
    // self.FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
    self.vc[ctx.guild.id].play(FFmpegPCMAudio(Song['source'], **self.FFMPEG_OPTIONS), after=lambda _: E.set())
    print("Playing Music!!!")
except Exception as ex:
    print(ex)


    


    and here's what I got :

    


    2021-09-20T14:31:19.958645+00:00 app[worker.1]: Pafy Vid Created!
2021-09-20T14:31:19.958889+00:00 app[worker.1]: Pafy Audio Created!
2021-09-20T14:31:20.447278+00:00 app[worker.1]:


    


  • Sending frames from memory to FFMPEG command line program .NET 6

    15 septembre 2021, par Alessandro Martinelli

    I'm trying to use the pipe to send frames generated by my program to ffmpeg command line utility without saving them on disk. Please note I was able to generate a video by first saving frames on disk as images and then having FFMPEG generate a video from such images, but that approach is worse performance-wise and implies writing more data on SSD.

    


    I could use the help of this post, but I have FFMPEG returning an error on frame size, and I don't know how to solve it.

    


    My code is the following :

    


    //object storing single frame returned from camera
mv.impact.acquire.Request pRequest; 
string outputPath = ...;
List frames = new List();

[...]

// Single frame is saved into memory
MemoryStream stream = new MemoryStream();
using (RequestBitmapData data = pRequest.bitmapData) {
    data.bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp);
    // Please note that now printing data.bitmap.PixelFormat would return Format24bppRgb
}
frames.Add(stream.ToArray());

[...] 

Console.WriteLine(frames.Count + " frames collected. First one length is " + frames.First().Length);

string ffmpegArgument = "/C " + _ffmpegPath + "\\ffmpeg -y -f rawvideo -pix_fmt rgb24 -framerate 3 -video_size 728x544 -i - -c:v libx264 -preset 9 -c:a libvo_aacenc " + outputPath;

Process cmd = new Process();
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.Arguments = ffmpegArgument;
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.RedirectStandardError = false;
cmd.StartInfo.RedirectStandardInput = true;

Console.WriteLine("Executing command " + ffmpegArgument + "...");
cmd.Start();
foreach (byte[] frame in frames) {
        cmd.StandardInput.Write(frame);
}
cmd.StandardInput.Flush();
cmd.StandardInput.Close();


    


    However, when I execute the program, I have the following output :

    


    492 frames collected. First one length is 1188150
Executing command /C ExternalTools\FFmpeg\ffmpeg -y -f rawvideo -pix_fmt rgb24 -framerate 32 -video_size 728x544 -i - -c:v libx264 -preset ultrafast -c:a libvo_aacenc -b:a 128k "Output\TemporaryVideo\2021-09-13 18_58_58.mp4"...
ffmpeg version 2021-06-27-git-49e3a8165c-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.3.0 (Rev2, Built by MSYS2 project)

[...] (configurations)

[rawvideo @ 00000241d34feac0] Packet corrupt (stream = 0, dts = 0).
Input #0, rawvideo, from 'pipe:':
  Duration: N/A, start: 0.000000, bitrate: 304152 kb/s
  Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 728x544, 304152 kb/s, 32 tbr, 32 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
pipe:: corrupt input packet in stream 0
[rawvideo @ 00000241d3511640] Invalid buffer size, packet size 6396 < expected frame_size 1188096
Error while decoding stream #0:0: Invalid argument

[...] (cpu capabilities)

Output #0, mp4, to 'Output\TemporaryVideo\2021-09-13 18_58_58.mp4':
  Metadata:
    encoder         : Lavf59.3.101
  Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv444p, 728x544, q=2-31, 32 fps, 16384 tbn
    Metadata:
      encoder         : Lavc59.2.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!


    


    The value expected by FFMPEG seems correct (1188096 = 728 x 544 x 3), but I don't understand where FFMPEG gets that "packet size 6396" from. Furthermore, that value (6396) changes at every program execution.

    


    I'm pretty sure frames are not corrupted since, if I save such frames on disk, the image is generated correctly.

    


    Thank you for your time,
Alessandro

    


  • FFMPEG Aligning Timestamps in m3u8 Stream

    16 septembre 2021, par maxwellray

    I'm receiving an m3u8 stream with the following structure

    


    #EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:YES
#EXT-X-MEDIA-SEQUENCE:1193
#EXT-X-PROGRAM-DATE-TIME:2021-09-15T22:57:30+00:00
#EXT-X-TARGETDURATION:11
#EXTINF:10.054589,
20210915220000/20210915225710.ts
#EXTINF:10.008855,
20210915220000/20210915225720.ts


    


    Every 10 seconds, the playlist is updated with a new media file path and the oldest media path is removed. Each media file path contains a clip that is approximately 10 seconds long (i.e., over a very long time, the average length of each clip should be 10 seconds). Each media path is timestamped, rounded to 10 seconds.

    


    I run a system where I record continuous 32-minute clips of this stream using ffmpeg, and I need to know the exact timestamp where I start to record and where I stop. I'm encountering a sort of race condition where ffmpeg will start recording at the beginning of the oldest clip in the playlist instead of when it actually gets kicked off. The problem is illustrated below

    


    Clip 1: |==========|
Clip 2:            |==========|
FFMPEG:    |==================| <= ffmpeg is kicked off at t=3
OUTPUT: |=====================| <= but video would actually start at t=0


    


    I'm wondering if there's a way to ensure that the clips I record actually start when ffmpeg is kicked off, not from the start of the earliest clip in the stream.

    


    Thanks !