Recherche avancée

Médias (0)

Mot : - Tags -/interaction

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

Autres articles (56)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • 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 (...)

Sur d’autres sites (8380)

  • lavc/libvpxenc : Fix parsing of ts_layering_mode parameter

    16 mai 2024, par Aaron Thompson
    lavc/libvpxenc : Fix parsing of ts_layering_mode parameter
    

    The value was being parsed as base 4, so the value "4" was invalid and
    would result in ts_layering_mode being set to 0.

    Signed-off-by : Aaron Thompson <dev@aaront.org>
    Signed-off-by : James Zern <jzern@google.com>

    • [DH] libavcodec/libvpxenc.c
    • [DH] libavcodec/version.h
  • Creating a sequence of images from lyrics to use in ffmpeg

    19 septembre 2018, par SKS

    I’m trying to make an MP3 + Lyric -> MP4 program in python.

    I have a lyrics file like this :

    [00:00.60]Revelation, chapter 4
    [00:02.34]After these things I looked,
    [00:04.10]and behold a door was opened in heaven,
    [00:06.41]and the first voice which I heard, as it were,
    [00:08.78]of a trumpet speaking with me, said:
    [00:11.09]Come up hither,
    [00:12.16]and I will shew thee the things which must be done hereafter.
    [00:15.78]And immediately I was in the spirit:
    [00:18.03]and behold there was a throne set in heaven,
    [00:20.72]and upon the throne one sitting.
    [00:22.85]And he that sat,
    [00:23.91]was to the sight like the jasper and the sardine stone;
    [00:26.97]and there was a rainbow round about the throne,
    [00:29.16]in sight like unto an emerald.
    [00:31.35]And round about the throne were four and twenty seats;
    [00:34.85]and upon the seats, four and twenty ancients sitting,
    [00:38.03]clothed in white garments, and on their heads were crowns of gold.
    [00:41.97]And from the throne proceeded lightnings, and voices, and thunders;
    [00:46.03]and there were seven lamps burning before the throne,
    [00:48.60]which are the seven spirits of God.
    [00:51.23]And in the sight of the throne was, as it were,
    [00:53.79]a sea of glass like to crystal;
    [00:56.16]and in the midst of the throne, and round about the throne,
    [00:59.29]were four living creatures, full of eyes before and behind.
    [01:03.79]And the first living creature was like a lion:

    I’m trying to create a sequence of images from the lyrics to use into ffmpeg.

    os.system(ffmpeg_path + " -r 2 -i " + images_path + "image%1d.png -i " + audio_file + " -vcodec mpeg4 -y " + video_name)

    I tried finding out the number of images to make for each line. I’ve tried subtracting the seconds of the next line from the current line. It works but produces very inconsistent results.

    import os
    import datetime
    import time
    import math
    from PIL import Image, ImageDraw


    ffmpeg_path = os.getcwd() + "\\ffmpeg\\bin\\ffmpeg.exe"
    images_path = os.getcwd() + "\\test_output\\"
    audio_file = os.getcwd() + "\\audio.mp3"
    lyric_file = os.getcwd() + "\\lyric.lrc"

    video_name = "movie.mp4"


    def save():

       lyric_to_images()
       os.system(ffmpeg_path + " -r 2 -i " + images_path + "image%1d.png -i " + audio_file + " -vcodec mpeg4 -y " + video_name)


    def lyric_to_images():

       file  = open(lyric_file, "r")

       data = file.readlines()

       startOfLyric = True
       lstTimestamp = []

       images_to_make = 0
       from_second = 0.0
       to_second = 0.0

       for line in data:
           vTime = line[1:9] # 00:00.60

           temp = vTime.split(':')

           minute = float(temp[0])
           #a = float(temp[1].split('.'))
           #second = float((minute * 60) + int(a[0]))
           second = (minute * 60) + float(temp[1])

           lstTimestamp.append(second)

       counter = 1

       for i, second in enumerate(lstTimestamp):

           if startOfLyric is True:
               startOfLyric = False
               #first line is always 3 seconds (images to make = 3x2)
               for x in range(1, 7):
                   writeImage(data[i][10:], 'image' + str(counter))
                   counter += 1
           else:
               from_second = lstTimestamp[i-1]
               to_second = second

               difference = to_second - from_second
               images_to_make = int(difference * 2)

               for x in range(1, int(images_to_make+1)):
                   writeImage(data[i-1][10:], 'image'+str(counter))
                   counter += 1

       file.close()

    def writeImage(v_text, filename):

       img = Image.new('RGB', (480, 320), color = (73, 109, 137))

       d = ImageDraw.Draw(img)
       d.text((10,10), v_text, fill=(255,255,0))

       img.save(os.getcwd() + "\\test_output\\" + filename + ".png")


    save()

    Is there any efficient and accurate way to calculate how many images I need to create for each line ?

    Note : Whatever many images I create will have to be multiplied by 2 because I’m using -r 2 for FFmpeg (2 FPS).

  • Error : ENOENT : no such file or directory ( AWS Lambda function)

    29 janvier 2019, par Arun

    I am trying to convert the video file to audio using FFMPEG. But I keep getting this error while converting video to audio in AWS Lambda function. I searched a lot of googles but I can’t figure out a suitable solution.
    If anyone knows the answer please share your solution. I referred this video to audio convertion method from this post.

    Error :

    { Error: ENOENT: no such file or directory, lstat '/var/task/tmp/c82f117b7841f1c2a4c9cd86cd93aad9.mp3'
    at Error (native)
    at Object.fs.lstatSync (fs.js:994:11)
    at Object.byteLength (/var/task/node_modules/aws-sdk/lib/util.js:175:30)
    at Request.SET_CONTENT_LENGTH (/var/task/node_modules/aws-sdk/lib/event_listeners.js:161:40)
    at Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/var/task/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /var/task/node_modules/aws-sdk/lib/state_machine.js:26:10

    message: 'ENOENT: no such file or directory, lstat
    \'/var/task/tmp/c82f117b7841f1c2a4c9cd86cd93aad9.mp3\'',
    errno: -2,
    code: 'ENOENT',
    syscall: 'lstat',
    path: '/var/task/tmp/c82f117b7841f1c2a4c9cd86cd932332.mp3'}

    Code

    const child_process = require('child_process');
    const fs = require('fs');
    const path = require('path');

    const AWS = require('aws-sdk');
    const request = require('request');
    const tempy = require('tempy');

    const s3 = new AWS.S3();


    exports.handler = (event, context, callback) => {
     // We're going to do the transcoding asynchronously, so we callback immediately.
     callback();

     // Extract the event parameters.
     const { mp3Key, url } = event;

     const filename = event.filename || path.basename(mp3Key);
     const logKey = event.logKey || `${mp3Key}.log`;
     const s3Bucket = event.s3Bucket || 'bucket-name;

     // Create temporary input/output filenames that we can clean up afterwards.
     const inputFilename = tempy.file();
     const mp3Filename = tempy.file({ extension: 'mp3' });

     // Download the source file.
     Promise.resolve().then(() => new Promise((resolve, revoke) => {
       const writeStream = fs.createWriteStream(inputFilename);
       writeStream.on('finish', resolve);
       writeStream.on('error', revoke);
       request(url).pipe(writeStream);
     }))
     // Perform the actual transcoding.
     .then(() => {
       // Use the Exodus ffmpeg bundled executable.
       const ffmpeg = path.resolve(__dirname, 'exodus', 'bin', 'ffmpeg');

       // Convert the FLV file to an MP3 file using FFmpeg.
       const ffmpegArgs = [
         '-i', inputFilename,
         '-vn', // Disable the video stream in the output.
         '-acodec', 'libmp3lame', // Use Lame for the mp3 encoding.
         '-ac', '2', // Set 2 audio channels.
         '-q:a', '6', // Set the quality to be roughly 128 kb/s.
         mp3Filename,
       ];
       const process = child_process.spawnSync(ffmpeg, ffmpegArgs);
       console.log("process ", process.stdout);
       // return process;
     // return process.stdout.toString() + process.stderr.toString();
     })
     // Upload the generated MP3 to S3.
     .then(logContent => new Promise((resolve, revoke) => {
       console.log("inside s3 upload", mp3Filename)
       s3.putObject({
         Body: fs.createReadStream(mp3Filename),
         Bucket: s3Bucket,
         Key: mp3Key,
         ContentDisposition: `attachment; filename="${filename.replace('"', '\'')}"`,
         ContentType: 'audio/mpeg',
       }, (error) => {
         if (error) {
           revoke(error);
         } else {
           // Update a log of the FFmpeg output.
           const logFilename = path.basename(logKey);
           console.log("log file upload")
           s3.putObject({
             Body: logContent,
             Bucket: s3Bucket,
             ContentType: 'text/plain',
             ContentDisposition: `inline; filename="${logFilename.replace('"', '\'')}"`,
             Key: logKey,
           }, resolve);
         }
       })
     }))
     .catch(console.error)
     // Delete the temporary files.
     .then(() => {
       [inputFilename, mp3Filename].forEach((filename) => {
         if (fs.existsSync(filename)) {
           fs.unlinkSync(filename);
         }
       });
     });
    };