Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Autres articles (113)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

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

  • How to pass bytesArray as input and output in command array for FFmpeg execute ?

    11 avril 2023, par Rohit gupta

    I was working with FFmpeg library where I was developing microphone-based reading and writeing the audioData, where i got the challenge to process some audioData. but i dont want to store the files as outputstream or something as it will add additional delays.

    


    This was my code that i used

    


    implementation 'com.arthenica:mobile-ffmpeg-full:4.2.2.LTS'


    


    private fun processAudioAsChipmunk(audioData: ShortArray, record: AudioRecord): ShortArray {
        val sampleRate = record.sampleRate
        val channels = record.channelCount
        val filter = "asetrate=2*${sampleRate},aresample=48000,atempo=2"
        val outputData = audioData
        val cmd = arrayOf(
            "-y",
            "-i",
            fileName1,  // here input filepath is passed, i want it to be ByteArray(audioData)
            "-af",
            "asetrate=22100,atempo=1/2",
            fileName2 //here output filepath is passed, i want it to be ByteArray(outputData)
        )//Chipmunk

        FFmpeg.execute(cmd)
        return outputData
    }



    


    Now i wanted to read and write the audioData without storing and using it as filenames.

    


    the below code shows the code i'm using to read and write audio Data

    


    read = record!!.read(audioData, 0, minBuffer) //AudioRecord
val processedAudioData = processAudioAsChipmunk(audioData, record!!) // Here! 
write = player!!.write(processedAudioData, 0, read) //AudioTrack


    


    Post thought ->

    


    I tried below code but again failed to pass input and output stream instead of filename inside executeAsync

    


    https://github.com/arthenica/ffmpeg-kit


    


    fun executeFfmpegCommand(audioData: ShortArray, rubberbandPitch: Float = 1.0f): ShortArray {
        // Convert short array to byte array
        val byteBuffer = ByteBuffer.allocate(audioData.size * 2)
        byteBuffer.order(ByteOrder.nativeOrder())
        for (i in audioData.indices) {
            byteBuffer.putShort(audioData[i])
        }
        val inputData = byteBuffer.array()

        // Set input data as input stream
        val inputStream = ByteArrayInputStream(inputData)

        // Create output stream to store output data
        val outputStream = ByteArrayOutputStream()

        // Add rubberband filter to command to make audio sound like chipmunk
        val rubberbandFilter = "rubberband=pitch=${rubberbandPitch}"
        val commandWithFilter = arrayOf("-f", "s16le", "-ar", "44100", "-ac", "2", "-i", "-", "-af", rubberbandFilter, "-f", "s16le", "-")

        // Create ffmpeg session
        val session = FFmpegKit.executeAsync() // @!! HOW TO PASS CommandFilter, inputStream, outPutStream here !!@

        // Wait for session to complete
        session.wait()

        // Check if session was successful
        if (ReturnCode.isSuccess(session.returnCode)) {
            Log.e("FFmpeg", "FFmpeg execution failed with return code: ${session.returnCode}")
            return ShortArray(0)
        }

        // Convert output stream to short array
        val outputData = outputStream.toByteArray()
        val shortBuffer = ByteBuffer.wrap(outputData)
            .order(ByteOrder.nativeOrder())
            .asShortBuffer()
        val outputShortArray = ShortArray(shortBuffer.remaining())
        shortBuffer.get(outputShortArray)

        // Return output short array
        return outputShortArray
    }



    


  • ffmpeg with single input, double output to piped output

    29 mars 2023, par Laurier

    I'm trying to stream chunks of a remote video file into ffmpeg, create MP4 and MP3 split files from the original one, and send those chunks back for immediate upload via piping to s3 cp.

    


    What I'd like to do is essentially combine these 2 commands into 1 :

    


    aws s3 cp s3://bucket/file.mp4 - | ffmpeg -i - -f matroska output.mkv | aws s3 cp - s3://bucket
aws s3 cp s3://bucket/file.mp4 - | ffmpeg -i - -f output.mp3 | aws s3 cp - s3://bucket


    


    I tried different variants of the following :

    


    aws s3 cp s3://bucket/file.mp4 - | ffmpeg -i - -f matroska output.mkv -f mp3 output.mp3 | aws s3 cp - s3://bucket


    


    But I'm not sure how to split the multiple outputs into 2 aws cp commands running in parallel

    


  • how do I decode an input video using FFmpeg and calculate the PSNR between input and output ?

    27 janvier 2023, par david

    I have an input video in mkv format and want to decode it and calculate the PSNR after decoding. for this aim, I used the following code :

    


    ffmpeg -i input.mkv -f rawvideo -pix_fmt yuv420p output.yuv


    


    but the output is in yuv format and I can not calculate PSNR between it and mkv input file. I am new to using ffmpeg and encoding and decoding. how do I decode the input file and calculate the PSNR value ? is it possible for the output to be in mkv format ? because I use the following code for PSNR calculation but both files have to have the same format.

    


    ffmpeg -i [Input1] -i [Input2] -lavfi psnr -f null -