Recherche avancée

Médias (1)

Mot : - Tags -/blender

Autres articles (51)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • 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

Sur d’autres sites (4457)

  • Why does my script return 0 when it fails ? Bash, Whisper, ffmpeg

    30 avril 2024, par d-b

    I have a bash script that executes whisper on all sound files in a directory. Whisper uses ffmpeg to decode sound files to a format it can handle. One of the files in the directory was corrupt and caused ffmpeg to fail. The first time I executed my script it returned 1 when it hit that file but when I try to reproduce the error it always returns 0.

    


    Here is the log from the first run when 1 was returned :

    


    Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 48, in load_audio&#xA;    .run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)&#xA;     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/ffmpeg/_run.py", line 325, in run&#xA;    raise Error(&#x27;ffmpeg&#x27;, out, err)&#xA;ffmpeg._run.Error: ffmpeg error (see stderr output for detail)&#xA;&#xA;The above exception was the direct cause of the following exception:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/bin/whisper", line 8, in <module>&#xA;    sys.exit(cli())&#xA;             ^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 437, in cli&#xA;    result = transcribe(model, audio_path, temperature=temperature, **args)&#xA;             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 121, in transcribe&#xA;    mel = log_mel_spectrogram(audio, padding=N_SAMPLES)&#xA;          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 130, in log_mel_spectrogram&#xA;    audio = load_audio(audio)&#xA;            ^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 51, in load_audio&#xA;    raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e&#xA;RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;/soundfile1.opus: Invalid data found when processing input&#xA;&#xA;&#xA;exit: 1 //this is my own output&#xA;</module>

    &#xA;

    and here is an example of when it returns 0 despite the input file is corrupt :

    &#xA;

    % whisper soundfile1.opus&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 58, in load_audio&#xA;    out = run(cmd, capture_output=True, check=True).stdout&#xA;          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run&#xA;    raise CalledProcessError(retcode, process.args,&#xA;subprocess.CalledProcessError: Command &#x27;[&#x27;ffmpeg&#x27;, &#x27;-nostdin&#x27;, &#x27;-threads&#x27;, &#x27;0&#x27;, &#x27;-i&#x27;, &#x27;soundfile1.opus&#x27;, &#x27;-f&#x27;, &#x27;s16le&#x27;, &#x27;-ac&#x27;, &#x27;1&#x27;, &#x27;-acodec&#x27;, &#x27;pcm_s16le&#x27;, &#x27;-ar&#x27;, &#x27;16000&#x27;, &#x27;-&#x27;]&#x27; returned non-zero exit status 1.&#xA;&#xA;The above exception was the direct cause of the following exception:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 597, in cli&#xA;    result = transcribe(model, audio_path, temperature=temperature, **args)&#xA;             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/transcribe.py", line 133, in transcribe&#xA;    mel = log_mel_spectrogram(audio, model.dims.n_mels, padding=N_SAMPLES)&#xA;          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 140, in log_mel_spectrogram&#xA;    audio = load_audio(audio)&#xA;            ^^^^^^^^^^^^^^^^^&#xA;  File "/Users/db/Library/Python/3.11/lib/python/site-packages/whisper/audio.py", line 60, in load_audio&#xA;    raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e&#xA;RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;soundfile1.opus: Invalid data found when processing input&#xA;&#xA;Skipping soundfile1.opus due to RuntimeError: Failed to load audio: ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/opt/local --cc=/usr/bin/clang --mandir=/opt/local/share/man --enable-audiotoolbox --disable-indev=jack --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-opencl --disable-outdev=xv --enable-sdl2 --disable-securetransport --enable-videotoolbox --enable-avfilter --enable-avresample --enable-fontconfig --enable-gnutls --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libzvbi --enable-lzma --enable-pthreads --enable-shared --enable-swscale --enable-zlib --enable-libaom --enable-libsvtav1 --arch=x86_64 --enable-x86asm --enable-gpl --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-postproc&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;soundfile1.opus: Invalid data found when processing input&#xA;&#xA;% echo $?&#xA;0&#xA;

    &#xA;

    When I try to reproduce the behaviour I have both tried to execute the script as well as just running the actual line of code from the command prompt. The actual script looks like this :

    &#xA;

    if whisper "$file" >> "${directory}/../${transdir}/${name}.txt"; then&#xA;    whispersuccess=$?&#xA;    echo "exit code $whispersuccess"&#xA;else&#xA;    whispersuccess=$?&#xA;    echo "exit code: $whispersuccess"&#xA;

    &#xA;

    I want it to return ¬0 when something like this happens. How do I achieve this ?

    &#xA;

  • How to modify this Windows script to do a match ?

    21 janvier 2016, par Andrei Clear

    ffmpeg can resize a video/image file .. first is input_file .. parameters .. output_file ..

    ffmpeg -i input.avi -vf scale=320:240 output.avi

    or

    ffmpeg -i 20140724_071746.mp4 -vf scale=640:-1 20140724_071746_LOW_640.mp4

    more info here : https://trac.ffmpeg.org/wiki/Scaling%20%28resizing%29%20with%20ffmpeg

    I want it to downscale all the videos on my microSD card to create space (I have originals backed-up)

    So I want it to go throw all the files in all the sub-directories overnight and resize all the files. Chances are that the script might stop or crash and I would need to run it again, or if I add new files I would want to run it again.

    So I would want it to skip processing all the files that have been processed AND their resized versions.

    In my case if a FILE_NAME.mp4 also has FILE_NAME_LOW_640.mp4 SKIP it
    AND
    if a FILE_NAME_LOW_640.mp4 has *640 SKIP it

    Here is my Windows batch script so far

    REM @echo off
    REM just save as "DOS"
    REM cd /d C:\s

    setlocal enabledelayedexpansion
    for %%j in (*.mp4) do (
    set filename=%%~nj
    echo %%j

    ffmpeg -i %%j -vf scale=640:-1 %%j_LOW_640.mp4

    REM but now I want to add the two checks to skip files that have been resized .. or if they are the resized version

    REM if not "!filename!"=="%%j_LOW_640.mp4" AND IF FILE !COINTAIN *640* THEN ffmpeg -i %%j -vf scale=640:-1 %%j_LOW_640.mp4

    )

    pause
    REM AND I would also want it to process all the sub-directories  

    In other words my questions for help are :

    1. How can I do a check for a string if it contains a string match ?

    2. How can I have my script also process all the subdirectories ?

  • Where to add FilterChain when using with Shell Script

    20 janvier 2016, par senty

    I am trying to get a jpg out of an mp4 video’s middle. I used this line and it works like charm for generating jpg thumbnail in one line :

    ffmpeg -i input.mp4 -vcodec mjpeg -vframes 1 -an -f rawvideo -ss `ffmpeg -i input.mp4 2>&amp;1 | grep Duration | awk '{print $2}' | tr -d , | awk -F ':' '{print $3/2}'` output.jpg

    However, I want to apply scaling and cropping a filter chain (filter:v) with the above line, but where ever I put the filter, I couldn’t make it work.

    -filter:v "scale=720:ih*720/iw, crop=720:720:280:1000".

    Where should I put it ?

    The errors I receive :

    At least one output file must be specified

    Invalid duration specification for ss: -filter:v

    Please note that this works :

    ffmpeg -i fkj.mp4 -vcodec mjpeg -filter:v "scale=720:ih*720/iw, crop=720:720:280:1000" -vframes 1 -an -f rawvideo -ss 4  output.jpg