
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (73)
-
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
MediaSPIP en mode privé (Intranet)
17 septembre 2013, parÀ partir de la version 0.3, un canal de MediaSPIP peut devenir privé, bloqué à toute personne non identifiée grâce au plugin "Intranet/extranet".
Le plugin Intranet/extranet, lorsqu’il est activé, permet de bloquer l’accès au canal à tout visiteur non identifié, l’empêchant d’accéder au contenu en le redirigeant systématiquement vers le formulaire d’identification.
Ce système peut être particulièrement utile pour certaines utilisations comme : Atelier de travail avec des enfants dont le contenu ne doit pas (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.
Sur d’autres sites (10128)
-
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.


-
vf_colorspace : Interpret unspecified color range as limited range
19 septembre 2016, par Vittorio Giovaravf_colorspace : Interpret unspecified color range as limited range
This is the assumption that is made in pixel format conversion do
throughout the code (in particular swscale), and BT-specifications
mandate.Add a warning to inform the user that an automatic selection is being
made.Signed-off-by : Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by : Ronald S. Bultje <rsbultje@gmail.com> -
lavfi/vf_ssim : add warning when color ranges differ
1er avril 2023, par Chema Gonzalezlavfi/vf_ssim : add warning when color ranges differ
The SSIM filter uses the pixel values without considering
the color ranges. This is incorrect. Patch adds a warning
so at least the user knows it.Let's see an example.
(1) Let's get FR and LR versions of the same image.
```
$ ffmpeg -y -i /tmp/lena.490x490.ppm -vf scale="out_range=full" -pix_fmt yuv420p /tmp/lena.full.y4m
$ xxd /tmp/lena.full.y4m |head
00000000 : 5955 5634 4d50 4547 3220 5734 3930 2048 YUV4MPEG2 W490 H
00000010 : 3439 3020 4632 353a 3120 4970 2041 303a 490 F25:1 Ip A0 :
00000020 : 3020 4334 3230 6a70 6567 2058 5953 4353 0 C420jpeg XYSCS
00000030 : 533d 3432 304a 5045 4720 5843 4f4c 4f52 S=420JPEG XCOLOR
00000040 : 5241 4e47 453d 4655 4c4c 0a46 5241 4d45 RANGE=FULL.FRAME
00000050 : 0a72 7271 7070 706f 6f6e 6d6d 6c6d 6d6d .rrqpppoonmmlmmm
00000060 : 6c6e 6e6d 6d6e 6e6e 6d6c 6d6d 6d6d 6d6d lnnmmnnnmlmmmmmm
00000070 : 6d6e 6d6b 6c6d 6e6e 6d6c 6d6d 6e6e 6f6f mnmklmnnmlmmnnoo
00000080 : 6f6f 6e6e 6e6e 6f70 7172 7375 7676 7370 oonnnnopqrsuvvsp
00000090 : 6d69 6662 5e59 534d 4845 3d35 302e 2d2c mifb^YSMHE=50.-,
``````
$ ffmpeg -y -i /tmp/lena.490x490.ppm -vf scale="out_range=limited" -pix_fmt yuv420p /tmp/lena.limited.y4m
$ xxd /tmp/lena.limited.y4m | head
00000000 : 5955 5634 4d50 4547 3220 5734 3930 2048 YUV4MPEG2 W490 H
00000010 : 3439 3020 4632 353a 3120 4970 2041 303a 490 F25:1 Ip A0 :
00000020 : 3020 4334 3230 6a70 6567 2058 5953 4353 0 C420jpeg XYSCS
00000030 : 533d 3432 304a 5045 4720 5843 4f4c 4f52 S=420JPEG XCOLOR
00000040 : 5241 4e47 453d 4c49 4d49 5445 440a 4652 RANGE=LIMITED.FR
00000050 : 414d 450a 7272 7170 7070 6f6f 6e6e 6e6d AME.rrqpppoonnnm
00000060 : 6e6e 6e6d 6f6e 6e6e 6e6e 6e6e 6d6e 6e6e nnnmonnnnnnnmnnn
00000070 : 6e6e 6e6e 6f6e 6c6d 6e6f 6e6e 6d6e 6e6f nnnnonlmnonnmnno
00000080 : 6f6f 6f6f 6f6f 6f6f 6f6f 7071 7273 7576 oooooooooopqrsuv
00000090 : 7673 706e 6a68 6461 5c57 524e 4b44 3d39 vspnjhda\WRNKD=9
```Note that the 2x images are the same. Only difference is the range,
and the precision issues related to range conversion.(2) Let's calculate the SSIM score :
```
$ ./ffmpeg -filter_threads 1 -filter_complex_threads 1 -i /tmp/lena.full.y4m -i /tmp/lena.limited.y4m -lavfi "ssim" -f null -
...
[Parsed_ssim_0 @ 0x360ab00] SSIM Y:0.942347 (12.391801) U:0.995808 (23.776062) V:0.996104 (24.093747) All:0.960217 (14.003012)
```As we are comparing an image with itself, we expect "Y : 1" as the
luma SSIM. Issue here is that the SSIM filter just uses the pixel
values, ignoring the color ranges.Proposed solution is to add a warning.
```
$ ./ffmpeg -filter_threads 1 -filter_complex_threads 1 -i /tmp/foo.full.y4m -i /tmp/foo.limited.y4m -lavfi "ssim" -f null -
...
[Parsed_ssim_0 @ 0x3766280] master and reference frames use different color ranges (pc != tv)
...
[Parsed_ssim_0 @ 0x3766280] SSIM Y:0.000000 (0.000000) U:0.000000 (0.000000) V:0.000000 (0.000000) All:0.000000 (0.000000)
```Tested :
Ran fate.
```
$ make fate -j
...
TEST seek-lavf-ppmpipe
TEST seek-lavf-pgmpipe
TEST seek-lavf-mxf_opatom
```