Recherche avancée

Médias (3)

Mot : - Tags -/image

Autres articles (25)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • D’autres logiciels intéressants

    12 avril 2011, par

    On ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
    La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
    On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
    Videopress
    Site Internet : (...)

Sur d’autres sites (5117)

  • google speech to text errors out (grpc invalid deadline NaN)

    15 décembre 2019, par jamescharlesworth

    I have a ffmpeg script that cuts an audio file into a short 5 second clip, however after I cut the file, calling the google speech recognize command errors out.

    Creating a clip - full code link :

    const uri = 'http://traffic.libsyn.com/joeroganexp/p1400.mp3?dest-id=19997';
    const command = ffmpeg(got.stream(uri));
    command
     .seek(0)
     .duration(5)
     .audioBitrate(128)
     .format('mp3')
    ...

    which works fine and creates ./clip2.mp3.

    I then take that file and upload it to speech to text api and it times out (script here. When I put timeout and maxRetries argument I can get the actual error :

    Error: 2 UNKNOWN: Getting metadata from plugin failed with error: Deadline is too far in the future
       at Object.callErrorFromStatus (/Users/jamescharlesworth/Downloads/demo/node_modules/@grpc/grpc-js/build/src/call.js:30:26)
       at Http2CallStream.<anonymous> (/Users/jamescharlesworth/Downloads/demo/node_modules/@grpc/grpc-js/build/src/client.js:96:33)
       at Http2CallStream.emit (events.js:215:7)
       at /Users/jamescharlesworth/Downloads/demo/node_modules/@grpc/grpc-js/build/src/call-stream.js:98:22
       at processTicksAndRejections (internal/process/task_queues.js:75:11) {
     code: 2,
     details: 'Getting metadata from plugin failed with error: Deadline is too far in the future',
     metadata: Metadata { internalRepr: Map {}, options: {} },
     note: 'Exception occurred in retry method that was not classified as transient'
    }
    </anonymous>

    Stepping through the grpc code i see that the deadline is an invalid date.
    enter image description here
    This seems to be causing the issue but i assume it may be from incorrect params passed into the speech client.recognize() method.

    A few other things to note :

    • The script works for some audio files, not all
    • I can upload the broken my clip mp3 clip2.mp3 to the demo app here and it works fine.
    • If I change the seek command of my ffmpeg script to start at 0.01 speech recognize command will work (however it breaks other audio clips as its not the correct starting point). I notice that when i do this the png of the mp3 gets stripped out and is a much smaller file size
  • 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;

  • Converting video to GIF in Android Studio

    21 novembre 2019, par Wolfiebae

    I am trying to make my app to accept videos from the phone’s library to be uploaded and converted into GIF format. My code is giving out this build error though :-

    error: <anonymous> is not abstract and does not override abstract method onReschedule(String,ErrorInfo) in UploadCallback
    </anonymous>

    and also this warning on my onActivityResult method :-

    Overriding method should call super.onActivityResult

    The code is as below : -

    public class Video2gif extends AppCompatActivity {

       private Button uploadBtn;
       private ProgressBar progressBar;
       private int SELECT_VIDEO = 2;
       private ImageView img1;
       private DownloadManager downloadManager;
       private Button download_btn;
       private String gifUrl;

       @Override
       protected void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.activity_video2gif);
           MediaManager.init(this);

           progressBar = findViewById(R.id.progress_bar);
           MediaManager.init(this);
           img1 = findViewById(R.id.img1);
           uploadBtn = findViewById(R.id.uploadBtn);

           uploadBtn.setOnClickListener(new View.OnClickListener() {
               @Override
               public void onClick(View view) {
                   pickVideoFromGallery();

               }
               private void pickVideoFromGallery() {
                   Intent GalleryIntent = new Intent();
                   GalleryIntent.setType("video/*");
                   GalleryIntent.setAction(Intent.ACTION_GET_CONTENT);
                   startActivityForResult(Intent.createChooser(GalleryIntent,
                           "select video"), SELECT_VIDEO);
               }
           });
       }
       @Override
       protected void onActivityResult(int requestCode, int resultCode, final Intent data) {

           if (requestCode == SELECT_VIDEO &amp;&amp; resultCode == RESULT_OK) {
               Uri selectedVideo = data.getData();
               MediaManager.get()
                       .upload(selectedVideo)
                       .unsigned("myid")
                       .option("resource_type", "video")
                       .callback(new UploadCallback(){
                           @Override
                           public void onStart(String requestId) {
                               progressBar.setVisibility(View.VISIBLE);
                               Toast.makeText(Video2gif.this,
                                       "Upload Started...", Toast.LENGTH_SHORT).show();
                           }

                           public void onProgress() {
                           }

                           public void onSuccess(String requestId, Map resultData) {

                               Toast.makeText(Video2gif.this, "Uploaded Succesfully",
                                       Toast.LENGTH_SHORT).show();
                               progressBar.setVisibility(View.GONE);
                               uploadBtn.setVisibility(View.INVISIBLE);

                               String publicId = resultData.get("public_id").toString();

                               gifUrl = MediaManager.get().url().resourceType("video")
                                       .transformation(new Transformation().videoSampling("25")
                                               .delay("200").height(200).effect("loop:10").crop("scale"))
                                       .resourceType("video").generate(publicId+".gif");

                               Glide.with(getApplicationContext()).asGif().load(gifUrl).into(img1);
                               download_btn.setVisibility(View.VISIBLE);

                           }
                           public void onError(String requestId, ErrorInfo error) {
                               Toast.makeText(Video2gif.this,
                                       "Upload Error", Toast.LENGTH_SHORT).show();
                               Log.v("ERROR!!", error.getDescription());
                           }


           });
       }
    }

    }

    I am also using Cloudinary to help process the video to GIF. Any help would be appreciated, many thanks !