Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (65)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

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

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

Sur d’autres sites (12690)

  • Making a ffmpeg screen capture on Mac OS X using YUV 4:2:0 Planar color model

    30 mai 2019, par Bass

    I make screen recordings with ffmpeg, using avfoundation on Mac OS X, x11grab on Linux and gdigrab on Windows.

    The resulting files should be compatible with modern web browsers (<video></video>), so I use H.264 codec and request YUV 4:2:0 Planar pixel format.

    On Mac OS X, however (unlike Linux and Windows), I receive the following logging :

    /usr/local/bin/ffmpeg -y -v error -f avfoundation -threads 0 -hide_banner -i 1:none -f mp4 -vcodec h264 -pix_fmt yuv420p -r 25/1 -qscale:v 1 -vf scale=-1:1080 target.mp4
    [avfoundation @ 0x7fdba2003a00] Selected pixel format (yuv420p) is not supported by the input device.
    [avfoundation @ 0x7fdba2003a00] Supported pixel formats:
    [avfoundation @ 0x7fdba2003a00]   uyvy422
    [avfoundation @ 0x7fdba2003a00]   yuyv422
    [avfoundation @ 0x7fdba2003a00]   nv12
    [avfoundation @ 0x7fdba2003a00]   0rgb
    [avfoundation @ 0x7fdba2003a00]   bgr0

    Still, according to mplayer, the resulting MP4 file seems to have YUV 4:2:0 Planar color model :

    [h264 @ 0x1048a8ac0]Format yuv420p chosen by get_format().
    [h264 @ 0x1048a8ac0]Reinit context to 1728x1088, pix_fmt: yuv420p
    [h264 @ 0x1048a8ac0]Format yuv420p chosen by get_format().
    [h264 @ 0x1048a8ac0]Reinit context to 1728x1088, pix_fmt: yuv420p
    [swscaler @ 0x1048c3cc0]bicubic scaler, from yuv420p to yuyv422 using MMXEXT
    *** [scale] Exporting mp_image_t, 1728x1080x12bpp YUV planar, 2799360 bytes
    *** [vo] Allocating mp_image_t, 1728x1080x16bpp YUV packed, 3732480 bytes

    the same confirmed by ffmpeg :

    $ ffmpeg -i target.mp4 -hide_banner
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'target.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf58.20.100
     Duration: 00:00:04.72, start: 0.000000, bitrate: 201 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1728x1080, 197 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler

    Questions :

    1. Can someone explain the above ffmpeg logging ?
    2. If I still need to convert the avfoundation video stream to yuv420p, how do I make it on the fly (in a single ffmpeg pass) ?
  • AV_PIX_FMT_NV12 says it has a 12bpp bit pixel color but data is uint8_t how can I modify the pixels from a frame ?

    9 juillet 2024, par user14290993

    The documentaions says AV_PIX_FMT_NV12 planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)

    &#xA;

    also linesize[1] and linesize[0] are 1920, but if I strlen(data[1]) ( UV components )&#xA;I get 1044587 this divided by the frame->heigth gives me 967,21... so the linesize is wrong ?

    &#xA;

  • Android FFmpeg export of the Video in SurfaceView with Pinch/Scale/Zoom/Bg Color Operation

    31 mai 2024, par CoderDev

    I'm working on a feature in which I need to perform some actions on the selected video from the gallery and then upload it on the Backend server, on this selected video I can pinch it to scale up/down/zoom in/out and place it anywhere on the screen (even out side the screen), just like the Instagram app.&#xA;I can apply a background color which will be applied to the whole space of the outer of the video frame.

    &#xA;

    After all the above changes I'm exporting the changes to the output video that will contain all the changes that I've mentioned above. I'm using the FFMpeg for the same :

    &#xA;

        implementation("com.arthenica:ffmpeg-kit-full-gpl:6.0-2.LTS")&#xA;&#xA;

    &#xA;

    Basically the operation is being achieved with this solution (Except Export Video) : Android SurfaceView operation on Video to Pinch/Scale/Zoom/Bg Color

    &#xA;

    I've tried numerous FFmpeg commands but not getting the adequate output, I've tried below solution :

    &#xA;

        private fun exportVideo() {&#xA;        val outputVideoPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).path &#x2B; "/ffmpegoutput.mp4"&#xA;        val inputVideoPath = selectedFilePath&#xA;        val bgColor = getColorHexCode()&#xA;&#xA;        // Load the input video dimensions&#xA;        val retriever = MediaMetadataRetriever()&#xA;        retriever.setDataSource(inputVideoPath)&#xA;        val videoWidth = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH)?.toInt() ?: 0&#xA;        val videoHeight = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT)?.toInt() ?: 0&#xA;        retriever.release()&#xA;&#xA;        // Calculate the scaled dimensions&#xA;        val scaledWidth = (videoWidth * scaleFactor).toInt()&#xA;        val scaledHeight = (videoHeight * scaleFactor).toInt()&#xA;&#xA;        // Calculate the new translation&#xA;        val translatedX = translationX.toInt()&#xA;        val translatedY = translationY.toInt()&#xA;&#xA;         // Ensure the output dimensions are at least as large as the scaled dimensions&#xA;        val outputWidth = maxOf(deviceWidth, scaledWidth &#x2B; abs(translatedX) * 2)&#xA;        val outputHeight = maxOf(deviceHeight, scaledHeight &#x2B; abs(translatedY) * 2)&#xA;&#xA;        // Calculate padding positions&#xA;        val xPad = (outputWidth - scaledWidth) / 2 &#x2B; translatedX&#xA;        val yPad = (outputHeight - scaledHeight) / 2 &#x2B; translatedY&#xA;&#xA;        // Create the filter string for FFmpeg&#xA;        val filter = "scale=$scaledWidth:$scaledHeight," &#x2B;&#xA;                "pad=$diagonal:$diagonal:(ow-iw)/2:(oh-ih)/2:$bgColor," &#x2B;&#xA;                "pad=$outputWidth:$outputHeight:$xPad:$yPad:$bgColor"&#xA;&#xA;&#xA;        val command = ("-i $inputVideoPath " &#x2B;&#xA;                "-vf $filter " &#x2B;&#xA;                "-c:a copy " &#x2B; // Copy the audio stream without re-encoding&#xA;                "-y $outputVideoPath"&#xA;                )&#xA;&#xA;        // Execute FFMPEG command&#xA;        executeFFmpegKitCommand(command)&#xA;    }&#xA;&#xA;&#xA;    private fun executeFFmpegKitCommand(command: String) {&#xA;        FFmpegKit.executeAsync(command) { session ->&#xA;            println("FFMPEG executeAsync, session: $session")&#xA;            val returnCode = session.returnCode&#xA;            if (returnCode.isValueSuccess) {&#xA;                // Handle success&#xA;                runOnUiThread {&#xA;                    Toast.makeText(this, "Video saved successfully!", Toast.LENGTH_SHORT).show()&#xA;                }&#xA;            } else {&#xA;                // Handle failure&#xA;                runOnUiThread {&#xA;                    Toast.makeText(this, "Failed to save video", Toast.LENGTH_SHORT).show()&#xA;                }&#xA;            }&#xA;        }&#xA;    }&#xA;

    &#xA;

    But this not giving me the adequate output, it's not creating the output with the Screen's height/width (Tried passing the same), and the original video position is also not correct on the canvas which I've placed with the touch event.

    &#xA;