Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (80)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

Sur d’autres sites (4306)

  • ffmpeg split by silence (with logic to achieve 12 split segments)

    14 mars 2023, par Martin

    https://github.com/MartinBarker/split_by_silence

    


    I am trying to automate the process of splitting a single audio file into 12 tracks. you can see in the below image that this 35:62 length mp3 file has 11 visible split points (where the audio more quiet), which means 12 distinct segments.
enter image description here

    


    I'd like to be able to run a script to automatically find these split points and split my file, my first split point should be around 159 seconds, and second around 360, third around 540, 4th around 780, 5th around 960, and so on for a total of 11 split points :

    


    1 159
2 360
3 540
4 780
5 960
6 1129
7 1309
8 1500
9 1680
10 1832
11 1980


    


    but my test results have not been working so good :

    


    - Goal:
11 split points found
12 tracks rendered

- Test 1
SD_PARAMS="-24dB"
MIN_FRAGMENT_DURATION="3"
5 split points found: 361.212,785.811,790.943,969.402,2150.24`
6 tracks rendered

-Test 2
SD_PARAMS="-24dB"
MIN_FRAGMENT_DURATION="3"
10 split points found: 151.422,155.026,158.526,361.212,534.254,783.667,967.253,1128.91,2150.2
11 tracks rendered


    


      

    • Test 2 Problem :
Even though 12 tracks were rendered, some split points are very close
enter image description here
leading to tracks being exported that are very short, such as 3, 5, and 2 seconds. as well as one long track being 16 minutes
enter image description here
    • 


    


    So I added a variable MIN_SEGMENT_LENGTH and ran another test

    


    - Test 3
SD_PARAMS="-18dB"
MIN_FRAGMENT_DURATION="3"
MIN_SEGMENT_LENGTH=120 (02:00)

log:
_______________________
Determining split points...
split points list= 150.482,155.026,158.526,361.212,530.019,534.254,783.667,967.245,1127.67,2144.57,2150.2
1. The difference between 150.482 and 155.026 is 4.544
       diff is less than MIN_SEGMENT_LENGTH=120
2. The difference between 155.026 and 158.526 is 3.500
       diff is less than MIN_SEGMENT_LENGTH=120
3. The difference between 158.526 and 361.212 is 202.686
4. The difference between 361.212 and 530.019 is 168.807
5. The difference between 530.019 and 534.254 is 4.235
       diff is less than MIN_SEGMENT_LENGTH=120
6. The difference between 534.254 and 783.667 is 249.413
7. The difference between 783.667 and 967.245 is 183.578
8. The difference between 967.245 and 1127.67 is 160.425
9. The difference between 1127.67 and 2144.57 is 1016.90
10. The difference between 2144.57 and 2150.2 is 5.63
       diff is less than MIN_SEGMENT_LENGTH=120
_______________________
Exporting 12 tracks with ffmpeg...


    


    I'm unsure how to change my script and vars so that by running it, are calculating the split points, if any of them are too short (less then 120 seconds) to regenerate the split point(s) ?

    


    Here is my audio file :
https://filetransfer.io/data-package/HC7GG07k#link

    


    And here is my script, which can be ran by running ./split_by_silence.sh

    


    # -----------------------
# SPLIT BY SILENCE
# Requirements:
#    ffmpeg
#    $ apt-get install bc
# How To Run:
# $ ./split_by_silence.sh "full_lowq.flac" %03d_output.flac

# output title format
OUTPUTTITLE="%03d_output.mp3"
# input audio filepath
IN="/mnt/e/martinradio/rips/vinyl/L.T.D. – Gittin' Down/lowquality_example.mp3"
# output audio filepath
OUTPUTFILEPATH="/mnt/e/folder/rips"
# ffmpeg option: split input audio based on this silencedetect value
SD_PARAMS="-18dB"
# split option: minimum fragment duration
MIN_FRAGMENT_DURATION=3
# minimum segment length
MIN_SEGMENT_LENGTH=120

# -----------------------
# step: ffmpeg
# goal: get comma separated list of split points (use ffmpeg to determine points where audio is at SD_PARAMS [-18db] )

echo "_______________________"
echo "Determining split points..." >& 2
SPLITS=$(
    ffmpeg -v warning -i "$IN" -af silencedetect="$SD_PARAMS",ametadata=mode=print:file=-:key=lavfi.silence_start -vn -sn  -f s16le  -y /dev/null \
    | grep lavfi.silence_start= \
    | cut -f 2-2 -d= \
    | perl -ne '
        our $prev;
        INIT { $prev = 0.0; }
        chomp;
        if (($_ - $prev) >= $ENV{MIN_FRAGMENT_DURATION}) {
            print "$_,";
            $prev = $_;
        }
    ' \
    | sed 's!,$!!'
)
echo "split points list= $SPLITS"
# determine if the difference between any two splits is less than MIN_SEGMENT_LENGTH seconds
IFS=',' read -ra VALUES <<< "$SPLITS"

for (( i=0; i<${#VALUES[@]}-1; i++ )); do
  diff=$(echo "${VALUES[$i+1]} - ${VALUES[$i]}" | bc)
  display_i=$((i+1))
  echo "$display_i. The difference between ${VALUES[$i]} and ${VALUES[$i+1]} is $diff"
  if (( $(echo "$diff < $MIN_SEGMENT_LENGTH" | bc -l) )); then
    echo "       diff is less than MIN_SEGMENT_LENGTH=$MIN_SEGMENT_LENGTH"
  fi
done


# using the split points list, calculate how many output audio files will be created 
num=0
res="${SPLITS//[^,]}"
CHARCOUNT="${#res}"
num=$((CHARCOUNT + 2))
echo "_______________________"
echo "Exporting $num tracks with ffmpeg"

ffmpeg -i "$IN" -c copy -map 0 -f segment -segment_times "$SPLITS" "$OUTPUTFILEPATH/$OUTPUTTITLE"

echo "Done."



    


  • FFMPEG install on server

    23 juillet 2013, par s19k15

    I have an online server (shared hosting plan) in linux, i do not know a lot stuff about linux and i am trying to install ffmpeg.

    I have tryied a lot of scripts but no luck.
    Now i am trying to install the below script via putty.
    <a href="https://github.com/heidisoft/FFMPEG-install-script-for-shared-host" rel="nofollow">https://github.com/heidisoft/FFMPEG-install-script-for-shared-host</a>

    When the install was running i get this message and the installation stops...

    Installation of MPlayer-1.0rc1.tar.bz2 ....... started
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
    100  1233  100  1233    0     0   7713      0 --:--:-- --:--:-- --:--:--  7803
    bzip2: (stdin) is not a bzip2 file.
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now
    mplayer.sh: line 32: cd: MPlayer-1.0rc1/: No such file or directory
    mplayer.sh: line 33: ./configure: No such file or directory
    make: *** No targets specified and no makefile found.  Stop.
    make: *** No rule to make target `install&#39;.  Stop.
    cp: cannot stat `etc/codecs.conf&#39;: No such file or directory
    Installation of MPlayer-1.0rc1.tar.bz2 ....... Completed

           Mplayer installation Failed :( , please visit the forum

    What can i do to install ??? Thanks !

  • Way to bypass video upload when testing using Rspec

    1er mars 2014, par Justin

    I'm testing a page on my app that shows videos. I'm trying to speed up the test by bypassing the video upload process or another way ??

    Maybe I'm using FactoryGirl incorrectly for file uploads..

    Using FactoryGirl, I'm creating the video with

    FactoryGirl.define do
    factory :video do
     user_id 1
     type "Live"
     title "FooBar"
     description "Foo bar is the description"
     video { fixture_file_upload(Rails.root.join(&#39;spec&#39;, &#39;files&#39;, &#39;concert.mov&#39;), &#39;video/mp4&#39;) }
    end
    end

    And in the request's spec I'm describing the videos as :

    describe "videos page" do

     let(:user) { FactoryGirl.create(:user) }
     let!(:video1) { FactoryGirl.create(:video) }

     before { visit user_video_path(user) }

     it { should have_title(user.name) }
     it { should have_content(user.name) }

     describe "videos" do
       it { should have_content(video1.description) }
     end
    end

    Now, everytime I run the test for this page it goes through the file upload process which takes more time. I'm also using FFmpeg

    **video.rb (video model)**

    validates :video, presence: true
    has_attached_file :video, :styles => {
                                         :medium => { :geometry => "640x480", :format => &#39;mp4&#39; },
                                         :thumb => { :geometry => "470x290#", :format => &#39;jpg&#39;, :time => 10 }
                                        },
                             :processors => [:ffmpeg]

    What this does when I test the page is the CLI goes through the video upload process like it would if you were uploading the video and watching your local server.