Recherche avancée

Médias (1)

Mot : - Tags -/embed

Autres articles (111)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

Sur d’autres sites (8463)

  • 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

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

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

    &#xA;

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

    &#xA;

    https://example.com/hls.key&#xA;/home/vagrant/Code/example/public/hls_hls.key&#xA;467216aae8a26fb699080812628031955e304a66e9e4480f9b70d31d8fe94e9a&#xA;

    &#xA;

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

    &#xA;

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

    &#xA;

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

    &#xA;

    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 !

    &#xA;

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

    &#xA;

    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.

    &#xA;

    So, to debug, I log events :

    &#xA;

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

    &#xA;

    I see in the console log :

    &#xA;

    loadstart, {"isTrusted":true}&#xA;progress, {"isTrusted":true}&#xA;play, {"isTrusted":true}&#xA;waiting, {"isTrusted":true}&#xA;error, {"isTrusted":true}&#xA;video.error, {}&#xA;

    &#xA;

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

    &#xA;

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

    &#xA;

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

    &#xA;

    Where is my problem ?

    &#xA;