Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (62)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (11739)

  • Swift A script of macOS is not running on the M2 chip ?

    15 avril 2024, par Muhammad Danish Qureshi

    I am making a macOS app using SwiftUI, app is working fine on mac Intel chip, mac Apple M1 chip but not working on the mac M2 chip.
Below is the following code which is crashing on M2 chip for force unwrapping the data in String(data: data!, encoding: .utf8).

    


    I know that force unwrap is not suitable, but for testing purpose I am doing force unwrap.

    


    When I run the which ffmpeg in terminal it provides the path in result, no matter which mac terminal is (it always return actual path of ffmpeg), but when run this command from the swift Program it does not found anything and got crashed on apple M2 chip.

    


    My actual scenario (or requirement) is I need to get the path using the command which ffmpeg and write that path in the file on macOS app.

    


    Kindly guide me why the code is crashing or not providing the actual path.

    


    func findFFmpegPath() -> String? {
            let task = Process()
            task.launchPath = "/bin/bash" // Path to bash shell
            task.arguments = ["-l", "-c", "which ffmpeg"] // Execute "which ffmpeg" command
    let pipe = Pipe()
    task.standardOutput = pipe
    task.standardError = pipe // Capture any errors as well

    do {
        try task.run()
        let data = try pipe.fileHandleForReading.readToEnd()
        let output = String(data: data!, encoding: .utf8)
        print("data:\(data)\n\(output)\n\(output?.trimmingCharacters(in: .whitespacesAndNewlines))")
        return output?.trimmingCharacters(in: .whitespacesAndNewlines)
    } catch {
        print("Error running task: \(error)")
        return nil
    }
}


    


    When I run which ffmpeg in the terminal it gives me path correctly, See the screenshot bleow.

    


    enter image description here

    


    When I run the /bin/bash -l -c "which ffmpeg" in the M2 than I got this result.

    


    enter image description here

    


    When I run the /bin/bash -l -c "which ffmpeg" in the Apple M1 than I got this result.

    


    enter image description here

    


    Getting desired result in the terminal, but not getting result from the Swift Program.

    


  • issue starting ffmpeg screen capture on OSX (AVFoundation) from Java

    24 juin 2022, par stewori

    I would like to launch from Java on OSX a screen capture command like explained here : https://trac.ffmpeg.org/wiki/Capture/Desktop

    



    It works fine from the terminal. But when I launch exactly the same command using Java's Runtime.exec I get the following output :

    



    [AVFoundation input device @ 0x7f892f500400] Video device not found

'1:': Input/output error


    



    Assume the command I run is stored as String cmd = "ffmpeg -f avfoundation -i '1:' output.mkv". Things I tried :

    



      

    • Using ffmpeg -f avfoundation -list_devices true -i "" I asserted that 1 is the correct index for the screen. I ran that command also via Runtime.exec and it gives the same indexes as when I run it from terminal.

    • 


    • It does not make a difference whether I use '1:' or "\"1:\"". Well, in the latter case it says "1:": Input/output error. Both variants work in terminal.

    • 


    • Neither does it make a difference whether I call
Runtime.getRuntime().exec(cmd),
Runtime.getRuntime().exec(cmd.split(" ")) or (new ProcessBuilder(cmd.split(" "))).start(). In principle it starts ffmpeg and that terminates with the output given above.

    • 


    • It does not seem to make a difference whether I read out ffmpeg's output or not (via process.getErrorStream())

    • 


    • The only thing that works is to store the command in a file, e.g. in run.sh and then call e.g. Runtime.getRuntime().exec("run.sh"). It should be possible to execute this properly from Java without this kind of workaround, right ? What am I doing wrong ?

    • 


    • On Linux, using e.g. ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+100,200 output.mp4 it works fine, from command line or from Java, with Runtime.exec and via ProcessBuilder.

    • 


    



    I did not try it on Windows. On OSX (Mojave 10.14.5) I used Java 12, on Linux (Mint 18, 64bit) Java 8. Would be some hassle to try it with Java 12 on Linux and I suspect the Java version is not the cause, given that avfoundation vs x11grab is the far more dominant difference.

    


  • FFmpeg remove silence with exact duration detected by detect silence

    17 mars 2021, par dav

    I have an audio file, that have some silences, which I am detecting with ffmpeg detectsilence and then trying to remove with removesilence, however there is some strange behavior. Specifically :

    


    1) File's Basic info based on ffprobe show_streams

    


    Input #0, mp3, from 'my_file.mp3':
  Metadata:
    encoder         : Lavf58.64.100
  Duration: 00:00:25.22, start: 0.046042, bitrate: 32 kb/s
    Stream #0:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s


    


    2) Using detectsilence

    


    ffmpeg -i my_file.mp3 -af silencedetect=noise=-50dB:d=0.2 -f null -


    


    I get this result

    


    [mp3float @ 000001ee50074280] overread, skip -7 enddists: -1 -1
[silencedetect @ 000001ee5008a1c0] silence_start: 6.21417
[silencedetect @ 000001ee5008a1c0] silence_end: 6.91712 | silence_duration: 0.702958
[silencedetect @ 000001ee5008a1c0] silence_start: 16.44
[silencedetect @ 000001ee5008a1c0] silence_end: 17.1547 | silence_duration: 0.714708
[mp3float @ 000001ee50074280] overread, skip -10 enddists: -3 -3
[mp3float @ 000001ee50074280] overread, skip -5 enddists: -4 -4
[silencedetect @ 000001ee5008a1c0] silence_start: 24.4501
size=N/A time=00:00:25.17 bitrate=N/A speed=1.32e+03x
video:0kB audio:1180kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[silencedetect @ 000001ee5008a1c0] silence_end: 25.176 | silence_duration: 0.725917


    


    That also match the values and points based on Adobe Audition

    


    my file adobe audition silences

    


    So far all good.

    


    3) Now, based on some calculations (which is based on application's logic on what should be the final duration of the audio) I am trying to delete the silence with "0.725917"s duration. For that, based on ffmpeg docs (https://ffmpeg.org/ffmpeg-filters.html#silencedetect)

    


    


    Trim all silence encountered from beginning to end where there is more
than 1 second of silence in audio :
silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB

    


    


    I run this command

    


    ffmpeg -i my_file.mp3 -af silenceremove=stop_periods=-1:stop_threshold=-50dB:stop_duration=0.72 result1.mp3


    


    So, I am expecting that it should delete only the silence with "0.725917" duration (the last one in the above image), however it is deleting the silence that starts at 16.44s with duration of "0.714708"s. Please see the following comparison :

    


    my file and result1 adobe audition silence comparison

    


    4) Running detectsilence on result1.mp3 with same options gives even stranger results

    


    ffmpeg -i result1.mp3 -af silencedetect=noise=-50dB:d=0.2 -f null -


    


    result

    


    [mp3float @ 0000017723404280] overread, skip -5 enddists: -4 -4
[silencedetect @ 0000017723419540] silence_start: 6.21417
[silencedetect @ 0000017723419540] silence_end: 6.92462 | silence_duration: 0.710458
[mp3float @ 0000017723404280] overread, skip -7 enddists: -6 -6
[mp3float @ 0000017723404280] overread, skip -7 enddists: -2 -2
[mp3float @ 0000017723404280] overread, skip -6 enddists: -1 -1
    Last message repeated 1 times
[silencedetect @ 0000017723419540] silence_start: 23.7308
size=N/A time=00:00:24.45 bitrate=N/A speed=1.33e+03x
video:0kB audio:1146kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[silencedetect @ 0000017723419540] silence_end: 24.456 | silence_duration: 0.725167


    


    So, the results are :

    


      

    • With command to remove silences that are longer than "0.72 second", a silence that was "0.714708"s, got removed and - a silence with "0.725917"s remained as is (well, actually changed a little - as per 3rd point)
    • 


    • The first silence that had started at "6.21417" and had a duration of "0.702958"s, suddenly now has a duration of "0.710458"s
    • 


    • The 3rd silence that had started at "24.4501" (which now starts at 23.7308 - obviously because the 2nd silence was removed) and had a duration of "0.725917", now suddenly is "0.725167"s (this one is not a big difference, but still why even removing other silence, this silence's duration should change at all).
    • 


    


    Accordingly the expected results are :

    


      

    • Only the silences that match the provided condition (stop_duration=0.72) should be removed. In this specific example only the last one, but in general any silence that matches the condition of the length - irrelevant of their positioning (start, end or in the middle)
    • 


    • Other silences should remain with same exact duration they were before
    • 


    


    FFMpeg : 4.2.4-1ubuntu0.1, Ubuntu : 20.04.2

    


    Some attempts and results, while playing with ffmpeg options

    


    a)

    


    ffmpeg -i my_file.mp3 -af silenceremove=stop_periods=-1:stop_threshold=-50dB:stop_duration=0.72:detection=peak tmp1.mp3


    


    result :
First and second silences are removed, 3rd silence's duration remains exactly the same

    


    b)

    


    ffmpeg -i my_file.mp3 -af silenceremove=stop_periods=-1:stop_threshold=-50dB:stop_duration=0.71 tmp_0.71.mp3


    


    result :
First and second silences are removed, 3rd silence remains, but the duration becomes "0.72075"s

    


    c)

    


    ffmpeg -i my_file.mp3 -af silenceremove=stop_periods=-1:stop_threshold=-50dB:stop_duration=0.7 tmp_0.7.mp3


    


    result :
all 3 silence are removed

    


    d) the edge case

    


    this command still removes the second silence (after which the first silence become exactly as in point #4 and last silence becomes "0.721375")

    


    ffmpeg -i my_file.mp3 -af silenceremove=stop_periods=-1:stop_threshold=-50dB:stop_duration=0.72335499999 tmp_0.72335499999.mp3


    


    but this one, again does not remove any silence :

    


    ffmpeg -i my_file.mp3 -af silenceremove=stop_periods=-1:stop_threshold=-50dB:stop_duration=0.723355 tmp_0.723355.mp3


    


    e) window param case 0.03

    


    ffmpeg -i my_file.mp3 -af silenceremove=stop_periods=-1:stop_threshold=-50dB:stop_duration=0.72:window=0.03 window_0.03.mp3


    


    does not remove any silence, but the detect silence

    


    ffmpeg -i window_0.03.mp3 -af silencedetect=noise=-50dB:d=0.2 -f null -


    


    gives this result (compare with silences in result1.mp3 - from point #4 )

    


    [mp3float @ 000001c5c8824280] overread, skip -5 enddists: -4 -4
[silencedetect @ 000001c5c883a040] silence_start: 6.21417
[silencedetect @ 000001c5c883a040] silence_end: 6.92462 | silence_duration: 0.710458
[mp3float @ 000001c5c8824280] overread, skip -7 enddists: -6 -6
[mp3float @ 000001c5c8824280] overread, skip -7 enddists: -2 -2
[silencedetect @ 000001c5c883a040] silence_start: 16.4424
[silencedetect @ 000001c5c883a040] silence_end: 17.1555 | silence_duration: 0.713167
[mp3float @ 000001c5c8824280] overread, skip -6 enddists: -1 -1
    Last message repeated 1 times
[silencedetect @ 000001c5c883a040] silence_start: 24.4508
size=N/A time=00:00:25.17 bitrate=N/A speed=1.24e+03x
video:0kB audio:1180kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[silencedetect @ 000001c5c883a040] silence_end: 25.176 | silence_duration: 0.725167


    


    f) window case 0.01

    


    ffmpeg -i my_file.mp3 -af silenceremove=stop_periods=-1:stop_threshold=-50dB:stop_duration=0.72:window=0.01 window_0.01.mp3


    


    removes first and second silences, the detect silence with same params has the following result

    


    [mp3float @ 000001ea631d4280] overread, skip -5 enddists: -4 -4
    Last message repeated 1 times
[mp3float @ 000001ea631d4280] overread, skip -7 enddists: -2 -2
[mp3float @ 000001ea631d4280] overread, skip -6 enddists: -1 -1
    Last message repeated 1 times
[silencedetect @ 000001ea631ea1c0] silence_start: 23.0108
size=N/A time=00:00:23.73 bitrate=N/A speed=1.2e+03x
video:0kB audio:1113kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[silencedetect @ 000001ea631ea1c0] silence_end: 23.736 | silence_duration: 0.725167


    



    


    Any thoughts, ideas, points are much appreciated.