
Recherche avancée
Médias (2)
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
Autres articles (65)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications 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, parCertains 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, parL’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 BassI make screen recordings with
ffmpeg
, usingavfoundation
on Mac OS X,x11grab
on Linux andgdigrab
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] bgr0Still, 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 bytesthe 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 : VideoHandlerQuestions :
- Can someone explain the above
ffmpeg
logging ? - If I still need to convert the
avfoundation
video stream toyuv420p
, how do I make it on the fly (in a singleffmpeg
pass) ?
- Can someone explain the above
-
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 user14290993The 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)


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


-
Android FFmpeg export of the Video in SurfaceView with Pinch/Scale/Zoom/Bg Color Operation
31 mai 2024, par CoderDevI'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.
I can apply a background color which will be applied to the whole space of the outer of the video frame.


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 :


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




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


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


private fun exportVideo() {
 val outputVideoPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).path + "/ffmpegoutput.mp4"
 val inputVideoPath = selectedFilePath
 val bgColor = getColorHexCode()

 // Load the input video dimensions
 val retriever = MediaMetadataRetriever()
 retriever.setDataSource(inputVideoPath)
 val videoWidth = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH)?.toInt() ?: 0
 val videoHeight = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT)?.toInt() ?: 0
 retriever.release()

 // Calculate the scaled dimensions
 val scaledWidth = (videoWidth * scaleFactor).toInt()
 val scaledHeight = (videoHeight * scaleFactor).toInt()

 // Calculate the new translation
 val translatedX = translationX.toInt()
 val translatedY = translationY.toInt()

 // Ensure the output dimensions are at least as large as the scaled dimensions
 val outputWidth = maxOf(deviceWidth, scaledWidth + abs(translatedX) * 2)
 val outputHeight = maxOf(deviceHeight, scaledHeight + abs(translatedY) * 2)

 // Calculate padding positions
 val xPad = (outputWidth - scaledWidth) / 2 + translatedX
 val yPad = (outputHeight - scaledHeight) / 2 + translatedY

 // Create the filter string for FFmpeg
 val filter = "scale=$scaledWidth:$scaledHeight," +
 "pad=$diagonal:$diagonal:(ow-iw)/2:(oh-ih)/2:$bgColor," +
 "pad=$outputWidth:$outputHeight:$xPad:$yPad:$bgColor"


 val command = ("-i $inputVideoPath " +
 "-vf $filter " +
 "-c:a copy " + // Copy the audio stream without re-encoding
 "-y $outputVideoPath"
 )

 // Execute FFMPEG command
 executeFFmpegKitCommand(command)
 }


 private fun executeFFmpegKitCommand(command: String) {
 FFmpegKit.executeAsync(command) { session ->
 println("FFMPEG executeAsync, session: $session")
 val returnCode = session.returnCode
 if (returnCode.isValueSuccess) {
 // Handle success
 runOnUiThread {
 Toast.makeText(this, "Video saved successfully!", Toast.LENGTH_SHORT).show()
 }
 } else {
 // Handle failure
 runOnUiThread {
 Toast.makeText(this, "Failed to save video", Toast.LENGTH_SHORT).show()
 }
 }
 }
 }



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.