Recherche avancée

Médias (91)

Autres articles (100)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (12793)

  • How to add watermark while record video using ffmpeg

    7 décembre 2017, par Hitesh Gehlot

    I am recording square video using following ffmpeg library. Square Video recorded successfully with audio but now i want to add watermark on video but my application crashed and getting error. Please help me how can i add watermark while record video.

    Gradle dependency

    compile(group: 'org.bytedeco', name: 'javacv-platform', version: '1.3') {
       exclude group: 'org.bytedeco.javacpp-presets'
    }
    compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3'
    compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '3.2.1-1.3', classifier: 'android-arm'

    I am using following code for add watermark while record video

        // add water mark
               String imgPath = audioPath + "jodelicon.png";
               String watermark = "movie=" + imgPath + " [logo];[in][logo]overlay=0:0:1:format=rgb [out]";
               filters.add(watermark);

    Complete Code

    class VideoRecordThread extends Thread {

           private boolean isRunning;

           @Override
           public void run() {
               List<string> filters = new ArrayList&lt;>();
               // Transpose
               String transpose = null;
               android.hardware.Camera.CameraInfo info =
                       new android.hardware.Camera.CameraInfo();
               android.hardware.Camera.getCameraInfo(mCameraId, info);
               if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
                   switch (info.orientation) {
                       case 270:
    //                        transpose = "transpose=clock_flip"; // Same as preview display
                           transpose = "transpose=cclock"; // Mirrored horizontally as preview display
                           break;
                       case 90:
    //                        transpose = "transpose=cclock_flip"; // Same as preview display
                           transpose = "transpose=clock"; // Mirrored horizontally as preview display
                           break;
                   }
               } else {
                   switch (info.orientation) {
                       case 270:
                           transpose = "transpose=cclock";
                           break;
                       case 90:
                           transpose = "transpose=clock";
                           break;
                   }
               }
               if (transpose != null) {
                   filters.add(transpose);
               }
               // Crop (only vertically)
               int width = previewHeight;
               int height = width * videoHeight / videoWidth;
               String crop = String.format("crop=%d:%d:%d:%d",
                       width, height,
                       (previewHeight - width) / 2, (previewWidth - height) / 2);

               filters.add(crop);
               // Scale (to designated size)

               String scale = String.format("scale=%d:%d", videoHeight, videoWidth);
               filters.add(scale);

               // add water mark
               String imgPath = audioPath + "jodelicon.png";
               String watermark = "movie=" + imgPath + " [logo];[in][logo]overlay=0:0:1:format=rgb [out]";
               filters.add(watermark);

               FFmpegFrameFilter frameFilter = new FFmpegFrameFilter(TextUtils.join(",", filters),
                       previewWidth, previewHeight);
               frameFilter.setPixelFormat(avutil.AV_PIX_FMT_NV21);
               frameFilter.setFrameRate(frameRate);
               try {
                   frameFilter.start();
               } catch (FrameFilter.Exception e) {
                   e.printStackTrace();
               }

               isRunning = true;
               FrameToRecord recordedFrame;

               while (isRunning || !mFrameToRecordQueue.isEmpty()) {
                   try {
                       recordedFrame = mFrameToRecordQueue.take();
                   } catch (InterruptedException ie) {
                       ie.printStackTrace();
                       try {
                           frameFilter.stop();
                       } catch (FrameFilter.Exception e) {
                           e.printStackTrace();
                       }
                       break;
                   }

                   if (mFrameRecorder != null) {
                       long timestamp = recordedFrame.getTimestamp();
                       if (timestamp > mFrameRecorder.getTimestamp()) {
                           mFrameRecorder.setTimestamp(timestamp);
                       }
                       long startTime = System.currentTimeMillis();
    //                    Frame filteredFrame = recordedFrame.getFrame();
                       Frame filteredFrame = null;
                       try {
                           frameFilter.push(recordedFrame.getFrame());
                           filteredFrame = frameFilter.pull();
                       } catch (FrameFilter.Exception e) {
                           e.printStackTrace();
                       }
                       try {
                           mFrameRecorder.record(filteredFrame);
                       } catch (FFmpegFrameRecorder.Exception e) {
                           e.printStackTrace();
                       }
                       long endTime = System.currentTimeMillis();
                       long processTime = endTime - startTime;
                       mTotalProcessFrameTime += processTime;
                       Log.d(LOG_TAG, "This frame process time: " + processTime + "ms");
                       long totalAvg = mTotalProcessFrameTime / ++mFrameRecordedCount;
                       Log.d(LOG_TAG, "Avg frame process time: " + totalAvg + "ms");
                   }
                   Log.d(LOG_TAG, mFrameRecordedCount + " / " + mFrameToRecordCount);
                   mRecycledFrameQueue.offer(recordedFrame);
               }
           }

           public void stopRunning() {
               this.isRunning = false;
               if (getState() == WAITING) {
                   interrupt();
               }
           }

           public boolean isRunning() {
               return isRunning;
           }
       }
    </string>

    Error in logcat

    android A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x18 in tid 320 (Thread-24542)
  • FFmpeg output image distorted occasionally

    7 août 2021, par srelliott

    I'm using FFmpeg to export a poster image, but occasionally it exports an image that has different dimensions than the video. I basically end up with a nearly square poster image (distorted), but a video that plays at the correct dimensions. The particular issue I'm noticing it on is with a source video that's a .mov file with yuv422p. I'm converting all videos to .mp4 (yuv420p) in a different command.

    &#xA;

    My image output command is :

    &#xA;

    ffmpeg -ss 3 -i sourceVideo.mov -f image2 -vframes 1 -pix_fmt yuv420p -vf scale=720:-2 outputImage.jpg&#xA;

    &#xA;

    The log for this particular source video shows this :

    &#xA;

    Stream #0:0(eng): Video: dvvideo (dvh3 / 0x33687664), yuv422p(progressive), 1280x1080 [SAR 3:2 DAR 16:9], 115084 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 29.97 tbc (default)

    &#xA;

    When the image is generated, the resulting distorted image is 720x608. It seems the image is being exported based on the Sample Aspect Ratio (SAR) instead of the Display Aspect Ratio (DAR). I expect it to export at something more like 720x405. If manually resized to 720x405, it looks fine.

    &#xA;

    The image output log shows :

    &#xA;

    Stream #0:0(eng): Video: mjpeg, yuvj420p(pc), 720x608 [SAR 608:405 DAR 16:9], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc (default)

    &#xA;

    ADDITIONAL INFO

    &#xA;

    When the .mp4 video is exported (separately through a different command), the video is displaying in the html5 player at something more like 1280x720 (which matches the DAR) and looks just fine.

    &#xA;

    Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(bottom coded first (swapped)), 1280x1080 [SAR 3:2 DAR 16:9], q=-1--1, 0.03 fps, 30k tbn, 29.97 tbc (default)

    &#xA;

    **If the distorted image is opened in Photoshop, it throws an alert about pixel aspect ratio correction, then adjusts it to display the image correctly.

    &#xA;

  • How to correct faulty aspect ratio with FFMPEG when encoded in both stream and container

    14 mai, par Kurt Fitzner

    I have a video that I converted from the original in a way that seems to have poisoned the aspect ratio. The intended aspect ratio is 12:5 (2.4.:1) at 1920x800 with square pixels, but the cuda scale seems to have adjusted the storage aspect ratio.

    &#xA;

    The video was created with :

    &#xA;

    ffmpeg -analyzeduration 1000000000 -probesize 100G -loglevel warning -stats -hwaccel cuda \&#xA;  -hwaccel_output_format cuda -y -i "UHDSOURCE.mkv" -map 0:v? -c:v hevc_nvenc \&#xA;  -preset p7 -2pass true -multipass fullres -rc vbr -rc-lookahead 55 -b:v 1000k -minrate 0 -maxrate 3000k \&#xA;  -bufsize 120000k -vf crop=3840:1600:0:280,scale_cuda=1920:800 -metadata title="HDDEST" \&#xA;  -map 0:a:2 -c:a:0 aac -b:a:0 160k -map 0:a:4 -c:a:1 aac -b:a:1 96k \&#xA;  -map 0:s? -c:s copy -map_metadata 0 "HDDEST.mkv"&#xA;

    &#xA;

    The original was 16:9 letterboxed, and the above command seems to have decided the SAR should reflect that. The result is a video with :

    &#xA;

    Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x800 [SAR 20:27 DAR 16:9], SAR 27:20 DAR 81:25, 23.98 fps, 23.98 tbr, 1k tbn (default)&#xA;

    &#xA;

    I can get halfway to fixing this with :

    &#xA;

    ffmpeg -i HDDEST.mkv -aspect 12:5 -c copy HDDEST_ASPECT.mkv&#xA;

    &#xA;

    But the resultant video still shows two different SAR and DARs. Some players use one, some players insist on the 16:9, though :

    &#xA;

    Stream #0:0[0x1](eng): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x800 [SAR 20:27 DAR 16:9], 1072 kb/s, SAR 1:1 DAR 12:5, 23.98 fps, 23.98 tbr, 16k tbn, Start 0.021000 (default)&#xA;

    &#xA;

    Q1 : What are the two aspect ratio displays ? I think one of them is the file globally and one of them is the stream, but can get no clear answer

    &#xA;

    Q2 : How to correct this without re-encoding ? The disc this came from was damaged when my burner was knocked off the table.

    &#xA;