Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (112)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (15135)

  • Process.WaitForExitAsync stucks infinitely while calling ffmpeg on Windows

    8 novembre 2022, par Iskander Raimbaev

    I am working with ffmpeg via C#'s Process class.

    


    I have a script that runs ffmpeg to generate thumbnails from video. Initially it was called manually from command line - .\ffmpeg.exe -i .\input.mp4 -ss 00:00:01.000 -vframes:v 1 output.png, it starts ffmpeg instance, outputs some warnings/errors during the execution :

    


    [image2 @ 000001e51095ec80] The specified filename 'output.png' does not contain an image sequence pattern or a pattern is invalid.
[image2 @ 000001e51095ec80] Use a pattern such as %03d for an image sequence or use the -update option (with -frames:v 1 if needed) to write a single image.
frame=    1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.00 bitrate=N/A speed=   0x
video:73kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown


    


    but anyway exits the process and correctly generates thumbnail image at output.png.

    


    I want to execute it from C#.
Let's see the code :

    


    var ffmpegProcess = new Process
{
     StartInfo = new ProcessStartInfo
     {
         FileName = _config.FfmpegExecutablePath,
         Arguments = CreateArgumentsForFfmpegProcessToRun(videoTempFilePath, thumbnailTempFilePath),
         RedirectStandardError = true,
         RedirectStandardInput = true,
         RedirectStandardOutput = true,
         UseShellExecute = false,
         CreateNoWindow = true
     },
     EnableRaisingEvents = true
 };

 ffmpegProcess.Start();
 await ffmpegProcess.WaitForExitAsync();


    


    Method CreateArgumentsForFfmpegProcessToRun returns exactly the same arguments as in the script above -i .\input.mp4 -ss 00:00:01.000 -vframes:v 1 output.png.

    


    However, when I run this code, it stucks/blocked at line ffmpegProcess.WaitForExitAsync() infinitely and no output written to output path.
If I omit WaitForExitAsync call and just go to the next line, then it doesn't stuck and writes the output as expected and finish the process with -1 exit code.

    


    I am trying to figure out why block/stuck happens and what is the best way to resolve this situation ? As far I know, WaitForExitAsync should return as process ends, no matter how process ends - 0 or another exit code, am I right ?

    


    Update #1 :
Community advised to search if somewhere up the stack I am blocking my code. I wrote xunit-test and it still stucks.

    


    [Theory]
[InlineData("assets/input.mp4", "assets/ffmpeg.exe")]
public async Task CreateThumbnailFromVideo(string videoFilePath, string ffmpegExePath)
{
    var config = new VideoThumbnailServiceConfig
    {
         FfmpegExecutablePath = ffmpegExePath,
         ThumbnailImageExtension = ".png"
    };

    var sut = new VideoThumbnailService(config);

    using var fileStream = File.OpenRead(videoFilePath);
    await sut.CreateThumbnailFromVideo(fileStream);
 } 


    


    Inside sut.CreateThumbnailFromVideom I call process start method and awaits WaitForExitAsync().

    


  • How do you enumerate the formats, resolutions and framerates in libav for v4l2 ?

    24 décembre 2020, par Doug

    So start with, let's set some context regarding libav (ffmpeg) :

    


    Yes, I'm aware that this is a 'per backend' thing, and for some (eg. avfoundation) although it includes the code to enumerate these options, can only output them as error messages when you pass an invalid combination of input parameters and attempt to open a device.

    


    Other implementations, eg. the v4l2 driver implements list_formats that can be seen using :

    


    ffmpeg -f v4l2 -list_formats all -i "/dev/video0"

    


    However, the implementation of this function also just logs out the formats.

    


    Now, I'm well aware that you can trigger the these functions (depending on the backend) by forming some combination of options in an AVDictionary and passing the result to av_find_input_format.

    


    So, not possible right ?

    


    However, as per c++ how to use lambdas to set ffmpeg’s av_log_set_callback() to a member function ? you can rebind the logging function in libav to capture this output.

    


    Right... so now this is where I'm stuck. In theory I can use vsprintf to convert the log callback (ie. char *fmt, va_list args into a string, and collect the result.

    


    However, I can't figure out how to actually implement something that does the following :

    


      

    • build a valid AVDictionary with the required properties
    • 


    • set the log callback
    • 


    • av_find_input_format / avf_read_header / whatever
    • 


    • get the output of the log <--- how do I do this ?
    • &#xA;

    • clear the log callback
    • &#xA;

    &#xA;

    How can I capture the log output ?

    &#xA;

    Please, no vague hand waving, post actual code. There's a basic example of how to do this which already does all the steps except the log capture.

    &#xA;

    Note that the answer to the SO post linked about about using lambdas is answered with "You can't use a capturing lambda, use a global in the log callback function", however, I'm posting this question because that answer lacks detail about specifically how to do that in a thread safe way, given that the documentation specifically states :

    &#xA;

    &#xA;

    The callback must be thread safe, even if the application does not use threads itself as some codecs are multithreaded.

    &#xA;

    &#xA;

  • How do I upscale an iOS App Preview video to 1080 x 1920 ? [closed]

    12 avril 2024, par Benjamin Thiel

    I just captured a video of my new app running on an iPhone 6 using QuickTime Player and a Lightning cable. Afterwards I created an App Preview project in iMovie, exported it and could successfully upload it to iTunes Connect.

    &#xA;&#xA;

    Apple requires developers to upload App Previews in different resolutions dependent on screen size, namely :

    &#xA;&#xA;

      &#xA;
    • iPhone 5(S) : 1080 x 1920 or 640 x 1136
    • &#xA;

    • iPhone 6 : 750 x 1334 (what I have)
    • &#xA;

    • iPhone 6+ : 1080 x 1920
    • &#xA;

    &#xA;&#xA;

    Obviously, 1080 x 1920 is killing two birds with one stone. I know that upscaling isn't the perfect solution, but it's meeting my needs. Since I don't own a 6+, another recording session won't do the trick.

    &#xA;&#xA;

    Unfortunately, iTunes Connect is extremely picky about what to accept. Here's what I tried, to no avail :

    &#xA;&#xA;

      &#xA;
    • Handbrake, iMovie, QuickTime do not support upscaling
    • &#xA;

    • MPEG Streamclip
    • &#xA;

    • ffmpeg -i input.mp4 -acodec copy -vf scale=1080:1920 output.mp4
    • &#xA;

    &#xA;&#xA;

    Strangely enough, iTunes Connect keeps complaining about the wrong resolution when I try to upload the output.mp4 of ffmpeg.

    &#xA;