Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

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

Autres articles (30)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • 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

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (5962)

  • Can't share few FFMPEG encoded videos on WhatsApp

    2 juin 2019, par t6nand

    I am using FFMPEG to stitch a video to another video. However, I have observed that few of these videos are not being shared on WhatsApp with the message "Can’t send this video. Choose a different video and try again".

    I am using the following command for stitching :

    ffmpeg -y -i <input1> -i
    <input2> -filter_complex "color=black:input1Width x input1Height:d=(input1time + input2time -1)[base]
    ;[0:v]setpts=PTS-STARTPTS[v0];[1:v] scale = iw * min(input1Width / iw\\, input1Height / ih):ih * min(input1Width/iw\\,input1Height/ih),
    pad=input1Width:input1Height:(input1Width-iw*min(input1Width/iw\\,input1Height/ih))/2:(input1Height -
    ih*min(input1Width/iw\\,input1Height/ih))/2,setsar=1:1,format=yuva420p,fade=in:st=0:d=1.0:alpha=1,
    setpts=PTS-STARTPTS+((input1Time - 1)/TB)[v1];[base][v0]overlay[tmp]; [tmp][v1]overlay,format=yuv420p[fv];
    [0:a][1:a]acrossfade=d=1[fa]" -map [fv] -map [fa] -crf 23 -c:v libx264 -b:v 300K
    -preset slow outputvideo.mp4
    </input2></input1>

    Here : input1Width - Input 1 Video’s width, input1Height - Input 2 Video’s height.

    Interestingly running this command directly on terminal produces a file which plays correctly on media players and I am able to share it across platforms including WhatsApp.

    However, the same command when triggered from a java code produces a similar file in terms of size, bit rate (near about same as produced when directly executed). I am running the same command from java using ProcessBuilder like :

    ProcessBulider stitchVideoCommandArray = new ProcessBuilder(
                           "ffmpeg", "-y",
                           "-i", <input1>,
                           "-i", <input2>,
                           "-filter_complex", "color=black:" + String.valueOf(width) + "x" + String.valueOf(height) + ":d=" +
                           String.valueOf(originalVideoTime + ASSET_VIDEOSTREAM_DURATION - CROSS_FADE_TIME_DURATION) + "[base];" +
                           "[0:v]setpts=PTS-STARTPTS[v0];[1:v]scale=iw*" + String.valueOf(minMultiplicable) + ":ih*" + String.valueOf(minMultiplicable) +
                           ",pad=" + String.valueOf(width) + ":" + String.valueOf(height) + ":(" + String.valueOf(width) + "-iw*" + String.valueOf(minMultiplicable) + "/2" +
                           "):(" + String.valueOf(height) + "-ih*" + String.valueOf(minMultiplicable) + "/2)" + ",fade=in" +
                           ":st=0:d=" + String.valueOf(CROSS_FADE_TIME_DURATION) + ":alpha=1,setpts=PTS-STARTPTS+((" + String.valueOf(originalVideoTime - CROSS_FADE_TIME_DURATION) +
                           ")/TB)[v1];[base][v0]overlay[tmp];[tmp][v1]overlay,format=yuv420p[fv];[0:a][1:a]acrossfade=d=1[fa]",
                           "-map", "[fv]",
                           "-map", "[fa]",
                           "-c:v", MP4Transcode.MP4VideoStreamEncoder.H264.videoEncoders,
                           "-b:v", "300K",
                           "-c:a", MP4Transcode.MP4AudioStreamEncoders.AAC.audioEncoders,
                           "-b:a", "128K",
                           "-crf", String.valueOf(constantRateFactor),
                           "-preset", presetRequired,
                       outputVideoPath
               );
    </input2></input1>

    I then use this object to execute the command using

    command.start()

    and waiting for exitvalue using

    command.waitFor()

    This also produces a file which I am able to play correctly on media players but was not successful in sharing the video on WhatsApp.

    Also, the file produced by executing FFmpeg commands as mentioned above from java produces media files with their loudness slightly increased.

    I am not able to figue out if it’s video specific issue or something else. It only happens to few random videos.

    Here are the links to videos with the problem :
    input 1 - input1Link
    input 2 - inpt2Link

    EDIT 1 :
    To add, adding -loglevel debug in java command takes forever and I haven’t seen it yet responding for even 5-6 minutes. However, using it directly from terminal returns quickly after processing.

  • ffmpeg background worker runs in debug but not in application

    2 novembre 2019, par Purgitoria

    My application has a function of taking captured images and using an FFmpeg background worker to stitch these into a time-lapse video. The GUI has some simple options for video quality and for the source folder and output file. I had an older version of my application written in VB.NET and that worked without issue but I am rewriting in C# as it supports additional capture and filter capability in the image processing but am having real trouble figuring out what is wrong with this function.

    I have tried relocating FFmpeg to different locations just in case it was a permissions issue but that had no effect and I also tried to put the function in a "try" with a message box to output any exceptions but I got different errors that prevented me from compiling the code. When I run the application from within VS 2015 in the debugging tool the function works just fine and it will create a video from a collection of still images but when I build and install the application it does not work at all and I cannot see what is causing it to fail. In the options for ffmpeg I used the -report to output a log of what happens in the background worker and in debug, it creates this log but from the application, it does not so I presume it is not even running ffmpeg and going straight to the completed stage of the function.

    Function startConversion()

       CheckForIllegalCrossThreadCalls = False
       Dim quality As Integer = trbQuality.Value
       Dim input As String = tbFolderOpen.Text
       Dim output As String = tbFolderSave.Text
       Dim exepath As String = Application.StartupPath + "\\bin\ffmpeg.exe"
       input = input &amp; "\SCAImg_%1d.bmp"
       input = Chr(34) &amp; input &amp; Chr(34)
       output = Chr(34) &amp; output &amp; Chr(34)

       Dim sr As StreamReader
       Dim ffmpegOutput As String

       ' all parameters required to run the process
       proc.StartInfo.UseShellExecute = False
       proc.StartInfo.CreateNoWindow = True
       proc.StartInfo.RedirectStandardError = True
       proc.StartInfo.FileName = exepath
       proc.StartInfo.Arguments = "-framerate 25 -start_number 0 -pattern_type sequence -framerate 10 -i " &amp; input &amp; " -r 10 -c:v libx264 -preset slow -crf " &amp; quality &amp; " " &amp; output
       proc.Start()

       lblInfo.Text = "Conversion in progress... Please wait..."
       sr = proc.StandardError 'standard error is used by ffmpeg
       btnMakeVideo.Enabled = False
       Do
           ffmpegOutput = sr.ReadLine
           tbProgress.Text = ffmpegOutput
       Loop Until proc.HasExited And ffmpegOutput = Nothing Or ffmpegOutput = ""

       tbProgress.Text = "Finished !"
       lblInfo.Text = "Completed!"
       MsgBox("Completed!", MsgBoxStyle.Exclamation)
       btnMakeVideo.Enabled = True
       Return 0

    End Function

    I checked the application folder and it does contain a subfolder \bin withe the ffmpeg.exe located within the folder so I then used cmd to run an instance of the installed ffmpeg from the application folder and it seemed to be throwing out permissions errors :

    Failed to open report "ffmpeg-20191101-191452.log" : Permission denied
    Failed to set value ’1’ for option ’report’ : Permission denied
    Error parsing global options : Permission denied

    This seems then like it is certainly a permissions problem but where I am not sure. I did not run into this error when using VB.NET so I am wondering where I am going wrong now. I thought perhaps it would just be a write permission in the application folder so I the removed the -report and ran ffmpeg again using cmd from my application folder and it then gave the error

    C :\Users\CEAstro\Pictures\AnytimeCap : Permission denied

    Am I missing something really obvious in my code or is there something more fundamental I have wrong in my setup ?

    I should also add that I tried running ffmpeg via cmd from a copy that was manually placed elsewhere (i used the same file) and that actually worked. For some reason, it seems like it just will not work from wherever my application installs it.

  • FFMPEG HTTP protocol closing after first packet

    27 août 2019, par rusty

    I’m trying to send a live video stream from my webcam to FFMPEG via the HTTP protocol. However after the first packet is sent FFMPEG closes, but does indeed output a fully playable video. As my intention.

    After going over the documentation for the protocol I thought mulitiple_requests would stop this behavior which it did not. After searching online for a few hours I can not find an example specific to my scenario. i.e. receiving a network stream over HTTP.

    Code running on the client-side :

    var xhttp=new XMLHttpRequest;

    if (navigator.mediaDevices) {

       var constraints = { audio: true, video: true };

       navigator.mediaDevices.getUserMedia(constraints)
         .then(function(stream) {
           var mediaRecorder = new MediaRecorder(stream);
           m = mediaRecorder;
           m.start();
           m.ondataavailable=e=>{
             xhttp.open("POST","http://localhost:8080");
             xhttp.send(e.data);
           }
           setInterval(function(){
             m.requestData();
           },2000);
         }).catch(function(error) {
           console.log(error.message);
         });
    }

    The FFMPEG command I have tried thus far :

    ffmpeg -listen 1 -multiple_requests -i http://localhost:8080 file.webm

    Maybe this is not possible with FFMPEG ? If this is the case then it appears the only solution would be to put this command in a loop and keep appending to the output.