Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (93)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (5635)

  • How to get the thumbnail of base64 encoded video file in Nodejs ?

    3 octobre 2018, par Wai Yan Hein

    I am developing a web application using Nodejs. I am using Amazon S3 bucket to store files. What I am doing now is that when I upload a video file (mp4) to the S3 bucket, I will get the thumbnail photo of the video file from the lambda function. For fetching the thumbnail photo of the video file, I am using this package - https://www.npmjs.com/package/ffmpeg. I tested the package locally on my laptop and it is working.

    Here is my code tested on my laptop

    var ffmpeg = require('ffmpeg');

    module.exports.createVideoThumbnail = function(req, res)
    {
       try {
           var process = new ffmpeg('public/lalaland.mp4');
           process.then(function (video) {

               video.fnExtractFrameToJPG('public', {
                   frame_rate : 1,
                   number : 5,
                   file_name : 'my_frame_%t_%s'
               }, function (error, files) {
                   if (!error)
                       console.log('Frames: ' + files);
                   else
                       console.log(error)
               });

           }, function (err) {
               console.log('Error: ' + err);
           });
       } catch (e) {
           console.log(e.code);
           console.log(e.msg);
       }
       res.json({ status : true , message: "Video thumbnail created." });
    }

    The above code works well. It gave me the thumbnail photos of the video file (mp4). Now, I am trying to use that code in the AWS lambda function. The issue is the above code is using video file path as the parameter to fetch the thumbnails. In the lambda function, I can only fetch the base 64 encoded format of the file. I can get id (s3 path) of the file, but I cannot use it as the parameter (file path) to fetch the thumbnails as my s3 bucket does not allow public access.

    So, what I tried to do was that I tried to save the base 64 encoded video file locally in the lambda function project itself and then passed the file path as the parameter for fetching the thumbnails. But the issue was that AWS lamda function file system is read-only. So I cannot write any file to the file system. So what I am trying to do right now is to retrieve the thumbnails directly from the base 64 encoded video file. How can I do it ?

  • ffmpeg h.264 invalid cutting

    1er mai 2012, par E.Ar

    I have an s3 bucket with several hundreds video files.
    Those files were created by cutting parts of larger video files using ffmpeg.
    I wrote a script for this, which downloads the original video file from another bucket, runs ffmpeg to cut the file, and uploads the new file to it's bucket.
    For downloading and uploading from/to s3 i used this php library.
    The ffmpeg syntax I used :

    ffmpeg -y -vsync 2 -async 1 -ss [time-in] -t [duration] -i [large-input-video.mp4] -vcodec copy -acodec copy [short-output-video.mp4]

    Which should just cut the original file between the specified times, without any changes to the a/v codecs.
    All the original video files are encoded in h.264, and this is also the required encoding for the new files (which will be streamed through a CDN to the clients' flash players).

    My problem is that only a small part of the new files are coming out as encoded in h.264, but most of them aren't (h.264 is a must, otherwise the files wont play on the clients' side).
    I can't trace the problem to the original videos, since when i use the same ffmpeg command manually, with the same parameters and on the same files, the output files come out just fine. It seems arbitrary.

    I use ffprobe to get information about the files' codecs.
    For example :
    ffprobe of one of the large (original) video files :

    ...
    Stream #0.0(und) : Video : h264, yuv420p, 640x352, 499 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    ...

    ffprobe of the corresponding new cut file :

    ...
    Stream #0.0(und) : Video : mpeg4, yuv420p, 640x352 [PAR 1:1 DAR 20:11], 227 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
    ...

    As can be seen, the difference is in 'mpeg4' vs. 'h264'.

    Any insights on what can cause the new files to come out in the wrong encoding would be greatly appreciated.

    Thanks !

    Edit : Problem Resolved
    After analyzing all the files, I noticed that about two thirds of them are coming out in the wrong codec.
    Since I used three machines for the cutting process (three separate EC2 servers), it occurred to me that on two of them there is a bad installation of ffmpeg (as @LordNeckbeard suggested in his answer).
    I ran the process again, only on the invalid files, on the third machine alone - which produced the desired result.

  • Flask send_file not sending file

    30 avril 2021, par jackmerrill

    I'm using Flask with send_file() to have people download a file off the server.

    



    My current code is as follows :

    



    @app.route('/', methods=["GET", "POST"])
def index():
    if request.method == "POST":
        link = request.form.get('Link')
        with youtube_dl.YoutubeDL(ydl_opts) as ydl:
            info_dict = ydl.extract_info(link, download=False)
            video_url = info_dict.get("url", None)
            video_id = info_dict.get("id", None)
            video_title = info_dict.get('title', None)
            ydl.download([link])
        print("sending file...")
        send_file("dl/"+video_title+".f137.mp4", as_attachment=True)
        print("file sent, deleting...")
        os.remove("dl/"+video_title+".f137.mp4")
        print("done.")
        return render_template("index.html", message="Success!")
    else:
        return render_template("index.html", message=message)


    



    The only reason I have .f137.mp4 added is because I am using AWS C9 to be my online IDE and I can't install FFMPEG to combine the audio and video on Amazon Linux. However, that is not the issue. The issue is that it is not sending the download request.

    



    Here is the console output :

    



    127.0.0.1 - - [12/Dec/2018 16:17:41] "POST / HTTP/1.1" 200 -
[youtube] 2AYgi2wsdkE: Downloading webpage
[youtube] 2AYgi2wsdkE: Downloading video info webpage
[youtube] 2AYgi2wsdkE: Downloading webpage
[youtube] 2AYgi2wsdkE: Downloading video info webpage
WARNING: You have requested multiple formats but ffmpeg or avconv are not installed. The formats won't be merged.
[download] Destination: dl/Meme Awards v244.f137.mp4
[download] 100% of 73.82MiB in 00:02
[download] Destination: dl/Meme Awards v244.f140.m4a
[download] 100% of 11.63MiB in 00:00
sending file...
file sent, deleting...
done.
127.0.0.1 - - [12/Dec/2018 16:18:03] "POST / HTTP/1.1" 200 -


    



    Any and all help is appreciated. Thanks !