Recherche avancée

Médias (91)

Autres articles (112)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • L’utiliser, en parler, le critiquer

    10 avril 2011

    La première attitude à adopter est d’en parler, soit directement avec les personnes impliquées dans son développement, soit autour de vous pour convaincre de nouvelles personnes à l’utiliser.
    Plus la communauté sera nombreuse et plus les évolutions seront rapides ...
    Une liste de discussion est disponible pour tout échange entre utilisateurs.

Sur d’autres sites (10474)

  • aarch64 : cabac_encode_{decision,bypass,terminal}_asm

    19 novembre 2014, par Janne Grunau
    aarch64 : cabac_encode_decision,bypass,terminal_asm
    

    benchmarks on a Nexus 9 (nvidia denver) :
    101.3 cycles in x264_cabac_encode_decision_c, 67105369 runs, 3495 skips
    97.3 cycles in x264_cabac_encode_decision_asm, 67105493 runs, 3371 skips
    132.8 cycles in x264_cabac_encode_terminal_c, 1046950 runs, 1626 skips
    116.1 cycles in x264_cabac_encode_terminal_asm, 1048424 runs, 152 skips
    92.4 cycles in x264_cabac_encode_bypass_c, 16776192 runs, 1024 skips
    89.6 cycles in x264_cabac_encode_bypass_asm, 16776453 runs, 763 skips

    Cycle counts are not as stable as one would like. The dynamic code
    optimisation seems to produce different results for small chnages in a
    binary. Repeated runs with the same binary produce stable results
    though (ignoring the first run).

    • [DH] Makefile
    • [DH] common/aarch64/asm-offsets.c
    • [DH] common/aarch64/asm-offsets.h
    • [DH] common/aarch64/cabac-a.S
    • [DH] common/cabac.h
    • [DH] tools/checkasm.c
  • script doesnt recognize bars / lenght right for cutting audio , ffmpeg terminal

    14 avril 2024, par totzillarbeats

    This Terminal script doesnt recognize bars / lenght right for cutting audio , maybe somebody knows whats wrong with the calculation :)

    


    Would be happy about any help the cutting already works !

    


    #!/bin/bash

# Function to extract BPM from filename

get_bpm() {
    local filename="$1"
    local bpm=$(echo "$filename" | grep -oE '[0-9]{1,3}' | head -n1)
    echo "$bpm"
}

# Function to cut audio based on BPM
cut_audio() {
    local input_file="$1"
    local bpm="$2"
    local output_file="${input_file%.*}_cut.${input_file##*.}" # Appends "_cut" to original filename

    # Define the number of beats per bar (assuming 4 beats per bar)
    beats_per_bar=4

    # Calculate the duration of each bar in seconds
    bar_duration=$((60 * beats_per_bar / bpm))

    # Define start and end times for each bar range
    start_times=(0 21 33 45 57 69 81 93 105 117 129 141)
    end_times=(20 29 41 53 65 77 89 101 113 125 137 149)

    # Iterate through each bar range
    for ((i = 0; i < ${#start_times[@]}; i++)); do
        start_time=${start_times[$i]}
        end_time=${end_times[$i]}
        echo "Cutting audio file $input_file at $bpm BPM for bar $((i + 1)) ($start_time-$end_time) for $bar_duration seconds..."

        # Cut audio for current bar range using ffmpeg
        ffmpeg -i "$input_file" -ss "$start_time" -to "$end_time" -c copy "$output_file"_"$((i + 1)).${input_file##*.}" -y
    done

    # Check if the output files are empty and delete them if so
    for output_file in "${output_file}"_*; do
        if [ ! -s "$output_file" ]; then
            echo "Output file $output_file is empty. Deleting..."
            rm "$output_file"
        fi
    done

    echo "Audio cut and saved as $output_file"
}


# Main script
if [ "$#" -eq 0 ]; then
    echo "Usage: $0 [audio_file1] [audio_file2] ..."
    exit 1
fi

for file in "$@"; do
    bpm=$(get_bpm "$file")
    if [ -z "$bpm" ]; then
        echo "Error: No BPM found in filename $file"
    else
        cut_audio "$file" "$bpm"
    fi
done


    


    Maybe its only the math calc in the beginning but idk :)

    


    If you need more details just lmk

    


  • FFmpeg conversion to mp3 works in terminal, not in script

    19 juillet 2013, par user2598172

    I can run

    ffmpeg -i test.m4a -vn -acodec libmp3lame -ab 256k test.mp3

    And it works perfectly. However, when I have the line :

    ./ffmpeg -i "$SONG_SAVE.m4a" -vn -acodec libmp3lame -ab 256k "$SONG_SAVE$EXT" &> /dev/null

    running in a .sh script (downloading the same file that I was able to successfully convert through the terminal), it returns an mp3 file with no audio data. Does anyone have any idea what could be causing this ? Thanks !

    EDIT : here is the whole script :

    #!/bin/bash

    TITLE="$(echo "$1" | ./recode html..ascii | tr -d '\' | tr -s ' ' | sed 's|\ *$||')"
    TAG_TITLE="$2"
    ARTIST="$(echo "$3" | ./recode html..ascii | tr -d '\' | tr -s ' ')"
    ALBUM="$(echo "$4" | ./recode html..ascii | tr -d '\' | tr -s ' ')"
    IMG="$5"
    TRACK_NUMBER="$6"
    TOTAL_TRACKS="$7"
    URL="$8"
    MIX_TITLE="$9"
    CONVERT="${10}"
    RECURSIVE="${11}"
    SESSION_ID="${12}"
    DOWNLOAD_ID="${13}"
    SONG_ID="${14}"

    SONG_SAVE="songs/$SONG_ID"
    ZIP_SAVE="$SESSION_ID-$DOWNLOAD_ID.zip"
    ZIP_DIR="$MIX_TITLE/"
    ARTWORK_SAVE="artwork/$MIX_TITLE.png"
    SAVE_TITLE="$(echo "$TITLE" | sed 's|/|-|g;s|^\.||g')"

    [ "$TAG_TITLE" == "false" ] && unset TITLE
    [ "$ARTIST" == "false" ] && unset ARTIST
    [ "$ALBUM" == "false" ] && unset ALBUM
    [ "$IMG" == "false" ] && unset IMG
    [ "$TRACK_NUMBER" == "false" ] && unset TRACK_NUMBER TOTAL_TRACKS
    [ "$CONVERT" == "false" ] && unset CONVERT
    [ "$RECURSIVE" == "false" ] && unset RECURSIVE

    while [ -f "SONG_SAVE".part ]; do
       sleep 2
    done

    if [ -f "$SONG_SAVE".m4a ]; then
       EXT=".m4a"
       touch "$SONG_SAVE$EXT"
    elif [ -f "$SONG_SAVE".mp3 ]; then
       EXT=".mp3"
       touch "$SONG_SAVE$EXT"
    else
       curl -Lso "$SONG_SAVE".part "$URL"

       if [ -n "$(file -b "$SONG_SAVE".part | grep "MPEG ADTS")" ]; then
           EXT=".mp3"
       elif [ -n "$(file -b "$SONG_SAVE".part | grep "MPEG v4")" ]; then
       EXT=".m4a"
    else
       EXT=".txt"
       echo "Unable to download: $URL. Sorry ):" > "$SONG_SAVE".part
    fi

    mv "$SONG_SAVE".part "$SONG_SAVE$EXT"
    fi

    if [ -n "$CONVERT" ] && [ "$EXT" == ".m4a" ]; then
    EXT=".mp3"
    if [ ! -f "$SONG_SAVE$EXT" ]; then
       ./ffmpeg -i "$SONG_SAVE.m4a" -vn -acodec libmp3lame -ab 256k "$SONG_SAVE$EXT"         &> /dev/null
       fi
    fi

    if [ "$EXT" == ".mp3" ]; then
       ./eyeD3 --remove-images -t "$TITLE" -a "$ARTIST" -A "$ALBUM" -n "$TRACK_NUMBER" -N     "$TOTAL_TRACKS" "$SONG_SAVE$EXT" &> /dev/null
       if [ -n "$IMG" ]; then
       [ ! -f "$ARTWORK_SAVE" ] && curl -Lso "$ARTWORK_SAVE" "$IMG"
           ./eyeD3 --add-image="$ARTWORK_SAVE":FRONT_COVER "$SONG_SAVE$EXT" &> /dev/null
       fi
    elif [ "$EXT" == ".m4a" ]; then
    if [ -n "$IMG" ]; then
       [ ! -f "$ARTWORK_SAVE" ] && curl -Lso "$ARTWORK_SAVE" "$IMG"
       if [ -n "$TRACK_NUMBER" ]; then
           ./mp4tags -P "$ARTWORK_SAVE" -s "$TITLE" -a "$ARTIST" -R "" -A "$ALBUM" -t "$TRACK_NUMBER" -T "$TOTAL_TRACKS" "$SONG_SAVE$EXT" &> /dev/null
       else
           ./mp4tags -P "$ARTWORK_SAVE" -s "$TITLE" -a "$ARTIST" -R "" -A "$ALBUM" "$SONG_SAVE$EXT" &> /dev/null
       fi
    else
       if [ -n "$TRACK_NUMBER" ]; then
           ./mp4tags -r P -s "$TITLE" -a "$ARTIST" -R "" -A "$ALBUM" -t "$TRACK_NUMBER" -T "$TOTAL_TRACKS" "$SONG_SAVE$EXT" &> /dev/null
       else
           ./mp4tags -r P -s "$TITLE" -a "$ARTIST" -R "" -A "$ALBUM" "$SONG_SAVE$EXT" &> /dev/null
           fi
       fi
    fi

    if [ -n "$RECURSIVE" ]; then
       cd archives
       mkdir -p "$ZIP_DIR"
       chmod 777 "$ZIP_DIR"
       cp "../$SONG_SAVE$EXT" "$ZIP_DIR$SAVE_TITLE$EXT"
       ./zip -q -0 -D -r "$ZIP_DIR$ZIP_SAVE" "$ZIP_DIR$SAVE_TITLE$EXT" &> /dev/null
       rm -f "$ZIP_DIR$SAVE_TITLE$EXT"
       printf "archives/$ZIP_DIR$ZIP_SAVE\n$MIX_TITLE.zip\n$EXT\n"
       echo "$(du -h "$ZIP_DIR$ZIP_SAVE" | tr '\t' '\n' | head -1)"
    else
       printf "$SONG_SAVE$EXT\n$SAVE_TITLE$EXT\n$EXT"
    fi