Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Autres articles (32)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (3152)

  • ffmpeg progress percentage in php

    9 avril 2018, par Mr.ZZ

    ffmpeg.php

    $sCmd = "ffmpeg -i ".$image." -i ".$music." video.avi 1> progress.txt";
    $proc = popen($sCmd." 2>&1", "r");

    progress.php

    $content = @file_get_contents('progress.txt');
    if($content){
       preg_match("/Duration: (.*?), start:/", $content, $matches);
       $rawDuration = $matches[1];
       $ar = array_reverse(explode(":", $rawDuration));
       $duration = floatval($ar[0]);
       if (!empty($ar[1])) $duration += intval($ar[1]) * 60;
       if (!empty($ar[2])) $duration += intval($ar[2]) * 60 * 60;
       preg_match_all("/time=(.*?) bitrate/", $content, $matches);
       $rawTime = array_pop($matches);
       if (is_array($rawTime)){$rawTime = array_pop($rawTime);}
       $ar = array_reverse(explode(":", $rawTime));
       $time = floatval($ar[0]);
       if (!empty($ar[1])) $time += intval($ar[1]) * 60;
       if (!empty($ar[2])) $time += intval($ar[2]) * 60 * 60;
       $progress = round(($time/$duration) * 100);
       echo $progress;
    }

    progress.php final output was always 100, so it was easy with jquery to hide progress and show download button.

    BUT after changing ffmpeg.php with this command :

    $sCmd = "ffmpeg -loop 1 -r 1 -i ".$image." -i ".$music." -c:a copy -shortest video.avi 1> progress.txt";
    $proc = popen($sCmd." 2>&1", "r");

    progress.php output is different numbers above 100(thousands) and jquery can’t figure out ffmpeg process finished or not.

    How to get 100 when ffmpeg finishs working ? I think i need some changes in progress.php because final result in progress.txt is longer than before.

  • From jpg to animated gif

    12 mai 2016, par lleoun

    I’m desperate, I need to convert some jpg images into an animated gif.

    I’ve tried ffmpeg, but the result has a terrible quality.

    Also tried imagemagick, and the result looks great but it weights 511 KB !!

    Anyone please can tell me what to use or how to use the before applications to get a final animated gif with a normal quality and a normal weight for a gif ??

    As I said I’m desperate, I need to finish this asap :(

    Thanks a lot

  • Using JavaCV/FFMPEG to push byte buffer image via RTMP

    6 mai 2022, par ljnoah

    I have a USB camera that returns frames as a byte buffer type to which I would like to push/send via rtmp using JavaCV library to be viewed using VLC. According to this link : http://bytedeco.org/javacpp-presets/ffmpeg/apidocs/org/bytedeco/ffmpeg/ffmpeg.html. It should be possible, but I don't really have any experience with ffmpeg, but from what I've read in their github it should be possible, only, thus far I was not able to find an example on how to do it. Basically, I would like to store a byte buffer and send an image that is in variable instead of grabbing frames from a camera as my USB camera is not detected by android and needs external libraries to work.

    


    private byte[] FrameData = new byte[384 * 288 * 4];
  //private final Bitmap bitmap = Bitmap.createBitmap(PREVIEW_WIDTH, PREVIEW_HEIGHT, // Bitmap.Config.ARGB_8888); // creates a bitmap with the proper format in-case its needed
  private final IFrameCallback mIFrameCallback = new IFrameCallback() {
      @Override
      public void onFrame(final ByteBuffer frameData) {
          frameData.clear();
          frameData.get(FrameData, 0, frameData.capacity());
          }
  };


    


    This callback gives me the frames from my camera on the fly and writes it to FrameData, which I can compress to a bitmap if needed.

    


    My camera preview where I call the callback above :

    


      public void handleStartPreview(Object surface) {
      if ((mUVCCamera == null)) return;
      try {
          mUVCCamera.setPreviewSize(mWidth, mHeight, 1, 26, UVCCamera.DEFAULT_PREVIEW_MODE, UVCCamera.DEFAULT_BANDWIDTH, 0);
      } catch (IllegalArgumentException e) {
          try {
              mUVCCamera.setPreviewSize(mWidth, mHeight, 1, 26, UVCCamera.DEFAULT_PREVIEW_MODE, UVCCamera.DEFAULT_BANDWIDTH, 0);
              Log.e(TAG, "handleStartPreview4");
          } catch (IllegalArgumentException e1) {
              callOnError(e1);
              return;
          }
      }
      int result = mUVCCamera.startPreview();
      mUVCCamera.setFrameCallback(mIFrameCallback, UVCCamera.PIXEL_FORMAT_RGBX);
      mUVCCamera.startCapture();
      startRecording();
  }


    


    My question is How can I use this example :

    


     String ffmpeg = Loader.load(org.bytedeco.ffmpeg.ffmpeg.class);
 ProcessBuilder pb = new ProcessBuilder(ffmpeg, "-i", "/path/to/input.mp4", "-vcodec", "h264", "/path/to/output.mp4");
 pb.inheritIO().start().waitFor();


    


    to push my frames from the camera that are stored FrameData byte buffer via RTMP/RTSP to my server IP, even If I need to compress it to a bitmap before...