Recherche avancée

Médias (0)

Mot : - Tags -/presse-papier

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

Autres articles (79)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (6372)

  • Catch if the Java process crashed

    10 mai 2018, par Victor Sheyanov

    I run java process to convert video using ffmpeg.exe.

    Runtime rt = Runtime.getRuntime();
    String cmd = FFMPEGFULLPATH + " -y -i " + '"' + mpeg4File + '"' + " -vcodec libx264 -vsync 2 " + '"' + H264file + '"';

    Process pr = rt.exec(cmd);

    ThreadedTranscoderIO errorHandler = new ThreadedTranscoderIO(pr.getErrorStream(), "Error Stream");
    errorHandler.start();
    ThreadedTranscoderIO inputHandler = new ThreadedTranscoderIO(pr.getInputStream(), "Output Stream");
    inputHandler.start();

    try {
         pr.waitFor();
    } catch (InterruptedException e) {
         LiveApplication.logger.info("Some shit happens during convertation 2 ");
         throw new IOException("UseTranscoderBlocking - Run_FFMPEG - process interrupted " + e);                  
    }

    But when the process started, sometimes especially with big files, but not always i get this windows message :

    enter image description here

    This happens only on Windows server 2008 and didn’t happened on Windows 7.

    I have 2 questions :

    1. Why this process fails ?
    2. Can I catch this fail in Java, close
      this window and continue thread execution (maybe I’ll restart this
      proccess).
  • Sending keystrokes to subprocess using Python's popen

    10 avril 2018, par Paul Vincent Craven

    I have a Python 3.6 program that is calling ffplay from the ffmpeg library using the Popen command.

    I want to send ffplay keystrokes so I can control the playback. But nothing seems to happen. Take this example :

    import subprocess
    import time

    # Array with the command in it
    my_command = ("ffplay", "-nodisp", "-autoexit", "examples/sounds/Fantascape_Looping.mp3")

    # Open a subprocess
    my_subprocess = subprocess.Popen(my_command,
                                    stdin=subprocess.PIPE,
                                    stdout=subprocess.PIPE,
                                    stderr=subprocess.PIPE)

    # Wait 2 seconds
    time.sleep(2)

    # Try to send an escape:
    print("Attempt to send and 'escape' to stop the sound")
    my_subprocess.stdin.write(b'\x1b')

    # Wait and see what happens
    print("Should no longer hear anything")
    time.sleep(5)

    I hear music for 7 seconds, rather than 2 seconds. What is wrong with the code ?

  • Trying to convert an mp3 file to a Numpy Array, and ffmpeg just hangs

    29 mai 2021, par Rich

    I'm working on a music classification methodology with Scikit-learn, and the first step in that process is converting a music file to a numpy array.

    



    After unsuccessfully trying to call ffmpeg from a python script, I decided to simply pipe the file in directly :

    



    FFMPEG_BIN = "ffmpeg"
cwd = (os.getcwd())
dcwd = (cwd + "/temp")
if not os.path.exists(dcwd): os.makedirs(dcwd)

folder_path = sys.argv[1]
f = open("test.txt","a")

for f in glob.glob(os.path.join(folder_path, "*.mp3")):
    ff = f.replace("./", "/")
    print("Name: " + ff)
    aa = (cwd + ff)

    command = [ FFMPEG_BIN,
        '-i',  aa,
        '-f', 's16le',
        '-acodec', 'pcm_s16le',
        '-ar', '22000', # ouput will have 44100 Hz
        '-ac', '1', # stereo (set to '1' for mono)
        '-']

    pipe = sp.Popen(command, stdout=sp.PIPE, bufsize=10**8)
    raw_audio = pipe.proc.stdout.read(88200*4)
    audio_array = numpy.fromstring(raw_audio, dtype="int16")
    print (str(audio_array))
    f.write(audio_array + "\n")


    



    The problem is, when I run the file, it starts ffmpeg and then does nothing :

    



    [mp3 @ 0x1446540] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from '/home/don/Code/Projects/MC/Music/Spaz.mp3':
  Metadata:
    title           : Spaz
    album           : Seeing souns
    artist          : N*E*R*D
    genre           : Hip-Hop
    encoder         : Audiograbber 1.83.01, LAME dll 3.96, 320 Kbit/s, Joint Stereo, Normal quality
    track           : 5/12
    date            : 2008
  Duration: 00:03:50.58, start: 0.000000, bitrate: 320 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
Output #0, s16le, to 'pipe:':
  Metadata:
    title           : Spaz
    album           : Seeing souns
    artist          : N*E*R*D
    genre           : Hip-Hop
    date            : 2008
    track           : 5/12
    encoder         : Lavf56.4.101
    Stream #0:0: Audio: pcm_s16le, 22000 Hz, mono, s16, 352 kb/s
    Metadata:
      encoder         : Lavc56.1.100 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help


    



    It just sits there, hanging, for far longer than the song is. What am I doing wrong here ?,