Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (17)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (4869)

  • FFmpeg transcoding on Lambda results in unusable (static) audio

    17 mai 2020, par jmkmay

    I'd like to move towards serverless for audio transcoding routines in AWS. I've been trying to setup a Lambda function to do just that ; execute a static FFmpeg binary and re-upload the resulting audio file. The static binary I'm using is here.

    



    The Lambda function I'm using in Python looks like this :

    



    import boto3

s3client = boto3.client('s3')
s3resource = boto3.client('s3')

import json
import subprocess 

from io import BytesIO

import os

os.system("cp -ra ./bin/ffmpeg /tmp/")
os.system("chmod -R 775 /tmp")

def lambda_handler(event, context):

    bucketname = event["Records"][0]["s3"]["bucket"]["name"]
    filename = event["Records"][0]["s3"]["object"]["key"]

    audioData = grabFromS3(bucketname, filename)

    with open('/tmp/' + filename, 'wb') as f:
        f.write(audioData.read())

    os.chdir('/tmp/')

    try:
        process = subprocess.check_output(['./ffmpeg -i /tmp/joe_and_bill.wav /tmp/joe_and_bill.aac'], shell=True, stderr=subprocess.STDOUT)
        pushToS3(bucketname, filename)
        return process.decode('utf-8')
    except subprocess.CalledProcessError as e:
        return e.output.decode('utf-8'), os.listdir()


def grabFromS3(bucket, file):

    obj = s3client.get_object(Bucket=bucket, Key=file)
    data = BytesIO(obj['Body'].read())

    return(data)

def pushToS3(bucket, file):

    s3client.upload_file('/tmp/' + file[:-4] + '.aac', bucket, file[:-4] + '.aac')

    return


    



    You can listen to the output of this here. WARNING : Turn your volume down or your ears will bleed.

    



    The original file can be heard here.

    



    Does anyone have any idea what might be causing the encoding errors ? It doesn't seem to be an issue with the file upload, since the md5 on the Lambda fs matches the MD5 of the uploaded file.

    



    I've also tried building the static binary on an Amazon Linux instance in EC2, then zipping and porting it into the Lambda project, but the same issue persists.

    



    I'm stumped ! :(

    


  • FFMPEG for aws s3 bucket signed url not working in node js

    21 août 2018, par ahmed sharief

    I am trying to create thumbnails from an amazon s3 bucket signed url. I am able to generate thumbnails when i run the command in terminal

    ffmpeg -ss 00:00:02 -i "https://test-s3-bucket.s3.ap-south-1.amazonaws.com/user_gallery_assets/5b6936069ac2bf0602085367/gallery/images/5b7be08527641dee8c1f8134.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxxxxx%2F20180821%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20180821T095101Z&X-Amz-Expires=900&X-Amz-Signature=d7f81f4eed3d6c87c04dc1b0ad06beeb946afa33d417585f57fad72aeadb3ac0&X-Amz-SignedHeaders=host" -vframes 1 -q:v 2 -f image2 output.jpg

    I am running the above command in terminal and its working fine but when i try to implement the same in node js its showing "no such file or directory error". Though i am encoding the url with double quotes then also its showign same error. Here is my node js code....

    function uploadThumbNailForVideo(obj,url, thumb_url){
       return new Promise((resolve, reject) => resolve(url))
       .then((url) => awsHelper.getImage(url))
       .then((result) => {

           var resUrl = "\""+result+"\"";

           var args = [
               '-i', resUrl,
               '-ss', '00:00:02',
               '-vframes', '1',
               '-f','image2',
               'output.jpg'
           ]
           //console.log(args)
           var ffmpeg = require('child_process').spawn('ffmpeg', args);

           ffmpeg.on('error', function (err) {
               console.log(err);
           });

           ffmpeg.on('close', function (code) {

           });

           ffmpeg.stderr.on('data', function (data) {
               var tData = data.toString('utf8');
               var a = tData.split('\n');
               console.log("A",a);
           });

           ffmpeg.stdout.on('data', function (data) {
               //
           });


       });

    }

    and i am getting the following error

    A [ 'ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg
    developers' ]
    A [ '',
     '  built with Apple LLVM version 9.1.0 (clang-902.0.39.2)',
     '  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.2 --enable-
    shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --
    enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-
    gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-
    opencl --enable-videotoolbox --disable-lzma',
      '  libavutil      56. 14.100 / 56. 14.100',
      '  libavcodec     58. 18.100 / 58. 18.100',
     '  libavformat    58. 12.100 / 58. 12.100',
     '  libavdevice    58.  3.100 / 58.  3.100',
     '  libavfilter     7. 16.100 /  7. 16.100',
     '  libavresample   4.  0.  0 /  4.  0.  0',
     '  libswscale      5.  1.100 /  5.  1.100',
     '  libswresample   3.  1.100 /  3.  1.100',
     '  libpostproc    55.  1.100 / 55.  1.100',
     '"https://test-s3-bucket.s3.ap-south-1.amazonaws.com/user_gallery_assets/5b6936069ac2bf0602085367/gallery/images/5b7be08527641dee8c1f8134.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=xxxxxxxxx%2F20180821%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20180821T095101Z&X-Amz-Expires=900&X-Amz-Signature=d7f81f4eed3d6c87c04dc1b0ad06beeb946afa33d417585f57fad72aeadb3ac0&X-Amz-SignedHeaders=host": No such file or directory',
     '' ]

    ffmpeg exited with code 1
  • How to generate video as fast as possible with subtitles and audio on node.js + ffmpeg ?

    12 septembre 2018, par DSeregin

    Intro :

    We receive from the site some pieces of text
    Pieces arrive to node.js-server

    At the output we need to get a video, merged from all the pieces of text, voiced by the machine voice, with the added subtitles and audio substrate. So that user could be share this video in the social networks. MKV format doesn`t supported by VK.com

    The options that we have tried :
    1. Get all the text at once, generate the entire speech, create a file with subtitles, burn subtitles in the video .mp4 (vk.com does not support the .mkv container). It took 12 seconds of operations for a 45-second video on the local computer.
    2. Generate audio and video files for each piece of text (with added subtitles). It took one second for one piece of text. At the final request, we merge all pieces together. The last request (merging) took 2-3 seconds, which is already bearable.

    The second variant looks acceptable in terms of speed, but if you run 50 clients at the same time, then the computer (tested on a MacBook PRO 2013, 2.4 GHz i7, 8gb 1600 Mhz DDR3, SSD 256gb) processed only 1 piece from 1 client in 60 seconds (60 times slower), then the computer hung tight.

    The commands we used :

    • Burn video subtitles and trim up to conditional 6 seconds (in the code send unix timestamp)

    ffmpeg -i import / back.mov -i export_0 / tmp.srt -scodec mov_text -t 6 export_0 / output.mov

    • Merging all audio

    ffmpeg -i audio1.mp3 .... -i audio15.mp3 merged.mp3

    • Overlay audio-substrate on the text

    ffmpeg -i merged.mp3 -i back.mp3 -filter_complex amerge -ac 2-c: a libmp3lame -q: a 4 -shortest audio.mp3

    • Merging all videos

    ffmpeg -i video.txt -f concat -c copy video.mp4

    • Overlay audio on video

    ffmpeg -i audio.mp3 -i video.mp4 -i test.mp4 -i export / output.mp3 -c: v copy -c: a aac -map 0: v: 0 -map 1: a: 0 -shortest output .mp4

    Questions that torment :

    1. Is it faster ?

    2. Can I use other codecs or methods of gluing without re-encoding ?

    3. Try to call ffmpeg directly without a wrapper ? (in fact, it gives 50-100 ms of speed)

    4. Try not to save to disk, and write data to Stream and have them glue together in the end ?