Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (106)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

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

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

Sur d’autres sites (7275)

  • Streaming from FFMPEG to liquidsoap results in wrong bytes per second

    8 janvier 2018, par Valdir

    If I create a ReadStream directly from a mp3 file and pipe it to nodeshout (libshout wrapper) in order to send it to liquidsoap I basically get packets of +-2.7 seconds sent in interval of 2.7 seconds.

    readable = fs.createReadStream(filename, {start: start});
    readable.pipe(shoutStream);

    So, everything works as expected. I get each frame sent on the correct time.

    If I put node-lame in between I get a different behavior (I need to decode to PCM in order to use pcm-volume lib) :

       var decoder = new lame.Decoder({
           channels: 2,
           bitDepth: 16,
           sampleRate: 44100,
           bitRate: 128,
           outSampleRate: 44100,
           mode: lame.STEREO
       });

       var encoder = new lame.Encoder({

           channels: 2,        
           bitDepth: 16,      
           sampleRate: 44100,  

           // output
           bitRate: 128,
           outSampleRate: 44100,
           mode: lame.STEREO
       });

    The problem is that I no longer get frames in interval of 2.7 seconds when reading the first frames. Actually it sends 3 frames at once than continues with the normal flow, of one frame each 2.7 seconds.

    So, I tried to do the same with FFMPEG :

    function spawnFfmpegMP3ToPCM() {

       var args = [
           '-re',
           '-i', 'pipe:0',
           '-f', 's16le',
           '-acodec', 'pcm_s16le',
           '-ar', '44100',
           '-ac', '2',
           'pipe:1'
       ];

       return spawn('ffmpeg', args);
    }

    function ffmpegPCMtoMP3() {
       var args = [
           '-f', 's16le',
           '-ac', '2',
           '-i', 'pipe:0',
           '-acodec', 'libmp3lame',
           '-f', 'mp3',
           '-b:a', '128k',
           '-ar', '44100',
           '-ac', '2',
           '-framerate', '24',
           'pipe:1'
       ];

       return spawn('ffmpeg', args);
    }

    I basically pipe the mp3 to the decoder, the decoder to the pcm-volume and the pcm-volume to the encoder and the shoutStream. The result is that I get 4 initial frames of 2.7 seconds and then the flow continues with 3 frames of 2.7 seconds at a time.

    What I want to achieve is one frame per 2.7 seconds as in the first example of a read stream without deconding/encondig.

  • What is the proper input format for drawtext's timecode option in fluent-ffmpeg (node.js) ?

    24 janvier 2023, par Gil Dekel

    I am trying to generate short video clips from 3 images with a simple millisecond counter at the top left per user request. So far I was able to generate the clips using the videoshow npm lib, no issues here.

    



    However, when I try to add the timer via fluent-ffmpeg's drawtext filter to an already generated video, I run into the following issue.

    



    Here's what I have so far :

    



    ffmpeg('video.mp4')
    .on('error', function(err, stdout, stderr) {
      console.log("ffmpeg stdout:\n" + stdout);
      console.log("ffmpeg stderr:\n" + stderr);
    })
    .videoCodec('libx264')
    .format('mp4')
    .fps(fps)
    .complexFilter([
        {
            filter: 'drawtext',
            options: {
                fontsize: 15,
                timecode: '00\:00\:00\:00',  //<--- Issue is most likely here
                fontsize: 32,
                fontcolor: 'white',
                boxcolor: 'black',
                box: 1
            }
        }
    ]).save('out.mp4');


    



    From what I found online I am quite convinced that my problem is with the timecode input format. Here's my error log :

    



    ffmpeg stderr:
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --disable-jack --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-nonfree
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:01.03, start: 0.000000, bitrate: 585 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x1136 [SAR 923:924 DAR 130:231], 573 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
[Parsed_drawtext_0 @ 0x7f91aa700700] Both text and text file provided. Please provide only one
[AVFilterGraph @ 0x7f91aa700440] Error initializing filter 'drawtext' with args 'fontsize=32:timecode=00:00:00:00:fontcolor=white:boxcolor=black:box=1'
Error initializing complex filters.
Invalid argument


    



    Specifically this :

    



    [Parsed_drawtext_0 @ 0x7f91aa700700] Both text and text file provided. Please provide only one


    



    When I run what should be the equivalent to my code in shell, it works perfectly :

    



    ffmpeg -i video.mp4 \
       -vf drawtext="fontsize=15:timecode='00\:00\:00\:00':rate=60:fontsize=32:fontcolor='white':\
           boxcolor=0x000000AA:box=1" \
       -f mp4 out.mp4


    



    I already spent a whole day trying to find any previous solutions to this problem, or documentation online regarding the proper format of drawtext's timecode option within node.js with no luck. It seems most of the information out there is for bash/shell use. I need to do this programmatically on a server per request, and I just can't find the right example to solve this.

    



    Any help to resolve this would be appreciated.

    


  • creating a video using ffmpeg command with image name pattern [duplicate]

    21 mars 2018, par Junaid Farooq

    This question already has an answer here :

    I am coming from this question
    https://askubuntu.com/questions/610903/how-can-i-create-a-video-file-from-a-set-of-jpg-images

    Everything is working fine and I can create a video, I am only struggling with the image name pattern. Each time, I had to rename all files first to a specific pattern.

    Can we create a video using the same command written below but with this kind of image name pattern ?

    2018-01-19-11-55-00.jpg  2018-01-19-17-00-00.jpg  2018-01-22-10-10-00.jpg  2018-01-22-13-25-00.jpg  2018-01-22-16-40-00.jpg
    2018-01-19-12-00-00.jpg  2018-01-19-17-05-00.jpg  2018-01-22-10-15-00.jpg  2018-01-22-13-30-00.jpg  2018-01-22-16-45-00.jpg

    I want to use this command

    ffmpeg -framerate 25 -i image-%04d.jpg -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output.mp4

    but this one using

    image-2000.jpg  image-2400.jpg  image-2800.jpg

    above image pattern.

    Is there any possibility to use the above pattern of files which are being named as a date. also, all these images are in a folder. Can FFMPEG address them ?