Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (97)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

Sur d’autres sites (5818)

  • flacenc : Restore defaults and range for {min,max}_prediction_order

    31 janvier 2016, par Derek Buitenhuis
    flacenc : Restore defaults and range for min,max_prediction_order
    

    This was broken in 243df1351d2d928caa084a5704ed783f0b83f072.

    Signed-off-by : Derek Buitenhuis <derek.buitenhuis@gmail.com>

    • [DH] libavcodec/flacenc.c
  • ffmpeg : match audio video duration post concatenation

    20 janvier 2020, par Massimo Vantaggio

    I wrote this bash to automate concatentation of videos for dash mpeg streaming infinite loop.
    Im unable to obtain same duration for audio and video, with the videos that i’m using for testing i get always 6 ms more for audio track.
    May ask help to debug it and understand how to get same duration for both audio and video track ?

    #!/bin/bash
    #CANCAT 0.3

    cd input
    fps=()
    # GET FPS OF EACH VIDEO INTO ARRAY
    for f in *.mp4; do
       _f=$(ffmpeg -i "$f" 2>&amp;1 | sed -n "s/.*, \\(.*\\) fp.*/\\1/p")
       fps+=("$_f")
    done

    #GET NUMBER OF ELEMENTS IN FPS ARRAY  
    tLen=${#fps[@]}
    #CHECK FPS EQUALITY    
    for tLen in "${fps[@]:1}"; do
       if [[ $tLen != ${fps[0]} ]]; then
           printf "WARNING: VIDEO’S FRAME-RATE ARE NOT EQUALS, THE PROCESS CAN’T START."
           printf "%s\\0" "${fps[@]}" |
               sort -zu |
               xargs -0 printf " %s"
           printf "\\n"
          exit 1
       fi
    done

    #AUDIO ENCODING
    for f in *.mp4;
    do
    NAME=$(echo "$f" | cut -d'.' -f1)
    ffmpeg -y -i "$f" -c copy -video_track_timescale 90k -c:a aac -b:a 384k -ar 44100 -ac 2 -shortest -af aresample=async=1 ../buffer/${NAME}_buffer.mp4
    done
    #-af aresample=async=1000
    #-filter_complex " [1:0] apad "

    cd ..
    cd buffer
    times=()
    for f in *.mp4;
    do
    echo "file '$f'" >> list.txt;

    # GET DURATION OF EACH VIDEO
    _t=$(ffprobe -i "$f" -show_entries format=duration -v quiet -of csv="p=0")
    times+=("$_t")
    done

    #SUM ALL DURATIONS
    TOTALDURATION=$( echo "${times[@]}" | sed 's/ /+/g' | bc )
    DURROUND=$(echo "$TOTALDURATION" | cut -d'.' -f1)
    TOTDELTA="$((DURROUND%2))"
    TOTDUR="$(($DURROUND-$TOTDELTA))"

    #GET FPS
    FPS="$(ffmpeg -i ${f[0]} 2>&amp;1 | sed -n "s/.*, \(.*\) fp.*/\1/p")"
    #ROUND FPS
    FPSC=$( echo "($FPS+0.5)/1" | bc )
    #GET GOP
    GOP="$((FPSC*2))"

    #ENCODING MASTER TRACK
    ffmpeg -f concat -safe 0 -y -i list.txt -loop 1 -i ../logo/logo.png -c:a copy -c:v libx264 -x264opts keyint=$GOP:min-keyint=$GOP:no-scenecut -bf 0 -r $FPSC -b:v 4800k -maxrate 9600k -bufsize 19200k -profile:v main -crf 22 -filter_complex "[0:v][1:v]overlay=main_w-overlay_w-10:10,scale=1920:1080,setsar=1" -t $TOTDUR 1080set.mp4

    #EXTRACTING AUDIO FROM MASTER VIDEO TRACK
    ffmpeg -y -i 1080set.mp4 -c copy -vn ../output/output_audio.mp4

    #REMOVE AUDIO FROM MASTER VIDEO TRACK
    ffmpeg -y -i 1080set.mp4 -c copy -an ../output/output_1080.mp4

    #CLEAN BUFFER
    rm *.mp4
    rm *.txt

    cd ..
    cd output

    #ENCODE 720p
    ffmpeg -y -i output_1080.mp4 -an -c:v libx264 -x264opts keyint=$GOP:min-keyint=$GOP:no-scenecut -bf 0 -s 1280x720 -r $FPSC -b:v 2400k -maxrate 4800k -bufsize 9600k -profile:v main -crf 22 output_720.mp4

    #ENCODE 360p
    ffmpeg -y -i output_1080.mp4 -an -c:v libx264 -x264opts keyint=$GOP:min-keyint=$GOP:no-scenecut -bf 0 -s 640x360 -r $FPSC -b:v 800k -maxrate 1600k -bufsize 3200k -profile:v main -crf 22 output_360.mp4

    #VALIDATOR
    echo 1080p ENCODING
    echo GOP:   $GOP
    echo VIDEO FORMAT CONTAINER DURATION:  
    ffprobe -v error -show_entries format=duration \
     -of default=noprint_wrappers=1:nokey=1 output_1080.mp4
    echo VIDEO STREAM DURATION:
    ffprobe -v error -select_streams v:0 -show_entries stream=duration \
     -of default=noprint_wrappers=1:nokey=1 output_1080.mp4
    echo AUDIO FORMAT CONTAINER DURATION:  
    ffprobe -v error -show_entries format=duration \
     -of default=noprint_wrappers=1:nokey=1 output_audio.mp4

    echo ______________________________________________________________

    echo 720p ENCODING
    echo GOP:   $GOP
    echo VIDEO FORMAT CONTAINER DURATION:  
    ffprobe -v error -show_entries format=duration \
     -of default=noprint_wrappers=1:nokey=1 output_720.mp4
    echo VIDEO STREAM DURATION:
    ffprobe -v error -select_streams v:0 -show_entries stream=duration \
     -of default=noprint_wrappers=1:nokey=1 output_720.mp4
    echo DONE
    exit 1

    Here the script with my videos for test and relative folders :
    https://gofile.io/?c=WPAC0Q

  • POST 500 (internal server error) involving ffmpeg and ffprobe on Gradio [closed]

    24 juillet 2023, par Alessandra

    I'm trying to run a local program on my Windows computer off Visual Studio Code. However, when I run it I keep getting the error below in the console :

    &#xA;

    POST http://127.0.0.1:7860/run/predict 500 (Internal Server Error)&#xA;

    &#xA;

    The terminal in Visual Studio Code displays the following error :

    &#xA;

    Running on local URL:  http://127.0.0.1:7860&#xA;&#xA;Could not create share link. Missing file: C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\frpc_windows_amd64_v0.2.&#xA;&#xA;Please check your internet connection. This can happen if your antivirus software blocks the download of this file. You can install manually by following these steps:       &#xA;&#xA;1. Download this file: https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_windows_amd64.exe&#xA;2. Rename the downloaded file to: frpc_windows_amd64_v0.2&#xA;3. Move the file to this location: C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio&#xA;C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydub\utils.py:198: RuntimeWarning: Couldn&#x27;t find ffprobe or avprobe - defaulting to ffprobe, but may not work&#xA;  warn("Couldn&#x27;t find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)&#xA;Traceback (most recent call last):&#xA;  File "C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\processing_utils.py", line 145, in audio_from_file&#xA;    audio = AudioSegment.from_file(filename)&#xA;            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydub\audio_segment.py", line 728, in from_file&#xA;    info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)&#xA;           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydub\utils.py", line 274, in mediainfo_json&#xA;    res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)&#xA;          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1026, in __init__&#xA;    self._execute_child(args, executable, preexec_fn, close_fds,&#xA;  File "C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1538, in _execute_child&#xA;    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,&#xA;                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;FileNotFoundError: [WinError 2] The system cannot find the file specified&#xA;&#xA;The above exception was the direct cause of the following exception:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\routes.py", line 439, in run_predict&#xA;    output = await app.get_blocks().process_api(&#xA;             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1387, in process_api&#xA;    inputs = self.preprocess_data(fn_index, inputs, state)&#xA;             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\blocks.py", line 1230, in preprocess_data&#xA;    processed_input.append(block.preprocess(inputs[i]))&#xA;                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\components\audio.py", line 204, in preprocess&#xA;    sample_rate, data = processing_utils.audio_from_file(&#xA;                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\02009753\AppData\Local\Programs\Python\Python311\Lib\site-packages\gradio\processing_utils.py", line 155, in audio_from_file&#xA;    raise RuntimeError(msg) from e&#xA;RuntimeError: Cannot load audio from file: `ffprobe` not found. Please install `ffmpeg` in your system to use non-WAV audio file formats and make sure `ffprobe` is in your PATH.&#xA;

    &#xA;

    Below is my code :

    &#xA;

    import gradio as gr&#xA;import openai&#xA;import winsound&#xA;import os&#xA;#pip install elevenlabs&#xA;from elevenlabslib import *&#xA;from pydub import AudioSegment&#xA;from pydub.playback import play&#xA;import io&#xA;&#xA;#in my actual code my API keys are entered below instead of "**(OPENAI) API KEY HERE**" &#xA;openai.api_key = "**OPENAI API KEY HERE**"&#xA;api_key = "**API KEY HERE**"&#xA;from elevenlabslib import ElevenLabsUser&#xA;user = ElevenLabsUser(api_key)&#xA;&#xA;messages = ["you are a friendly AI assistant"]&#xA;&#xA;&#xA;def transcribe(audio): #handles audio input from the user&#xA;    global messages&#xA;    audio_file = open(audio,"rb")&#xA;    transcript = openai.Audio.transcribe("whisper-1",audio_file)&#xA;&#xA;    #commit the transcript to the console for debugging&#xA;    messages.append(f"\nUser: {transcript[&#x27;text&#x27;]}")&#xA;&#xA;    #send audio transcription to NLP model&#xA;    response = openai.Completion.create(&#xA;        engine=&#x27;text-davinci-003&#x27;,&#xA;        prompt=messages[-1],&#xA;        max_tokens=4096,&#xA;        n=1,&#xA;        stop=None,&#xA;        temperature=0&#xA;    )&#xA;&#xA;    system_message=response["choices"][0]["text"]&#xA;    messages.append(f"{system_message}")&#xA;&#xA;    #generate ElevenLabs audio response&#xA;    voice = user.get_voices_by_name("Antoni")[0]&#xA;    audio = voice.generate_audio_bytes(system_message)&#xA;&#xA;    audio = AudioSegment.from_file(io.BytesIO(audio), format="mp3")&#xA;    audio.export("output.wav", format="wav")&#xA;&#xA;    winsound.PlaySound("output.wav, winsound.SND_FILENAME")&#xA;&#xA;    chat_transcript = "\n".join(messages)&#xA;    &#xA;    return chat_transcript&#xA;&#xA;iface=gr.Interface(&#xA;    fn=transcribe,&#xA;    inputs=gr.Audio(source="microphone", type = "filepath", placeholder="Please start speaking..."),&#xA;    outputs="text",&#xA;    title="AI Assistant",&#xA;    description="Hi, I&#x27;m your AI assistant. How can I help?")&#xA;&#xA;iface.launch(share=True)&#xA;

    &#xA;

    I have already downloaded FFmpeg via the following instructions : https://www.wikihow.com/Install-FFmpeg-on-Windows . However that didn't solve the error.

    &#xA;

    How do I fix internal server error ? Thank you in advance for your help.

    &#xA;