Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (72)

  • 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

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

    15 mai 2013

Sur d’autres sites (7501)

  • Can FFMPEG be used to change the transparency of a single PNG ?

    19 juillet 2020, par Chameleon

    I know that FFMPEG can manipulate transparency using fade in/fade out over a series of frames. I just haven't found a way to generate a png with a specified transparency setting.

    


    I am in the process of creating a lot (20 in first set) of procedurally-generated videos. Each video requires several starts and stops, where with each stop, a png overlay describing what is seen will be displayed for several (actual number TBD, and may vary) frames. I'd like each overlay to fade in over x frames, display for y frames at full opacity and then fade out over y frames. The documentation on FFMPEG really sucks at explaining fade effects, and no one I've found showing usage actually explains what all of the parameters do.

    


    The original sources for the videos are CGI png frames with a transparent background. I will be making the descriptive overlays with transparent backgrounds (same resolution as the CGI frames) - I'm really hoping to not have to manually save each overlay (8 overlays per video at a minimum) with 4 to 6 (or more) transparency settings - The company is being real indecisive as to the length of the fade in/out or the "hang time" of the descriptive overlays.

    


    I have already created a Python script that uses FFMPEG to place overlays on specific frames, then uses FFMPEG to stitch all frames into a single video, adds a background to the video and then places the company's watermark on the video. It already manages the key frames and what images should be overlaid (and for how many frames). It is working well, but the company doesn't like the lack of fade. I already have the framework in place to manage the fade in/out duration (I'm just missing the answer to this question). I created the script because I have no doubt that I'll have to generate the final output on the first couple of videos a number of times to appease the stakeholders.

    


    I'm really hoping to find a fairly easy way to hand FFMPEG a png with a transparent background and have FFMPEG hand me a copy of the image whose non-transparent part is now "x percent" transparent (or "y percent" opaque). I know from failed attempts that FFMPEG doesn't choke trying to make a region more than 100% transparent.

    


    It's a real pain to get approval to install new software on the workstation, so I'm not actually interested in any suggestion that doesn't use FFMPEG or a pretty vanilla Python installation. - It's not that the other software might not be useful, it just means that if other software is needed, I'll have to manually create the frames.

    


  • Index Out Of Bounds Exception when merging frames

    25 avril 2016, par Elucidator

    I’m writing software to convert 6 cubemap videos to 1 equirectangular video. Basically, it extracts frames from the 6 cubemap videos with ffmpeg, uses Nona to stitch them into a single frame, and converts the frames back into video.

    I’m getting an IndexOutOfBounds exception when I try to run this. Can you give me any pointers on where my error could be or how to fix it ?

           framecount = Directory.GetFiles(@System.IO.Path.GetDirectoryName(Application.ExecutablePath)).Count(path => Regex.IsMatch(path, @"front\d*[.]jpg"));
           for (int i = 1; i < framecount; i++)
           {
               MergeFrames(i.ToString().PadLeft(5, '0'), i.ToString());
           }



           public void MergeFrames(string framenum, string exportname){
           this.Text = "Merging frame: " + Int32.Parse(framenum) + "/" + framecount;
           progressBar1.Value = ((Int32.Parse(framenum) / framecount) * 100);
           var lines = File.ReadAllLines(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "script.pto");
           lines[13] = "i f0 y0 p-90 r0 v90 n\"" + System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "down" + framenum + ".jpg\"";
           lines[14] = "i f0 y0 p0 r0 v90 n\"" + System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "front" + framenum + ".jpg\"";
           lines[15] = "i f0 y90 p0 r0 v90 n\"" + System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "right" + framenum + ".jpg\"";
           lines[16] = "i f0 y180 p0 r0 v90 n\"" + System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "back" + framenum + ".jpg\"";
           lines[17] = "i y-90 p0 r0 v90 n\"" + System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "left" + framenum + ".jpg\"";
           lines[18] = "i f0 y0 p90 r0 v90 n\"" + System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "top" + framenum + ".jpg\"";
           File.WriteAllLines(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "script.pto", lines);
           String command = "script.pto -o " + exportname + ".png -v";
           ProcessStartInfo cmdsi = new ProcessStartInfo("nona.exe");
           cmdsi.Arguments = command;
           Process cmd = Process.Start(cmdsi);
           cmd.WaitForExit();
           File.Delete(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "down" + framenum + ".jpg");
           File.Delete(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "front" + framenum + ".jpg");
           File.Delete(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "right" + framenum + ".jpg");
           File.Delete(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "back" + framenum + ".jpg");
           File.Delete(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "left" + framenum + ".jpg");
           File.Delete(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + "top" + framenum + ".jpg");
           }
  • How to upload object to a bucket in Google Cloud Platform from Python script

    7 juillet 2016, par Bryan

    The goal of this script is to extract audio from a video file using ffmpeg and upload it into a bucket on Google Cloud Platform each time it is called. Eventually I will have to extract audio from a large list of videos, so ideally I would want my script to extract and subsequently upload it into the cloud.

    My confusion is how to use GCP API to upload my object into a bucket. Any advice would be greatly appreciated !

    Link for reference : https://cloud.google.com/storage/docs/json_api/v1/json-api-python-samples#setup-code

    import subprocess
    import sys
    import re

    fullVideo = sys.argv[1]
    title = re.findall('^([^.]*).*', fullVideo)
    title = str(title[0])
    subprocess.call('ffmpeg -i ' + fullVideo + ' -vn -ab 128k ' + title + '.flac', shell = True)

    def upload_object(bucket, filename, readers, owners):
       service = create_service()

       # This is the request body as specified:
       # http://g.co/cloud/storage/docs/json_api/v1/objects/insert#request
       body = {
           'name': filename,
       }

       # If specified, create the access control objects and add them to the
       # request body
       if readers or owners:
           body['acl'] = []

       for r in readers:
           body['acl'].append({
               'entity': 'user-%s' % r,
               'role': 'READER',
               'email': r
           })
       for o in owners:
           body['acl'].append({
               'entity': 'user-%s' % o,
               'role': 'OWNER',
               'email': o
           })

       # Now insert them into the specified bucket as a media insertion.
       # http://g.co/dev/resources/api-libraries/documentation/storage/v1/python/latest/storage_v1.objects.html#insert
       with open(filename, 'rb') as f:
           req = service.objects().insert(
               bucket=bucket, body=body,
               # You can also just set media_body=filename, but # for the sake of
               # demonstration, pass in the more generic file handle, which could
               # very well be a StringIO or similar.
               media_body=http.MediaIoBaseUpload(f, 'application/octet-stream'))
           resp = req.execute()

       return resp