Recherche avancée

Médias (1)

Mot : - Tags -/sintel

Autres articles (46)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Contribute to documentation

    13 avril 2011

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

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

Sur d’autres sites (7421)

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

    


  • Save image while face detection

    13 octobre 2017, par hidura

    Hello I’ve this app that save an image for everytime my face move something similar to the IG stories my problem is that the cellphone get very slow and the app close suddenly because of allocation memory problems I want to know how i can do this without slowing down the cellphone and dont receive the error of closing.

    The next code open the svg :

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    private static Bitmap getBitmap(VectorDrawable vectorDrawable) {
       Bitmap bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(),
               vectorDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
       Canvas canvas = new Canvas(bitmap);
       vectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
       vectorDrawable.draw(canvas);
       Log.e("", "getBitmap: 1");
       return bitmap;
    }

    private static Bitmap getBitmap(Context context, int drawableId) {
       Log.e("", "getBitmap: 2");
       Drawable drawable = ContextCompat.getDrawable(context, drawableId);
       if (drawable instanceof BitmapDrawable) {
           return BitmapFactory.decodeResource(context.getResources(), drawableId);
       } else if (drawable instanceof VectorDrawable) {
           return getBitmap((VectorDrawable) drawable);
       } else {
           throw new IllegalArgumentException("unsupported drawable type");
       }
    }

    The next one draw the svg below the position of the face.

       /**
        * Draws the face annotations for position on the supplied canvas.
        */
       @Override
       public void draw(Canvas canvas) {
           Face face = mFace;
           if (face == null) {
               return;
           }

           // Draws a circle at the position of the detected face, with the face's track id below.
           float x = translateX(face.getPosition().x + face.getWidth() / 2);
           float y = translateY(face.getPosition().y + face.getHeight() / 2);
           canvas.drawCircle(x, y, FACE_POSITION_RADIUS, mFacePositionPaint);
           canvas.drawText("id: " + mFaceId, x + ID_X_OFFSET, y + ID_Y_OFFSET, mIdPaint);
           canvas.drawText("happiness: " + String.format("%.2f", face.getIsSmilingProbability()), x - ID_X_OFFSET, y - ID_Y_OFFSET, mIdPaint);
           canvas.drawText("right eye: " + String.format("%.2f", face.getIsRightEyeOpenProbability()), x + ID_X_OFFSET * 2, y + ID_Y_OFFSET * 2, mIdPaint);
           canvas.drawText("left eye: " + String.format("%.2f", face.getIsLeftEyeOpenProbability()), x - ID_X_OFFSET*2, y - ID_Y_OFFSET*2, mIdPaint);

           // Draws a bounding box around the face.
           float xOffset = scaleX(face.getWidth() / 2.0f);
           float yOffset = scaleY(face.getHeight() / 2.0f);
           float left = x - xOffset;
           float top = y - yOffset;
           float right = x + xOffset;
           float bottom = y + yOffset;
           //bitmap = BitmapFactory.decodeResource(getOverlay().getContext().getResources(), R.drawable.ic_shirt);

           bitmap = getBitmap(getOverlay().getContext(), R.drawable.ic_tshirt);
           float eyeX = left-400;
    //        for(Landmark l : face.getLandmarks()){
    //            if(l.getType() == Landmark.LEFT_EYE){
    //                eyeX = l.getPosition().x + bitmap.getWidth() / 2;
    //            }
    //        }

           tshirt = Bitmap.createScaledBitmap(bitmap, (int) scaleX(bitmap.getWidth() / 2),
                   (int) scaleY(bitmap.getHeight()/2), false);
           float top_shirt=(face.getPosition().y + face.getHeight())+200;
           canvas.drawBitmap(tshirt, eyeX, top_shirt, new Paint());


           Canvas myCanvas = new Canvas(tshirt);
           myCanvas.drawBitmap(tshirt, eyeX, top_shirt, new Paint());
           HashMap args = new HashMap<>();
       args.put("tshirt", tshirt);
       new saveImg(args).execute();
           //canvas.drawRect(left, top, right, bottom, mBoxPaint);
       }

    This one save the image on the cellphone.

       package com.google.android.gms.samples.vision.face.facetracker;

    import android.graphics.Bitmap;
    import android.os.AsyncTask;
    import android.os.Environment;

    import java.io.File;
    import java.io.FileOutputStream;
    import java.util.ArrayList;
    import java.util.HashMap;

    /**
    * Created by diegohidalgo on 10/12/17.
    */

    public class saveImg extends AsyncTask {
       Bitmap tshirt;
       String name;
       saveImg(HashMap args){
           tshirt = (Bitmap)args.get("tshirt");
           File file=new File(Environment.getExternalStorageDirectory() + "/facedetection/");
           File[] list = file.listFiles();
           int count = 0;
           for (File f: list){
               String name = f.getName();
               if (name.endsWith(".png"))
                   count++;

           }
           name="img"+count+".png";
       }

       @Override
       protected Void doInBackground(Void... args) {
           File file = new File(Environment.getExternalStorageDirectory() + "/facedetection/"+ name);

           try {
               tshirt.compress(Bitmap.CompressFormat.PNG, 100, new FileOutputStream(file));
           } catch (Exception e) {
               e.printStackTrace();

           }
           System.gc();
           tshirt.recycle();
           tshirt= null;
           return null;
       }

       protected void onPostExecute() {

       }
    }

    This is the mistake that give me before close the app.

    10-13 10:38:17.526
    8443-8443/com.google.android.gms.samples.vision.face.facetracker
    W/art : Throwing OutOfMemoryError "Failed to allocate a 8916492 byte
    allocation with 1111888 free bytes and 1085KB until OOM" 10-13
    10:38:18.020
    8443-8443/com.google.android.gms.samples.vision.face.facetracker
    I/Process : Sending signal. PID : 8443 SIG : 9

    thanks in advance.

  • Use data to develop impactful video content

    28 septembre 2021, par Ben Erskine — Analytics Tips, Plugins

    Creating impactful video content is at the heart of what you do. How you really engage with your audience, change behaviours and influence customers to complete your digital goals. But how do you create truly impactful marketing content ? By testing, trialling, analysing and ultimately tweaking and reacting to data-informed insights that gear your content to your audience (rather than simply producing great content and shooting arrows in the dark).

    Whether you want to know how many plays your video has, finish rates, how your video is consumed over time, how video was consumed on specific days or even which locations users are viewing your video content. Media Analytics will gather all of your video data in one place and provide answers to all of these questions (and much more).

    What is impactful video content ?

    Impactful video content grabs your audience’s attention, keeps their attention and promotes them to take measurable action. Be that time spent on your website, goal completion or brand engagement (including following, commenting or sharing on social). Maybe you’ve developed video content, had some really great results, but not consistently, nor every time and it can be difficult to identify what exactly it is that engages and entices each and every time. And we all want to find where that lovely sweet spot is for your audience.

    Embedded video on your website can be a marketing piece that talks about the benefits of your product. Or can be educational or informative that support the brand and overall impression of the brand. And at the very best entertaining at the same time. 

    84% of people say that they’ve been convinced to buy a product or service by watching a brand’s video. Building trust, knowledge and engagement are simply quicker with video. Viewers interact more, and are engaged longer with video, they are more likely to take in the message and trust what they are seeing through educational, informative or even entertaining video marketing content than solely through reading content on a website. And even better they take action, complete goals on your website and engage with your brand (potentially long term).

    It is not only necessary to have embedded video content on your website, it needs to deliver all the elements of a well functioning website, creating the very best user experience is essential to keeping your viewers engaged. This includes ensuring the video is quick to load, on-brand, expected (in format and tone) and easy to use and/or find. Ensuring that your video content is all of these things can mean that your website users will stick around longer on your website, spend more time exploring (and reading) your website and ultimately complete more of your goals. With a great user experience, your users, in turn, are more likely to come back again to your website and trust your brand. 

    All great reasons to create impactful video content that supports your website and brand ! And to analyse data around this behaviour to repeat (or better) the video content that really hits the mark.

    Let’s talk stats

    In terms of video marketing, there are stats to support that viewers retain 95% of a message when they view it in a video format. The psychology behind this should be fairly obvious. It is easier (and quicker) for humans to consume video and watch someone explain something than it is to read and take action. Simply look at the rise of YouTube for explanatory and instructional video content !

    And how about the 87% of marketers that report a positive ROI on using video in their marketing ? This number has steadily increased since 2015 and matches the increase in video views over the years. This should be enough to demonstrate that video marketing is the way forward, however it needs to be the right type of video to create impact and engagement.

    Do you need more reasons to consider honing and refining your video content for your audience ? And riding this wave of impactful video marketing success ?

    But, how do we do that ?

    So, how do you make content that consistently converts your audience to engaged customers ? The answer is in the numbers. The data. Collecting data on each and every piece of media that is produced and put out into the world. Measuring everything, from where it is viewed, how it is viewed, how much of it is viewed and what is your viewer’s action after the fact.

    While Vimeo and YouTube have their own video analytics they are each to their own, meaning a lot more work for you to combine and analyse your data before forming insights that are useful. 

    Your data is collected by external parties, and is owned and used by these platforms, for their own means. Using Web Analytics from Matomo to collect and collate media data can mean your robust data insights are all in one place. And you own the data, keeping your data private, clean and easy to digest. 

    Once your data is across a single platform, your time can be spent on analysing the data (rather than collating) and discovering those super valuable insights. Additionally, these insights can be collated and reported, in one place, and used to inform future digital and video marketing planning. Working with the data and alongside creative teams to produce video that talks to your audience in an impactful way.

    The more data that is collected the deeper the insights. Saving time and money across a single platform and with data-backed insights to inform decisions that can influence the time (and money) spent producing video content that truly hits the mark with your audience. No more wasted investment and firing into the dark without knowledge. 

    Interrogating the ideal length of your video media means it is more likely to be viewed to the end. Or understanding the play rate on your website of any video. How often is the video played ? And which is played more often ? Constant tweaking and updating of your video content planning can be informed by data-driven human-centric insights. By consistently tracking your media, analysing and forming insights you can build upon past work, and create a fuller picture of who your audience is and how they will engage with future video content. Understanding your media over time can lead to informed decisions that can impact the video content and the level of investment to deliver ROI that means something.

    Wrap Up

    Media Analytics puts you at the heart of video engagement. No more guessing at what your audience wants to see, how long or when. Make every piece of video content have the impact you want (and need) to drive engagement, goal completion and customer conversion. Create a user experience that keeps your users on your website for longer. Delivering on all of those delicious digital marketing goals and speaking the language of key stakeholders throughout the business. Back your digital marketing, with truly impactful content, and above all else deliver to your audience content that keeps them engaged and coming back for more.

    Don’t just take our word for it ! Take a look at what Matomo can offer you with streamlined and insightful Media Analytics, all in one place. And go forth and create impactful content, that matters.

    Next steps :

    Check out our detailed user guide to Media Analytics

    Or, if you have questions, see our helpful Video & Audio Analytics FAQ’s