Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (22)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

Sur d’autres sites (3607)

  • FFMpeg - add background music

    22 août 2018, par jacky brown

    here is what i have :
    input1.avi - video that contain sounds.
    input2.avi - video that doesn’t contain sounds.
    music.mp3 - audio file.

    i want to add background music(music.mp3 file) to the video.

    C:\input1.avi -i C:\music.mp3 -shortest -c:v copy -c:a copy C:\output1.avi

    then output1.avi is the same as input1 - movie with sounds but without the background music (music.mp3)

    when i try to use the other file (video without sounds) :

    C:\input2.avi -i C:\music.mp3 -shortest -c:v copy -c:a copy C:\output2.avi

    then output2.avi is the same as input2 + it have the background music.

    so why input1 does not contain the background music ???
    and how can i decrease or increase the volume of music.mp3 file ?

    thanks.


    console output :

    C:\motionbee\ffmpeg\bin>ffmpeg -i C:\input.avi
    -i C:\music.mp3 -shortest -c:v copy -filter_
    complex "[0:a]aformat=fltp:44100:stereo[0a];[1]aformat=fltp:44100:stereo,volume=
    1.5[1a];[0a][1a]amix[a]" -map 0:v -map "[a]" -ac 2 C:\output1.avi
    ffmpeg version N-78949-g6f5048f Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 5.3.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
    enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
    ibilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopenc
    ore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --ena
    ble-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable
    -libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --ena
    ble-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx
    264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable
    -lzma --enable-decklink --enable-zlib
     libavutil      55. 19.100 / 55. 19.100
     libavcodec     57. 27.101 / 57. 27.101
     libavformat    57. 28.100 / 57. 28.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 39.100 /  6. 39.100
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    Input #0, avi, from 'C:\input.avi':
     Metadata:
       encoder         : Lavf57.28.100
     Duration: 00:02:05.76, start: 0.000000, bitrate: 450 kb/s
       Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 720
    x480 [SAR 1:1 DAR 3:2], 440 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
       Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16p, 128 k
    b/s
    [mp3 @ 00000000005c8020] Skipping 0 bytes of junk at 32370.
    Input #1, mp3, from 'C:\music.mp3':
     Metadata:
       title           : Broadcast News Package - News Intro
       artist          : After Effects News Template
     Duration: 00:01:57.89, start: 0.025057, bitrate: 194 kb/s
       Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 192 kb/s
       Metadata:
         encoder         : Lavc56.26
    File 'C:\output1.avi' already exists. Overwrite
    ? [y/N] y
    Output #0, avi, to 'C:\output1.avi':
     Metadata:
       ISFT            : Lavf57.28.100
       Stream #0:0: Video: mpeg4 (XVID / 0x44495658), yuv420p, 720x480 [SAR 1:1 DAR
    3:2], q=2-31, 440 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
       Stream #0:1: Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 44100 Hz, stereo
    , fltp (default)
       Metadata:
         encoder         : Lavc57.27.101 libmp3lame
    Stream mapping:
     Stream #0:1 (mp3) -> aformat
     Stream #1:0 (mp3) -> aformat
     Stream #0:0 -> #0:0 (copy)
     amix -> Stream #0:1 (libmp3lame)
    Press [q] to stop, [?] for help
    frame= 3118 fps=0.0 q=-1.0 Lsize=    6917kB time=00:02:05.76 bitrate= 450.6kbits
    /s speed= 867x
    video:6754kB audio:74kB subtitle:0kB other streams:0kB global headers:0kB muxing
    overhead: 1.307944%
  • Extract raw audio frames from OGG music file with Android NDK

    31 octobre 2018, par thenaoh

    In my Android app, I would like to be able to process audio on the fly from an OGG file by extracting audio samples, process them and redirect them to the audio output.

    I know how to make the last 2 steps using Android NDK, but I don’t know how to extract audio samples to get them in an array of floats or shorts.

    I tried to make this code work that, apparently, can extract raw audio samples on the fly.

    The problem is : I don’t manage to add FFMpeg in my project. I tried many tutorials (like this one), but it seems pretty difficult since I work on Windows. So after a while, I found Prebuild FFMpeg for Android, that seems interesting since it’s available for armeabi-v7a, arm64-v8a, x86 and x86_64 architectures, but again, I don’t understand how to add it in my project.

    I also took a look at libogg, libvorbis and vorbisfile, but I have no idea how to add them in my project.

    So, does anyone have a working example on how to extract audio samples from an OGG file on the fly ?

    Thanks for your help.

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