Recherche avancée

Médias (0)

Mot : - Tags -/serveur

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (51)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • 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

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

  • Python ffmpeg does not save the mp4 clips to file

    30 janvier 2021, par oo92

    I'm using the ffmpeg Python library to save 60 second mp4 clips to file from Twitch livestreams using its API. This is my code :

    


    current_dir = os.getcwd()

client = TwitchClient(client_id='')
streams_now = client.streams.get_live_streams(limit=100, offset=900)
epoch = str(math.ceil(time.time()))

if not os.path.exists(current_dir + '/twitch_videos/'):
    os.mkdir(current_dir + '/twitch_videos/')

for i in range(0, 1):
    try:
        username = streams_now[i]['channel']['name']
        id = streams_now[i]['id']
        game = streams_now[i]['game']
        game = game.translate(str.maketrans({':': '-', ' ': '-', "'": '', '!': '', '&': '_', '.': '', '+': '_'}))
        streaming = streamlink.streams('http://twitch.tv/' + username)
        stream = streaming["best"].url

        twitch_stream = ffmpeg.input(stream)

        twitch_stream = ffmpeg.filter(twitch_stream,
                                      'fps',
                                      fps=1,
                                      round='up')

        twitch_stream = ffmpeg.output(twitch_stream,
                                      current_dir + '/twitch_videos/' + '%d_' + username + '_' + epoch + '.mp4',
                                      sc_threshold='0',
                                      g='60',
                                      f='segment',
                                      segment_time='600',
                                      segment_format_options='movflags=+faststart',
                                      reset_timestamps='1')frl3dqgn21bbpp6tajjvg5pdevczac
        ffmpeg.run(twitch_stream)


    except:
        pass


    


    I am concatenating the path it should go to, to the name of the file. But the folder is empty after I take a look.

    


  • How to convert mp3 data to wav data ?

    12 mai 2023, par Yali

    I have a wav audio file and i extracted data from that wav using python pydub module and i got this data

    


    [-139 18 -215 34 -196 6 -295 -31 -301 -35 -211 13 -93 47
-60 39 -58 7 -17 2]

    


    (this is first 10 data i got more than 1 million data)

    


    from pydub import AudioSegment
import numpy as np

song = AudioSegment.from_file("test.wav")
extract_data = np.array(song.get_array_of_samples())
print(extract_data[:10])


    


    then i converted wav to mp3 using that module and again extracted data from mp3 file and i got this data

    


    [-108 7 -193 24 -223 11 -239 -31 -248 -43 -203 -10 -101 23
-14 24 10 15 24 16]

    


    (this is first 10 data i got more than 1 million data)

    


    song = AudioSegment.from_file("test.wav")
song.export("test.mp3")
mp3_song = AudioSegment.from_file("test.mp3")
extract_data = np.array(mp3_song.get_array_of_samples())
print(extract_data[:10])


    


    and again i converted mp3 to wav now i got mp3 data instead of wav data.

    


    mp3_song = AudioSegment.from_file("test.mp3")
mp3_song.export("test1.wav", format="wav")

song = AudioSegment.from_file("test1.wav")
extract_data = np.array(song.get_array_of_samples())
print(extract_data[:10])


    


    My point is how to convert mp3 data to original wav data ?

    


    please help me,

    


    Thanks.

    


  • CMD Batch Variable Won't Save FFprobe Output

    15 juillet 2017, par Matt McManis

    I have an CMD Batch Script that will convert a folder of mp4 videos to webm.

    You will need :

    • FFmpeg/FFprobe installed and set in Environment Variables to run from CMD.
    • A folder with an mp4 for FFprobe to parse.

    To make it easy, this is only the first part of the script, showing the Video Bitrate variable.

    Here is a full script, just replace the paths.
    https://pastebin.com/raw/3ng77Exz

    How the Script works :

    • Loops through all videos in folder
    • Has FFprobe parse the Video’s Bitrate and save it to %V and
      %vBitrate%.
    • Has FFmpeg use %V. Such as -b:v %V will become the parsed value
      -b:v 9401k.
    • Converts each video from mp4 to webm using the parsed Bitrate

    Problem

    I can’t get FFprobe’s Output to save to the variable. I’ve come up with a workaround, having it first save the bitrate value to a temp file, then import that to the %vBitrate% variable.

    Example : (%V > tmp_vBitrate) & SET /p vBitrate= < tmp_vBitrate.


    Works

    Temp File Variable

    cd "C:\Users\Matt\Videos\" && for %f in (*.mp4) do ffprobe -i "C:\Users\Matt\Desktop\Test\%~f" -select_streams v:0 -show_entries stream=bit_rate -v quiet -of csv="p=0" & for /f "tokens=*" %V in ("ffprobe -i "%~f" -select_streams v:0 -show_entries stream=bit_rate -v quiet -of csv=p=0") do (echo ) & (%V > tmp_vBitrate) & SET /p vBitrate= < tmp_vBitrate & del tmp_vBitrate & for /F %V in ('echo %vBitrate%') do (echo %V)

    Does Not Work

    Memory Variable

    cd "C:\Users\Matt\Videos\" && for %f in (*.mp4) do ffprobe -i "C:\Users\Matt\Desktop\Test\%~f" -select_streams v:0 -show_entries stream=bit_rate -v quiet -of csv="p=0" & for /f "tokens=*" %V in ("ffprobe -i "%~f" -select_streams v:0 -show_entries stream=bit_rate -v quiet -of csv=p=0") do (echo ) & SET vBitrate=%V & for /F %V in ('echo %vBitrate%') do (echo %V)

    Testing It

    Run the first command. When it is finished, type echo %vBitrate% in CMD and press Enter. You’ll see the bitrate of the last mp4 file parsed.

    Do the same for the second command and you’ll see it doesn’t work.


    Solution

    I would like to get rid of the Temp File Variable and get the second command to work.

    (%V > tmp_vBitrate) & SET /p vBitrate= < tmp_vBitrate to just SET vBitrate=%V.

    Maybe this whole thing can be simplified ? Am I using the variables wrong ?