Recherche avancée

Médias (91)

Autres articles (41)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (7860)

  • Python : How to convert a mp3 chunk from webstream to .wav samples ?

    13 novembre 2019, par Bendzko

    I’m trying to catch chunks of an mp3 webstream and coverting them into wav samples for signal processing. I tried to catch the audio via requests and io.BytesIO to save the data as .wav file.
    But I think, that I have to convert the mp3 data to wav data, but I don’t know how. (My goal is not to record a .wav file, i am just doing this to test the algorithm.)

    I found the pymedia lib, but it is very old (last commit in 2006), using python 2.7 and for me not installable.

    Maybe it is possible with ffmpeg-python, but I have just seen examples using files as input and output.

    Here’s my code :

    import requests
    import io
    import soundfile as sf
    import struct
    import wave
    import numpy as np


    def main():
       stream_url = r'http://dg-wdr-http-dus-dtag-cdn.cast.addradio.de/wdr/1live/diggi/mp3/128/stream.mp3'
       r = requests.get(stream_url, stream=True)
       sample_array = []
       try:
           for block in r.iter_content(1024):
               data, samplerate = sf.read(io.BytesIO(block), format="RAW", channels=2, samplerate=44100, subtype='FLOAT',
                                          dtype='float32')
               sample_array = np.append(sample_array, data)

       except KeyboardInterrupt:
           print("...saving")
           obj = wave.open('sounds/stream1.wav', 'w')
           obj.setnchannels(1)  # mono
           obj.setsampwidth(2)  # bytes
           obj.setframerate(44100)

           data_max = np.nanmax(abs(sample_array))

           # fill WAV with samples from sample_array
           for sample in sample_array:
               if (np.isnan(sample) or np.isnan(32760 * sample / data_max)) is True:
                   continue
               try:
                   value = int(32760 * sample / data_max)  # normalization INT16
               except ValueError:
                   value = 1
               finally:
                   data = struct.pack('code>

    Do you have an idea how to handle this problem ?

  • compiling ffmpeg libs with libvpx enabled on windows

    12 juin 2021, par Satishsuman

    Need some regarding compiling ffmpeg with libvpx enabled on windows. Here is the steps i followed and error i got

    



      

    1. installed msys2 on windows and installed required packages(git,pkg-config,gcc compiler etc)
    2. 


    3. cloned libvpx from "https://github.com/webmproject/libvpx.git" and created a vs15 solution(command : ./configure —disable-vp8 —disable-vp9-encoder —target=x86_64-win64-vs15)
    4. 


    5. open vpx.sln and compiled vpxmd.lib sucessfully(created a vpx.pc file and kept include and libs at proper place)
    6. 


    7. cloned ffmpeg from https://github.com/FFmpeg/FFmpeg.git and from msys2 i tried building it(command : ./configure —enable-asm —enable-yasm —arch=x86_64 —target-os=win64 —disable-encoders —disable-muxers —enable-libvpx —disable-doc —disable-ffplay —disable-ffprobe —disable-ffmpeg —enable-shared —disable-static —disable-bzlib —disable-libopenjpeg —disable-iconv —disable-zlib —prefix=/d/Stadia/FFmpeg —toolchain=msvc —disable-debug)
    8. 


    



    ffmpeg libs a building fine but it doesn't include libvpx.
config.log is below :

    



    


    ./ffconf.NEscC1Fm/test.c(4) : warning C4311 : 'type cast' : pointer
 truncation from 'vpx_codec_iface_t *(__cdecl *)(void)' to 'long'

    
 


    ./compat/windows/mslink /usr/local/lib -nologo -I/usr/local/include
 -libpath :/usr/local/lib -out :./ffconf.NEscC1Fm/test.exe ./ffconf.NEscC1Fm/test.o vpx.lib

    
 


    LINK : warning LNK4044 : unrecognized option
 '/IC :/msys64/usr/local/include' ; ignored lib.obj(vp8_vp8_dx_iface.obj)
 : MSIL .netmodule or module compiled with /GL found ; restarting link
 with /LTCG ; add /LTCG to the link command line to improve linker
 performance

    
 


    LINK : warning LNK4044 : unrecognized option
 '/IC :/msys64/usr/local/include' ; ignored

    
 


    LINK : warning LNK4098 : defaultlib 'MSVCRT' conflicts with use of
 other libs ; use /NODEFAULTLIB:library lib.obj(vpx_mem_vpx_mem.obj) : 
 error LNK2001 : unresolved external symbol __imp_malloc
 lib.obj(vp8_decoder_threading.obj) : error LNK2001 : unresolved
 external symbol __imp__beginthreadex
 lib.obj(vp8_decoder_decodeframe.obj) : error LNK2001 : unresolved
 external symbol __imp_fopen ./ffconf.NEscC1Fm/test.exe : fatal error
 LNK1120 : 3 unresolved externals

    
 


    my msys2 is installed at C :/msys2/ and /home/ correspond to
 C/msys2/home if i use —extra-ldflags="-L/home/usr/local/lib" , linker
 treates it as /LC :/msys2/usr/local/lib and hence fails.

    


    



    A step by step guide would be very much appreciated here

    


  • php ffmpeg exec & shell_exec process stops after few seconds

    6 octobre 2019, par Salem

    I’m using PHP script file with simple html interface to control FFMPEG process start and stop from the browser , the script goal is start live streaming on my server that usually runs for hours without stop (using ffmpeg and nginx-rtmp )
    my script were working perfectly until I notice recently This is strange behaviors
    here is my php script variables

    $cast =" /usr/sbin/ffmpeg -loglevel 0 -thread_queue_size 32768 -re -i '".$src."' -i /var/www/example/logo.png -r 23.976 -strict -2 480x360 -aspect 16:9 -filter_complex 'overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)-23' -vcodec libx264 -x264opts colormatrix=bt709 -profile:v high444 4 -b:v 290k -maxrate 290k -bufsize 250k  -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0" -acodec libfdk_aac -profile:a aac_he_v2 -b:a 16k -map_metadata -1 -f flv  rtmp://localhost/hls/live 2>/dev/null >/dev/null  & " ;
    $output =  shell_exec( $cast   )    ;

    It’s like FFMPEG process continue until original php process ( that call it ) die , at first I thought this issue with the sorce or ffmpeg command but I test the same command on the sell and it works perfectly .
    My suspicion are with on STDIO etc were not redirected right . even when I excute the same php script from the shell it’s do the same stops after few seconds .

    =Edit=

    Even when I tried to run ffmpeg from the command line and make it run on the background , I got same behavior the process stop after few seconds , ffmpeg continue running only if I wait for it output .

    Here my OS details :-

    DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"
    NAME="Ubuntu"
    VERSION="18.04.3 LTS (Bionic Beaver)"