Advanced search

Medias (3)

Tag: - Tags -/plugin

Other articles (71)

  • MediaSPIP v0.2

    21 June 2013, by

    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 (...)

  • MediaSPIP version 0.1 Beta

    16 April 2011, by

    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 (...)

  • Publier sur MédiaSpip

    13 June 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

On other websites (10701)

  • Why failes ffmpeg with "Failed to inject frame into filter network: Internal bug, should not have happened"?

    17 October 2023, by StackOverRigge

    I want to convert a MP4 video file into an animated gif file using ffmpeg. I am trying to do this in two steps:

    


      

    1. Create a palette image
    2. 


    3. Convert the MP4 with the help of the palette image to a GIF file
    4. 


    


    I'm using ffmpeg 6.0 essentials_build.

    


    First, I create a palette image:

    


    ffmpeg -v warning -i video.mp4 -vf "fps=15,scale=1366:768:flags=lanczos,palettegen=stats_mode=diff" -y palette.png


    


    Then, I'm trying to convert the MP4 to GIF:

    


    ffmpeg -i video.mp4 -i palette.png -lavfi "fps=15,scale=1366:768:flags=lanczos,paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle" -y video.gif


    


    This command ends in this error message:

    


    Error while filtering: Internal bug, should not have happeneditrate=4279.9kbits/s speed=0.742x
Failed to inject frame into filter network: Internal bug, should not have happened
Error while processing the decoded data for stream #0:0


    


  • Fix "Non-monotonic DTS" Warning Caused By asetnsamples Filter

    3 September 2024, by Harry Muscle

    I'm using the following complex filter to mute certain parts of an audio file and replace those parts with a beep generated by the sine filter:

    


    [0]asetnsamples=n=1,volume=0:enable='between(t,1.57,1.97)+between(t,4.77,5.27)+between(t,5.37,5.87)+between(t,6.37,6.77)'[dippedVocals];sine=d=10:f=1000:samples_per_frame=1,pan=stereo|FL=c0|FR=c0[constantBleep];[constantBleep]atrim=start=0:end=6.77[shortenedBleep];[shortenedBleep]volume=0:enable='between(t,0,1.57)+between(t,1.97,4.77)+between(t,5.27,5.37)+between(t,5.87,6.37)'[dippedBleep];[dippedVocals][dippedBleep]amix=inputs=2


    


    Since I need the locations specified to be exact I'm using the asetnsamples filter to set 1 sample per frame to get the highest possible accuracy. However, as soon as I add this asetnsamples filter to my filter chain I get thousands of these messages:

    


    Non-monotonic DTS; previous: XXX, current: XXX; changing to XXX.  This may result in incorrect timestamps in the output file.


    


    Any idea what's causing that and how to fix it? BTW, the input file is a ogg file encoded at 44100Hz and the output file is a wav file. Do wav files even contain timestamps?

    


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

    7 September 2024, by 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
}
'''