Recherche avancée

Médias (91)

Autres articles (70)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

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

  • 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
}
'''


    


  • C code to cut the MPEG 2 Video at GOP(Group of Pictures) End

    21 août 2014, par user2406774

    I am working on MPEG 2 Transcoding project and I need to cut a video at the boundary of GOP.
    I’ve gone through some Documents and was able to cut the video at the start of next GOP (by checking the I-frame (or) GOP Start code 0x00 0x00 0x01 0xB8), but I need to cut the video at same GOP Boundary.

    Is there any ways to do this ?

  • ffmpeg2theora parameter out of range

    12 mai 2014, par greg

    I’m trying to convert a mp4 file to ogg with ffmpeg2theora and I have a lot of "paramater out of range" :

    [NULL @ 0x633740] Value 4707126720094797824.000000 for parameter 'probesize' out of range
    [NULL @ 0x633740] Value 4707126720094797824.000000 for parameter 'analyzeduration' out of range
    [NULL @ 0x633740] Value 4697254411347427328.000000 for parameter 'indexmem' out of range

    something like 50 lines of that then :

    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x633740] decoding for stream 0 failed
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x633740] Could not find codec parameters (Video: h264 (avc1 / 0x31637661), 440 kb/s)
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x633740] decoding for stream 1 failed
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x633740] Could not find codec parameters (Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 128 kb/s)

    Am I missing something ? codecs maybe ?

    TIA

    greg