Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (28)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (5031)

  • Why won't this encrypted HLS video play on iOS (but works on Windows Chrome via hls.js library) ?

    8 mai 2023, par Ryan

    I am trying to play an MP4 test video.

    


    My /home/vagrant/Code/example/public/hls_hls.keyInfo is :

    


    https://example.com/hls.key
/home/vagrant/Code/example/public/hls_hls.key
467216aae8a26fb699080812628031955e304a66e9e4480f9b70d31d8fe94e9a


    


    My /home/vagrant/Code/example/public/hls_hls.key was generated using PHP : hex2bin('467216aae8a26fb699080812628031955e304a66e9e4480f9b70d31d8fe94e9a')

    


    The ffmpeg command for encrypting the video as HLS playlist with "ts" files :

    


    '/usr/bin/ffmpeg' '-y' '-i' 'storage/app/sample_media2/2020-02-27/Sample_Videos_5.mp4' 
'-c:v' 'libx264' '-s:v' '1920x1080' '-crf' '20' '-sc_threshold' '0' '-g' '48' 
'-keyint_min' '48' '-hls_list_size' '0' 
'-hls_time' '10' '-hls_allow_cache' '0' '-b:v' '4889k' '-maxrate' '5866k' 
'-hls_segment_type' 'mpegts' '-hls_fmp4_init_filename' 'output_init.mp4' 
'-hls_segment_filename' 'storage/app/public/test/output_1080p_%04d.ts' 
'-hls_key_info_file' '/home/vagrant/Code/example/public/hls_hls.keyInfo' 
'-strict' '-2' '-threads' '12' 'storage/app/public/test/output_1080p.m3u8'


    


    Then, I know from https://caniuse.com/#search=hls that Windows Chrome won't be able to play the HLS video without a library, so I use https://github.com/video-dev/hls.js/, and Windows Chrome successfully plays the encrypted video !

    


    However, iOS Safari is unable to play it (with or without the hls.js library).

    


    On iOS Safari, when I try to play the video, I see just a quick glimpse (less than a second) where the screen shows 0:15, so it must be reading and decrypting enough to know the correct duration of the video.

    


    So, to debug, I log events :

    


    const nativeHlsEvents = ['play', 'playing', 'abort', 'error', 'canplaythrough', 'waiting', 'loadeddata', 'loadstart', 'progress', 'timeupdate', 'volumechange'];
$.each(nativeHlsEvents, function (i, eventType) {
    video.addEventListener(eventType, (event) => {//https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement
        console.log(eventType, event);
        if (eventType === 'error') {
            console.error(video.error);//https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/error
        }
    });
});


    


    I see in the console log :

    


    loadstart, {"isTrusted":true}
progress, {"isTrusted":true}
play, {"isTrusted":true}
waiting, {"isTrusted":true}
error, {"isTrusted":true}
video.error, {}


    


    I don't know how to find more details about the error.

    


    Note that even though Windows Chrome successfully plays the video, it too shows warnings in the console log :

    


    {"type":"mediaError","details":"fragParsingError","fatal":false,"reason":"TS packet did not start with 0x47","frag":{"...
{"type":"mediaError","details":"fragParsingError","fatal":false,"reason":"no audio/video samples found","frag":{...


    


    Where is my problem ?

    


  • Python librosa NoBackendError even though ffmpeg is installed

    11 avril 2020, par Slavko Kovačević

    I recently installed librosa (package I've been using for a while on different PC) on my new PC with Windows 10 running. After that I've downloaded latest static version of ffmpeg and copied it to C: and added it to the Path. Tested ffmpeg and it works like a charm ! For python I am using Anaconda environment and after starting Jupyter Notebook and running librosa.load(path, sr = None) I've got

    



     in <module>&#xA;----> 1 audio = librosa.load(pathToJson)&#xA;&#xA;~\anaconda3\envs\tf_gpu\lib\site-packages\librosa\core\audio.py in load(path, sr, mono, offset, duration, dtype, res_type)&#xA;    117 &#xA;    118     y = []&#xA;--> 119     with audioread.audio_open(os.path.realpath(path)) as input_file:&#xA;    120         sr_native = input_file.samplerate&#xA;    121         n_channels = input_file.channels&#xA;&#xA;~\anaconda3\envs\tf_gpu\lib\site-packages\audioread\__init__.py in audio_open(path, backends)&#xA;    114 &#xA;    115     # All backends failed!&#xA;--> 116     raise NoBackendError()&#xA;&#xA;NoBackendError:&#xA;</module>

    &#xA;&#xA;

    strange isn't it ? Then I went all over the internet, doing whatnot trying to fix it and then I've got an idea to run my line of code inside anaconda command interface and it WORKS ?? How is this possible ? It is the same environment.

    &#xA;&#xA;

    python&#xA;Python 3.7.7 (default, Mar 23 2020, 23:19:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32&#xA;Type "help", "copyright", "credits" or "license" for more information.&#xA;>>> import librosa&#xA;>>> librosa.load(&#x27;test.wav&#x27;)&#xA;(array([-0.00027   , -0.00039953, -0.0003659 , ..., -0.16393574,&#xA;       -0.17814247,  0.        ], dtype=float32), 22050)&#xA;

    &#xA;&#xA;

    I did a lot of testing and I really prefer my Jupyter so any help would be appreciated. I tried the following : I've added C:\ffmpeg\bin and C:\ffmpeg to my Path for both User and System Variables. After that I've made specific variables for ffmpeg and ffmpeg_bin for both User and System Variables. No luck. After that I've tried installing ffmpeg using conda, without success. The last thing I've tested is this :

    &#xA;&#xA;

    import audioread&#xA;audioread.ffdec.FFmpegAudioFile(&#x27;test.wav&#x27;)&#xA;

    &#xA;&#xA;

    and that works. Thanks

    &#xA;

  • Unknown V4L2 pixel format equivalent for yuvj420p

    23 mars 2020, par c10ud

    I am trying to pipe a mp4 video located in Videos/video.mp4 to a virtual webcam device located at /dev/video0.

    I tried running :
    ffmpeg -re -i Videos/video.mp4 -map 0:v -f v4l2 /dev/video0
    and I keep getting the following error :

    [video4linux2,v4l2 @ 0x5580cf270100] Unknown V4L2 pixel format equivalent for yuvj420p
    Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
    Error initializing output stream 0:0 --
    Conversion failed!

    Full log :

    ffmpeg version 4.2.2-1+b1 Copyright (c) 2000-2019 the FFmpeg developers
     built with gcc 9 (Debian 9.2.1-28)
     configuration: --prefix=/usr --extra-version=1+b1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
     libavutil      56. 31.100 / 56. 31.100
     libavcodec     58. 54.100 / 58. 54.100
     libavformat    58. 29.100 / 58. 29.100
     libavdevice    58.  8.100 / 58.  8.100
     libavfilter     7. 57.100 /  7. 57.100
     libavresample   4.  0.  0 /  4.  0.  0
     libswscale      5.  5.100 /  5.  5.100
     libswresample   3.  5.100 /  3.  5.100
     libpostproc    55.  5.100 / 55.  5.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Videos/video.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       creation_time   : 2020-03-23T04:24:01.000000Z
       com.android.version: 8.1.0
     Duration: 00:01:00.14, start: 0.000000, bitrate: 20048 kb/s
       Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1920x1080, 19898 kb/s, SAR 1:1 DAR 16:9, 29.43 fps, 29.58 tbr, 90k tbn, 180k tbc (default)
       Metadata:
         rotate          : 270
         creation_time   : 2020-03-23T04:24:01.000000Z
         handler_name    : VideoHandle
       Side data:
         displaymatrix: rotation of 90.00 degrees
       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
       Metadata:
         creation_time   : 2020-03-23T04:24:01.000000Z
         handler_name    : SoundHandle
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
    Press [q] to stop, [?] for help
    [video4linux2,v4l2 @ 0x5580cf270100] Unknown V4L2 pixel format equivalent for yuvj420p
    Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
    Error initializing output stream 0:0 --
    Conversion failed!

    The desired result is that the mp4 video is seen by apps that try to view the webcam. I am running this on a desktop without a webcam or video interface, which is why I am using /dev/video0