Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (50)

  • 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

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

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

  • FFmpeg drawtext filter error : "Cannot find a valid font for the family Sans"

    7 septembre 2024, par fatdrogen

    I'm trying to add text overlay to a video using FFmpeg's drawtext filter in my iOS app, but I'm encountering the following error :

    


    error : Cannot load default config file

    


    ERROR : Cannot find a valid font for the family Sans

    


    ERROR : Error initializing filter 'drawtext'

    


    ERROR : with args 'text=write some thing :'

    


    Here's the relevant part of my FFmpeg command :

    


    Copydrawtext=text='write some thing '

    


    Questions :

    


    What's causing this error, and how can I resolve it ?
Is there a way to specify a font that's guaranteed to be available on iOS devices ?
Are there any alternative approaches to adding text overlay in FFmpeg that might avoid this issue ?

    


    Environment :

    


    Platform : iOS
FFmpeg : Using MobileFFmpeg library
Swift

    


    Any help or guidance would be greatly appreciated !

    


    func makeGIFData(asset: AVAsset,  startTime: Double, endTime: Double, rotation: Double, overlayText: String) async throws -> Data {
    let fileName = "\(ProcessInfo.processInfo.globallyUniqueString)_input.mp4"
    let fileURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(fileName)
    
    // Export the asset to a temporary file
    guard let exporter = try? await AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetHighestQuality) else {
        throw NSError(domain: "GIFConversionError", code: -1, userInfo: [NSLocalizedDescriptionKey: "Failed to create AVAssetExportSession"])
    }
    
    exporter.outputURL = fileURL
    exporter.outputFileType = .mp4
    exporter.timeRange = CMTimeRange(start: CMTime(seconds: startTime, preferredTimescale: 600), end: CMTime(seconds: endTime, preferredTimescale: 600))
    
    do {
        try await exporter.export()
    } catch {
        throw NSError(domain: "GIFConversionError", code: -2, userInfo: [NSLocalizedDescriptionKey: "Failed to export video: \(error.localizedDescription)"])
    }
    
    let outfileName = "\(ProcessInfo.processInfo.globallyUniqueString)_outfile.gif"
    let outfileURL = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(outfileName)
    
    // Get video dimensions
    guard let track = try? await asset.loadTracks(withMediaType: .video).first,
          let videoSize = try? await track.load(.naturalSize) else {
        throw NSError(domain: "GIFConversionError", code: -4, userInfo: [NSLocalizedDescriptionKey: "Failed to get video dimensions"])
    }
    
    // Prepare FFmpeg command
    var command = "-i \(fileURL.path) -vf "
    
    
    // Add text overlay
    let escapedText = overlayText.replacingOccurrences(of: ":", with: "\\:").replacingOccurrences(of: "'", with: "\\'")
    let fontColor = textColor.toHexString()
    
    // Use a more universally available font, or provide multiple options
    filters += ",drawtext=text='write some thing ':"
    
    // Add palette generation and application
    filters += ",split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse"
    
    // Add filters to command
    command += "\"\(filters)\""
    
    // Finalize command
    command += " -loop 0 \(outfileURL.path)"
    
    print("FFmpeg command: \(command)")
    
    let startTime = CFAbsoluteTimeGetCurrent()
    
    let result = MobileFFmpeg.execute(command)
    
    if result != RETURN_CODE_SUCCESS {
        throw NSError(domain: "GIFConversionError", code: Int(result), userInfo: [NSLocalizedDescriptionKey: "FFmpeg conversion failed"])
    }
    
    let timeElapsed = CFAbsoluteTimeGetCurrent() - startTime
    print("Time elapsed: \(timeElapsed) s.")
    
    // Read the generated GIF file
    guard let gifData = try? Data(contentsOf: outfileURL) else {
        throw NSError(domain: "GIFConversionError", code: -3, userInfo: [NSLocalizedDescriptionKey: "Failed to read generated GIF file"])
    }
    
    print("Animated GIF data created successfully. Size: \(gifData.count) bytes")
    
    // Clean up temporary files
    try? FileManager.default.removeItem(at: fileURL)
    try? FileManager.default.removeItem(at: outfileURL)
    
    return gifData
}
'''


    


  • fftools/cmdutils : fix error message for "ffmpeg -init_hw_device list"

    26 mars, par Jun Zhao
    fftools/cmdutils : fix error message for "ffmpeg -init_hw_device list"
    

    When running 'ffmpeg -init_hw_device list' to display available hardware
    devices, it incorrectly shows an error message :
    "Failed to set value 'list' for option 'init_hw_device' : Immediate exit requested"

    This is a regression introduced by commit a50f90f1c23. The command is
    actually working as intended - it should exit after listing devices, but
    shouldn't display an error message.

    Signed-off-by : Jun Zhao <barryjzhao@tencent.com>

    • [DH] fftools/cmdutils.c
  • FFmpeg conversion failed with "Subtitle encoding failed" and "canvas_size is too small" [closed]

    21 avril, par Hillol Talukdar

    I'm converting video files using FFmpeg, but the process fails and shows some errors that I don't fully understand the cause of. How can I avoid the error and fix the issue ? Below is the command I used and the output I received.

    &#xA;

    FFmpeg Command :

    &#xA;

    ffmpeg -y -hide_banner -i saf:12.VOB -map 0:3 -c:s:0 dvdsub -map 0:2 -map 0:1 -f mp4 -vcodec copy -map_metadata 0:g -acodec aac -async 1 saf:13.mp4&#xA;

    &#xA;

    ErrorMessage :

    &#xA;

    Input #0, mpeg, from &#x27;saf:12.VOB&#x27;:&#xA;  Duration: 00:00:21.99, start: 0.280633, bitrate: 7147 kb/s&#xA;  Stream #0:0[0x1bf]: Data: dvd_nav_packet&#xA;  Stream #0:1[0x1e0]: Video: mpeg2video, yuv420p(tv, top first), 720x480 [SAR 32:27 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 7816000/0/0 buffer size: 1835008 vbv_delay: N/A&#xA;  Stream #0:2[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536 kb/s&#xA;  Stream #0:3[0x20]: Subtitle: dvd_subtitle&#xA;  Stream #0:4[0x21]: Subtitle: dvd_subtitle&#xA;&#xA;Stream mapping:&#xA;  Stream #0:3 -> #0:0 (dvd_subtitle (dvdsub) -> dvd_subtitle (dvdsub))&#xA;  Stream #0:2 -> #0:1 (pcm_dvd (native) -> aac (native))&#xA;  Stream #0:1 -> #0:2 (copy)&#xA;&#xA;Press [q] to stop, [?] for help&#xA;&#xA;Output #0, mp4, to &#x27;saf:13.mp4&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf60.3.100&#xA;  Stream #0:0: Subtitle: dvd_subtitle (mp4s / 0x7334706D), 720x480&#xA;    Metadata:&#xA;      encoder         : Lavc60.3.100 dvdsub&#xA;  Stream #0:1: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s&#xA;    Metadata:&#xA;      encoder         : Lavc60.3.100 aac&#xA;  Stream #0:2: Video: mpeg2video (mp4v / 0x7634706D), yuv420p(tv, top first), 720x480 [SAR 32:27 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 7816000/0/0 buffer size: 1835008 vbv_delay: N/A&#xA;&#xA;frame=   15 fps=0.0 q=-1.0 size=       0kB time=00:00:00.73 bitrate=   0.5kbits/s speed= 212x    &#xA;frame=  577 fps=0.0 q=-1.0 size=    5120kB time=00:00:19.18 bitrate=2186.2kbits/s speed=38.1x    &#xA;&#xA;[dvdsub @ 0xb400006ffb03dde0] canvas_size(0:0) is too small(719:479) for render&#xA;[sost#0:0/dvdsub @ 0xb400006feaec5730] Subtitle encoding failed&#xA;[aac @ 0xb400006ffb02f500] Qavg: 36253.348&#xA;[aac @ 0xb400006ffb02f500] 2 frames left in the queue on closing&#xA;&#xA;Conversion failed!&#xA;

    &#xA;