Recherche avancée

Médias (91)

Autres articles (104)

  • 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

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (9606)

  • 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.

    


  • Does ffmpeg 3.0 support hardware acceleration for video stream on iOS, if it does, how to enable it ?

    30 mars 2016, par Gaojin Hsu

    Do I have to use Apple’s VideoToolBox.framework and CoreVideo.framework to enable hardware acceleration on iOS ? is that the only way ? Does the newest ffmpeg have the ability?if it does, how to enable it ?

  • CMTimeGetSeconds doesn't get the right video duration

    26 février 2015, par JLCastillo

    some users don’t get the right duration of videos they capture with their own device. The funny thing is others do actually see it right, using the same device models and OS version. Anyway, we observed it in a iPhone 5c 7.1.2 and an iPhone 5s 8.1.3.

    This code works for most users, but not all :

    ALAssetRepresentation *representation = [mediaObject.asset defaultRepresentation];
    NSURL *url = [representation url];
    NSDictionary *options = @{ AVURLAssetPreferPreciseDurationAndTimingKey : @YES };
    AVAsset *avAsset = [AVURLAsset URLAssetWithURL:url options:options];
    videoDurationTime = CMTimeGetSeconds(avAsset.duration);

    I asked them to send the input videos, and this is the output from "ffmpeg -i"

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bug_duration1.MOV':
     Metadata:
       major_brand     : qt
       minor_version   : 0
       compatible_brands: qt
       creation_time   : 2015-02-23 08:30:01
       encoder         : 8.1.3
       encoder-eng     : 8.1.3
       date            : 2015-02-23T16:30:01+0800
       date-eng        : 2015-02-23T16:30:01+0800
       model           : iPhone 5s
       model-eng       : iPhone 5s
       make            : Apple
       make-eng        : Apple
     Duration: 00:00:03.67, start: 0.000000, bitrate: 16793 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 16719 kb/s, 29.99 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
       Metadata:
         creation_time   : 2015-02-23 08:30:01
         handler_name    : Core Media Data Handler
         encoder         : H.264
       Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 61 kb/s (default)
       Metadata:
         creation_time   : 2015-02-23 08:30:01
         handler_name    : Core Media Data Handler

    The video is detected with a duration of several minutes. Did anybody face this problem before ?

    Thanks in advance.