Recherche avancée

Médias (1)

Mot : - Tags -/framasoft

Autres articles (42)

  • 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

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

Sur d’autres sites (6899)

  • Video Encoding issue

    6 octobre 2014, par pbellema

    I’m making an app that records small videos and concatenates them together (like Vine).
    If I record a video without concatenation there are no problems.
    But if I assemble recordings, two problems appear : records disappear or they are cut out.

    When I start to record :

    private boolean prepareVideoRecorder(){
       if (mCamera != null) {
           mMediaRecorder = new MediaRecorder();

           Camera.Parameters p = mCamera.getParameters();

           CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_480P);

           // Step 1: Unlock and set camera to MediaRecorder
           mCamera.unlock();
           mMediaRecorder.setCamera(mCamera);

          //mMediaRecorder.setOrientationHint(90);

           Log.i("MY_LOG", "set preview display");


           mMediaRecorder.setMaxDuration(8000);

           // Step 2: Set sources
           mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
           mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);

           // Step 3: Set a CamcorderProfile (requires API Level 8 or higher)
           mMediaRecorder.setProfile(profile);




           mMediaRecorder.setVideoSize(profile.videoFrameWidth,profile.videoFrameHeight);

           // Step 4: Set output file
           mMediaRecorder.setOutputFile(getOutputMediaFile().toString());

           if (mFrontCamera) {

               mMediaRecorder.setPreviewDisplay(mFrontPreview.getHolder().getSurface());
           } else {
               mMediaRecorder.setPreviewDisplay(mBackPreview.getHolder().getSurface());
           }

           // Step 6: Prepare configured MediaRecorder
           try {
               mMediaRecorder.prepare();
           } catch (IllegalStateException e) {
               Log.d("MY_LOG", "IllegalStateException preparing MediaRecorder: " + e.getMessage());
               releaseMediaRecorder();
               return false;
           } catch (IOException e) {
               Log.d("MY_LOG", "IOException preparing MediaRecorder: " + e.getMessage());
               releaseMediaRecorder();
               return false;
           }
           return true;
       } else {
           Log.i("MY_LOG", "camera null");
           return false;
       }

    And when I stop :

    private void stopRecording(boolean forcedStop) {
       mRecording = false;
       try {
           mMediaRecorder.stop();
           releaseMediaRecorder();
           mCamera.lock();
           rotateVideo(mPaths.size() - 1, mFrontCamera);
          if (forcedStop) manageVideos(forcedStop);
       } catch (RuntimeException e) {
           Log.i("MY_LOG", "Exception" + e.toString());
       }
    }

    and when I finish, those are my concatenation functions :

    private void manageVideos(boolean forcedStop) {
       if (mPaths.size() > 1 || forcedStop) {
           String mediaStorageDirPath = Helper.getMediaStorageDirPath();
           String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
           final String path = mediaStorageDirPath + File.separator +
                   "APPEND_"+ timeStamp + ".mp4";

           finalVideo = path;
           ffmpegAppend(path);
       } else {
           finalVideo = mPaths.get(0);
           if (!isProcessingFFmpeg) {
               goToSubtitleFragment(finalVideo);
           }
       }
    }

    private void ffmpegAppend(String path) {
       String mediaStorageDirPath = Helper.getMediaStorageDirPath();
       String filePath = mediaStorageDirPath + File.separator + "append.txt";

       try {
           File f = new File(filePath);

           OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(f));
           BufferedWriter writer = new BufferedWriter(out);

           for (int i = 0; i < mPaths.size(); i++) {
               writer.write("file '" + mPaths.get(i) + "'");
               writer.newLine();
           }

           writer.close();

           String cmd = "ffmpeg -f concat -i " + filePath + " -c copy " + path;

           mCmd.add(cmd);

           manageCommands();

       } catch (Exception e) {

       }
    }

    private void manageCommands() {
       if (!isProcessingFFmpeg && mCmd.size() > 0) {
           new FFmpegTask().execute(mCmd.get(0));
       }
    }

    private class FFmpegTask extends AsyncTask {
       protected Integer doInBackground(String... cmd) {
           isProcessingFFmpeg = true;
           int fileCount = cmd.length;

           Processor p = new Processor(Helper.getEncodingLibraryPath(getActivity()), getActivity());

           for (String c : cmd) {
               String[] strArr = c.split(" ");
               p.process(strArr);
           }

           return fileCount;
       }

       protected void onProgressUpdate(Integer... progress) {

       }

       protected void onPostExecute(Integer result) {
           StackTraceElement[] ste = Thread.currentThread().getStackTrace();
           isProcessingFFmpeg = false;
           if (mCmd.size() > 0) {
               mCmd.remove(0);
           }
           if (mCmd.size() > 0) {
               new FFmpegTask().execute(mCmd.get(0));
           } else if (isFinished) {
               goToSubtitleFragment(finalVideo);
           }
       }
    }

    Do you see where the problems might be coming from ?
    Thanks to you.

  • Revision b0c146eea9 : [svc] 1. Add two pass RC options in vp9_spatial_scalable_encoder. 2. Add r

    28 février 2014, par Minghai Shang

    Changed Paths :
     Modify /examples.mk


     Modify /examples/vp9_spatial_scalable_encoder.c


     Modify /vpx/exports_enc


     Modify /vpx/src/svc_encodeframe.c


     Modify /vpx/svc_context.h



    [svc] 1. Add two pass RC options in vp9_spatial_scalable_encoder.
    2. Add read/write for RC stats file
    The two pass RC for svc does not work yet. This is just the first
    step. We need further development to make it working.
    Change-Id : I8ef0e177dff0b5ed3c97a916beea5123717cc6f2

  • ffmpeg - maintain video quality as I apply multi-pass workflow, each includes decoding and encoding again, in video editing

    27 septembre 2020, par QRrabbit

    I'm using FFMPEG libraries do do some video manipulation, and due to complexity of filters and image overlaying, I have to run the process in multiple passes.
This means, my process is as such :
Open original video, decode it, run -complex_filter, recompress the video in whichever format the original video was encoded.
Open the output from the first pass, run another -complex_filter, etc-etc.
Sometimes I have to do the above 3-4 times. My concern is that the video, with every compression is losing quality - obvious signs of that is the file is shrinking in size with every pass.

    


    With the above, I have two questions :

    


      

    1. Would it make sense to, after first manipulation, instead of saving the video in its original format, I chose some format that is lossless, and then perform my passes one after the other, knowing that the quality remains the same, then on the final pass I recompress one-time into the format of the source. If so, what format of a video would you recommend ? ProRes 4444 ? Any other formats I shell consider ? Any parameters I should set and carry-over from encoding to encoding ?

      


    2. 


    3. With every step I carry over all extra streams of audio and other meta data.
Wouldn't it be more efficient to strip everything except the video, run my video passages over and over and not to need for adding -c:a copy and c:s copy ? Then on my final run, merge all streams from the original source to the output file ? If yes, how will I carry the ffmpeg command specifically ? I have a video that has 1 video stream + 15 audio streams + some extra tmcd which my ffmpeg cannot read.

      


    4. 


    


    Thank you.

    


    Edit 1 :

    


    if the input video has a video codec = dvvideo, and if dimensions of the video is 1280x1080, that means the video doesn't have a typical square pixels.
I first need to resize the video, in doing so I scale the video up. Then I can run my filters :

    


    pass-1 : -vf scale=1920x1080 (this step is skipped if the video is of a normal x to y ratio)
pass-2 : -filter_complex : which calls my special filter that adds some proprietary watermark to a video
pass-3 : -filter_complex : "0overlay=5:21:enable='between(t,2,3)+between(t,4,5)+between(t,6,8)'" (sole objective is to inserts an icon.png at a location near where the watermark was placed in previous step.)
pass-4 : -vf scale=1280x1080 (this step scales the video back, if pass-1 was executed)

    


    I could probably rewrite my 'C' filter code at some point in the future to accommodate this logic of checking for 1280x1080, as well as inserting this icon.png, and do it all in one step, but for right now, I thought just using 2-step process if a normal video, or a 4 passes if needs scaling, and utilize something of a lossless format as a temp file solution (I arbitrary chose ProRes 4444 v5, but open to suggestions), should minimize the losses during recompression to the video.

    


    Steps 1 and 4 are conditional, and only applicable if :&#xA;if vcodec == 'dvvideo' and aspect_ratio < 1.2 : # 1280x1080 ratio has about 1.16&#xA;I run steps 1->4. Otherwise only steps 2 & 3 :

    &#xA;

    Step1 :

    &#xA;

    ffmpeg -i in.mov -vf scale=1920x1080 -map 0:v? -map 0:a? -map 0:s? -map_metadata 0 -b:v 115084915 -maxrate 115084915 -minrate 115084915 -c:v prores_ks -profile:v 5 -preset ultrafast -crf 0 -c:a copy -timecode 00:00:00.00 -c:s copy -y step2.mov&#xA;

    &#xA;

    Step2 :

    &#xA;

    ffmpeg -i step2.mov -filter_complex " myFilter=enable=&#x27;between(t,0,30)&#x27;:x=15:y=25:size=95:etc-etc..." -map 0:v? -map 0:a? -map 0:s? -map_metadata 0 -b:v 115084915 -maxrate 115084915 -minrate 115084915 -c:v prores_ks -profile:v 5 -preset ultrafast -crf 0 -c:a copy -timecode 00:00:00.00 -c:s copy -y step3.mov&#xA;

    &#xA;

    Step3 :

    &#xA;

    ffmpeg -i step3.mov -i icon.png -filter_complex "[0][1]overlay=15:20:enable=&#x27;between(t,1,3.600)&#x2B;between(t,4,5.500)&#x2B;between(t,6,20)&#x27; " -map 0:v? -map 0:a? -map 0:s? -map_metadata 0 -b:v 115084915 -maxrate 115084915 -minrate 115084915 -c:v prores_ks -profile:v 5 -preset ultrafast -crf 0 -c:a copy -timecode 00:00:00.00 -c:s copy -y step4.mov&#xA;

    &#xA;

    Step4 :

    &#xA;

    ffmpeg -i step4.mov -map 0:v? -vf scale=1280x1080 -map 0:a? -map 0:s? -c:v dvvideo -pix_fmt yuv422p -b:v 115084915 -maxrate 115084915 -minrate 115084915 -r 29.97 -top 1 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -vtag dvh6 -map_metadata 0 -c:a copy -timecode 00:00:00.00 -c:s copy -y final-output.mov&#xA;

    &#xA;

    Since I post my entire set of ffmpeg commands, maybe someone could recommend how to make my output match input so that I don't lose timecode entry :input is on the left panel, my output is on the right

    &#xA;