Recherche avancée

Médias (1)

Mot : - Tags -/publicité

Autres articles (111)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

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

Sur d’autres sites (8211)

  • Python Virtualenv & Youtube_dl : ffprobe or avprobe not found. Please install one

    25 janvier 2020, par J. Diaz
    • My goal : Download podcast as MP3
    • Used Python, Flask and Youtube_dl on Ubuntu 18.04 and Nginx
    • I followed this tutorial to set up my server : Flask app with uSWGI and Nginx

    Point 1 : Deployment was successful and running a simple flask app in the browser works.
    Point 2 : I add the following code to my simple flask route to be rendered.

    @app.route('/video', methods=['POST'])
    def videoland():

       ydl_opts = {
           'format': 'bestaudio/best',
           'verbose': True,
           'postprocessors': [{
               'key': 'FFmpegExtractAudio',
               'preferredcodec': 'mp3',
               'preferredquality': '192',
           }],
           'postprocessor_args': [
               '-ar', '16000'
           ],
           'prefer_ffmpeg': True,
       }

       with youtube_dl.YoutubeDL(ydl_opts) as ydl:
           ydl.download(['http://www.youtube.com/watch?v=BaW_jenozKc'])

       return Response('Response test')

    Here is the problem : When I render this page, I receive 500 error and ’Response test’ is never shown.
    However, the MP3 file gets to be downloaded in my project directory without problems (Sounds perfect)

    By checking ’journalctl’ of my project, I find the following :

    [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
    [debug] youtube-dl version 2019.11.28
    [debug] Python version 3.6.9 (CPython) - Linux-4.15.0-1051-aws-x86_64-with-Ubuntu-18.04-bionic
    [debug] exe versions: none
    [debug] Proxy map: {}
    [youtube] BaW_jenozKc: Downloading webpage
    [youtube] BaW_jenozKc: Downloading video info webpage
    [debug] Invoking downloader on 'https://r3---sn-aigl6nl7.googlevideo.com/videoplayback?expire=1579853383&ei=51EqXpe4HZiuxgKiz4SYBw&ip=35.178.16.206&id=o-AP8Cssz7OHlOd6PRswoEVAAVY7kfgYf0ZV-jL_TE9HZH&itag=140&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-aigl6nl7%2Csn-aigzrn7z&ms=au%2Crdu&mv=m&mvi=2&pl=15&initcwndbps=860000&vprv=1&mime=audio%2Fmp4&gir=yes&clen=157753&dur=9.891&lmt=1387961817989105&mt=1579831690&fvip=3&keepalive=yes&fexp=23842630&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=ALgxI2wwRQIgI4XTN3uqTHc10HQcotiqwL8-hSqUwnop-mrrYaIwICsCIQCSeyXDEvxEVafgIOWkMloobolXXoWRYHqzPH3fh2OfOA%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIgZKbNf2W3csHWf1leFuPJHx07S8sRJLL0-luUuXb5BqACIQD7WbHSG0E17nyoq0yTB8udlgt0-1drPysUoYKp0V539w%3D%3D&ratebypass=yes'
    [download] youtube-dl test video ''_ä↭T
  • Read a Bytes image from Amazon Kinesis output in python

    14 février 2020, par Varun_Rathinam

    I used imageio.get_reader(BytesIO(a),  'ffmpeg') to load a bytes image and save it as normal image.

    But the below error throws when I read the image using imageio.get_reader(BytesIO(a),  'ffmpeg')

    Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/home/tango/anaconda3/lib/python3.6/site-packages/imageio/core/functions.py", line 186, in get_reader
       return format.get_reader(request)
     File "/home/tango/anaconda3/lib/python3.6/site-packages/imageio/core/format.py", line 164, in get_reader
       return self.Reader(self, request)
     File "/home/tango/anaconda3/lib/python3.6/site-packages/imageio/core/format.py", line 214, in __init__
       self._open(**self.request.kwargs.copy())
     File "/home/tango/anaconda3/lib/python3.6/site-packages/imageio/plugins/ffmpeg.py", line 323, in _open
       self._initialize()
     File "/home/tango/anaconda3/lib/python3.6/site-packages/imageio/plugins/ffmpeg.py", line 466, in _initialize
       self._meta.update(self._read_gen.__next__())
     File "/home/tango/anaconda3/lib/python3.6/site-packages/imageio_ffmpeg/_io.py", line 150, in read_frames
       raise IOError(fmt.format(err2))
    OSError: Could not load meta information
    === stderr ===

    ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers
     built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0)
     configuration: --prefix=/home/tango/anaconda3 --cc=/home/conda/feedstock_root/build_artifacts/ffmpeg_1566210161358/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-gpl --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-libx264 --enable-pic --enable-pthreads --enable-shared --enable-static --enable-version3 --enable-zlib --enable-libmp3lame
     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
    [matroska,webm @ 0x5619b9da3cc0] File ended prematurely
    [matroska,webm @ 0x5619b9da3cc0] Could not find codec parameters for stream 0 (Video: h264, none, 1280x720): unspecified pixel format
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, matroska,webm, from '/tmp/imageio_zm6hhpgr':
     Metadata:
       title           : Kinesis Video SDK
       encoder         : Kinesis Video SDK 1.0.0
       AWS_KINESISVIDEO_FRAGMENT_NUMBER: 91343852333183888465720004820715065721442989478
       AWS_KINESISVIDEO_SERVER_TIMESTAMP: 1580791384.096
       AWS_KINESISVIDEO_PRODUCER_TIMESTAMP: 1580791377.843
     Duration: N/A, bitrate: N/A
       Stream #0:0(eng): Video: h264, none, 1280x720, SAR 1:1 DAR 16:9, 1k tbr, 1k tbn, 2k tbc (default)
       Metadata:
         title           : kinesis_video
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
    Press [q] to stop, [?] for help
    Cannot determine format of input stream 0:0 after EOF
    Error marking filters as finished
    Conversion failed!
    </module></stdin>

    The above approach to read a MKV bytes file was done based on this thread

    Or is there is any approach to parse and read the MKV bytes file.

  • Search For Specific Values Result in Python

    5 mai 2020, par jamlot

    I am attempting to write a Python script that looks for black video and silent audio in a file, and returns only the time instances when they occur.

    &#xA;&#xA;

    I have the following code working using the ffmpeg-python wrapper, but I can't figure out an efficient way to parse the stdout or stderror to return only the instances of black_start, black_end, black_duration, silence_start, silence_end, silence_duration.

    &#xA;&#xA;

    Putting ffmpeg aside for those who are not experts, how can I use re.findall or similar to define the regex to return only the above values ?

    &#xA;&#xA;

    import ffmpeg &#xA;&#xA;input = ffmpeg.input(source)&#xA;video = input.video.filter(&#x27;blackdetect&#x27;, d=0, pix_th=0.00)&#xA;audio = input.audio.filter(&#x27;silencedetect&#x27;, d=0.1, n=&#x27;-60dB&#x27;)&#xA;out = ffmpeg.output(audio, video, &#x27;out.null&#x27;, format=&#x27;null&#x27;)&#xA;run = out.run_async(pipe_stdout=True, pipe_stderr=True)&#xA;result = run.communicate()&#xA;&#xA;print(result)&#xA;

    &#xA;&#xA;

    This results in the ffmpeg output, which contains the results I need. Here is the output (edited for brevity) :

    &#xA;&#xA;

    (b&#x27;&#x27;, b"ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers&#xA;  built with Apple clang version 11.0.0 (clang-1100.0.33.17)&#xA;  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_3 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags=-fno-stack-check --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack&#xA;  libavutil      56. 31.100 / 56. 31.100&#xA;  libavcodec     58. 54.100 / 58. 54.100&#xA;  libavformat    58. 29.100 / 58. 29.100&#xA;  libavdevice    58.  8.100 / 58.  8.100&#xA;  libavfilter     7. 57.100 /  7. 57.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  5.100 /  5.  5.100&#xA;  libswresample   3.  5.100 /  3.  5.100&#xA;  libpostproc    55.  5.100 / 55.  5.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;/Users/otoolej/Documents/_lab/source/black-silence-detect/AUUV71900381_test.mov&#x27;:&#xA;  Metadata:&#xA;    major_brand     : qt  &#xA;    minor_version   : 537199360&#xA;    compatible_brands: qt  &#xA;    creation_time   : 2019-11-14T04:12:49.000000Z&#xA;  Duration: 00:03:50.28, start: 0.000000, bitrate: 185168 kb/s&#xA;    Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709, progressive), 1920x1080, 183596 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2019-11-14T04:12:49.000000Z&#xA;      handler_name    : Apple Video Media Handler&#xA;      encoder         : Apple ProRes 422 (HQ)&#xA;      timecode        : 00:00:00:00&#xA;    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2019-11-14T04:12:49.000000Z&#xA;      handler_name    : Apple Sound Media Handler&#xA;      timecode        : 00:00:00:00&#xA;    Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)&#xA;    Metadata:&#xA;      creation_time   : 2019-11-14T04:12:49.000000Z&#xA;      handler_name    : Time Code Media Handler&#xA;      timecode        : 00:00:00:00&#xA;Only &#x27;-vf blackdetect=d=0:pix_th=0.00&#x27; read, ignoring remaining -vf options: Use &#x27;,&#x27; to separate filters&#xA;Only &#x27;-af silencedetect=d=0.1:n=-60dB&#x27; read, ignoring remaining -af options: Use &#x27;,&#x27; to separate filters&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (prores (native) -> wrapped_avframe (native))&#xA;  Stream #0:1 -> #0:1 (pcm_s16le (native) -> pcm_s16le (native))&#xA;Press [q] to stop, [?] for help&#xA;Output #0, null, to &#x27;pipe:&#x27;:&#xA;  Metadata:&#xA;    major_brand     : qt  &#xA;    minor_version   : 537199360&#xA;    compatible_brands: qt  &#xA;    encoder         : Lavf58.29.100&#xA;    Stream #0:0(eng): Video: wrapped_avframe, yuv422p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2019-11-14T04:12:49.000000Z&#xA;      handler_name    : Apple Video Media Handler&#xA;      timecode        : 00:00:00:00&#xA;      encoder         : Lavc58.54.100 wrapped_avframe&#xA;    Stream #0:1(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2019-11-14T04:12:49.000000Z&#xA;      handler_name    : Apple Sound Media Handler&#xA;      timecode        : 00:00:00:00&#xA;      encoder         : Lavc58.54.100 pcm_s16le&#xA;[silencedetect @ 0x7fdd82d011c0] silence_start: 0&#xA;frame=  112 fps=0.0 q=-0.0 size=N/A time=00:00:05.00 bitrate=N/A speed=9.96x    &#xA;[blackdetect @ 0x7fdd82e06580] black_start:0 black_end:5 black_duration:5&#xA;[silencedetect @ 0x7fdd82d011c0] silence_end: 5.06285 | silence_duration: 5.06285&#xA;frame=  211 fps=210 q=-0.0 size=N/A time=00:00:09.00 bitrate=N/A speed=8.97x    &#xA;frame=  319 fps=212 q=-0.0 size=N/A time=00:00:13.00 bitrate=N/A speed=8.63x    &#xA;frame=  427 fps=213 q=-0.0 size=N/A time=00:00:17.08 bitrate=N/A speed=8.51x    &#xA;frame=  537 fps=214 q=-0.0 size=N/A time=00:00:22.00 bitrate=N/A speed=8.77x    &#xA;frame=  650 fps=216 q=-0.0 size=N/A time=00:00:26.00 bitrate=N/A speed=8.63x    &#xA;frame=  761 fps=217 q=-0.0 size=N/A time=00:00:31.00 bitrate=N/A speed=8.82x    &#xA;frame=  874 fps=218 q=-0.0 size=N/A time=00:00:35.00 bitrate=N/A speed=8.71x    &#xA;frame=  980 fps=217 q=-0.0 size=N/A time=00:00:39.20 bitrate=N/A speed=8.67x    &#xA;...  &#xA;frame= 5680 fps=213 q=-0.0 size=N/A time=00:03:47.20 bitrate=N/A speed=8.53x    &#xA;[silencedetect @ 0x7fdd82d011c0] silence_start: 227.733&#xA;[silencedetect @ 0x7fdd82d011c0] silence_end: 229.051 | silence_duration: 1.3184&#xA;[silencedetect @ 0x7fdd82d011c0] silence_start: 229.051&#xA;[blackdetect @ 0x7fdd82e06580] black_start:229.28 black_end:230.24 black_duration:0.96&#xA;frame= 5757 fps=214 q=-0.0 Lsize=N/A time=00:03:50.28 bitrate=N/A speed=8.54x    &#xA;video:3013kB audio:43178kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;[silencedetect @ 0x7fdd82d011c0] silence_end: 230.28 | silence_duration: 1.22856&#xA;\n")&#xA;

    &#xA;&#xA;

    What is the most efficient way to parse the output data to find/return only those result values so I can build further logic from them in my code ? In this case, I would want only the following values returned :

    &#xA;&#xA;

    silence_start : 0
    &#xA;silence_end : 5.06285
    &#xA;silence_duration : 5.06285

    &#xA;&#xA;

    black_start:0
    &#xA;black_end:5
    &#xA;black_duration:5

    &#xA;&#xA;

    silence_start : 227.733
    &#xA;silence_end : 229.051
    &#xA;silence_duration : 1.3184

    &#xA;&#xA;

    black_start:229.28
    &#xA;black_end:230.24
    &#xA;black_duration:0.96

    &#xA;&#xA;

    silence_start : 229.051
    &#xA;silence_end : 230.28
    &#xA;silence_duration : 1.22856

    &#xA;&#xA;

    I think there is a way to get only those values using ffprobe, but I couldn't get that to work within the wrapper method. Possible I would have to run ffprobe as a subprocess and parse that result somehow. That would be a total re-do though.

    &#xA;