Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (28)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Les images

    15 mai 2013

Sur d’autres sites (1646)

  • Split the video in 30 second equal parts in android using the Ffmpeg

    21 novembre 2019, par corgiwooer

    I am on a video editing project. In which I want to edit the video into 30 sec equal parts. Right now I am using the RangeSeekBar to get the starting and ending point which works perfectly fine. But now I want to split the video into equal parts but don’t know how to do it. This is what I tried

    private void executeCutVideoCommand(int startMs, int endMs) {
           File moviesDir = Environment.getExternalStoragePublicDirectory(
                   Environment.DIRECTORY_MOVIES
           );

           String filePrefix = "cut_video";
           String fileExtn = ".mp4";
           String yourRealPath = getPath(VideoCutterActivity.this, selectedVideoUri);
           File dest = new File(moviesDir, filePrefix + fileExtn);
           int fileNo = 0;
           while (dest.exists()) {
               fileNo++;
               dest = new File(moviesDir, filePrefix + fileNo + fileExtn);
           }

           filePath = dest.getAbsolutePath();
           String[] complexCommand = {"-ss", "" + startMs / 1000, "-y", "-i", yourRealPath, "-t", "" + (endMs - startMs) / 1000,"-vcodec", "mpeg4", "-b:v", "2097152", "-b:a", "48000", "-ac", "2", "-ar", "22050", filePath};

           execFFmpegBinary(complexCommand);
           MediaScannerConnection.scanFile(VideoCutterActivity.this,
                   new String[] { filePath },
                   null,
                   new MediaScannerConnection.OnScanCompletedListener() {

                       public void onScanCompleted(String path, Uri uri) {

                           Log.i("ExternalStorage", "Scanned " + path + ":");
                           Log.i("ExternalStorage", "-> uri=" + uri);
                       }
                   });


       }

       /**
        * Executing ffmpeg binary
        */
       private void execFFmpegBinary(final String[] command) {
           try {
               ffmpeg.execute(command, new ExecuteBinaryResponseHandler() {
                   @Override
                   public void onFailure(String s) {
                       Log.d(TAG, "FAILED with output : " + s);
                   }

                   @Override
                   public void onSuccess(String s) {
                       Log.d(TAG, "SUCCESS with output : " + s);
                           Intent intent = new Intent(VideoCutterActivity.this, PreviewActivity.class);
                           intent.putExtra(FILEPATH, filePath);
                           startActivity(intent);
                   }

                   @Override
                   public void onProgress(String s) {
                       progressDialog.setMessage("progress : " + s);
                   }

                   @Override
                   public void onStart() {
                       progressDialog.setMessage("Processing...");
                       progressDialog.show();
                   }

                   @Override
                   public void onFinish() {
                       progressDialog.dismiss();


                   }
               });
           } catch (FFmpegCommandAlreadyRunningException e) {
               // do nothing for now
           }
       }

    The above method takes the starting and the ending point and edits the video.

    I also tried to add for loop for this purpose but it didnt workout for me.

    cutVideo.setOnClickListener(new View.OnClickListener() {
               @Override
               public void onClick(View v) {

                   choice = 2;

                   if (selectedVideoUri != null) {
                       int start,end;
                       for (int i=0;i<=duration;i=i+30){
                           start=i;
                           end=start+30;
                           executeCutVideoCommand(start,end);

                       }
    //                    executeCutVideoCommand(rangeSeekBar.getSelectedMinValue().intValue() * 1000, rangeSeekBar.getSelectedMaxValue().intValue() * 1000);

                   } else
                       Snackbar.make(mainlayout, "Please upload a video", 4000).show();
               }
           });

    Please can anyone tell me how to do it. Help is much appreciated

  • Ffmpeg- Split video into 30 seconds parts in android

    22 novembre 2019, par Corgi Mogi

    I am working on a project. In which I want to split the video into 30 sec equal parts. If the video is 45 sec long than ideally in 30 and 15-sec parts. I already created a method which takes the starting and the ending point and run the Ffmpeg command to cut the video. This is what I created so far

      private void executeCutVideoCommand(int startMs, int endMs) {
           File moviesDir = Environment.getExternalStoragePublicDirectory(
                   Environment.DIRECTORY_MOVIES
           );

           String filePrefix = "cut_video";
           String fileExtn = ".mp4";
           String yourRealPath = getPath(VideoCutterActivity.this, selectedVideoUri);
           File dest = new File(moviesDir, filePrefix + fileExtn);
           int fileNo = 0;
           while (dest.exists()) {
               fileNo++;
               dest = new File(moviesDir, filePrefix + fileNo + fileExtn);
           }

           filePath = dest.getAbsolutePath();
           String[] complexCommand = {"-ss", "" + startMs / 1000, "-y", "-i", yourRealPath, "-t", "" + (endMs - startMs) / 1000,"-vcodec", "mpeg4", "-b:v", "2097152", "-b:a", "48000", "-ac", "2", "-ar", "22050", filePath};

           execFFmpegBinary(complexCommand);
           MediaScannerConnection.scanFile(VideoCutterActivity.this,
                   new String[] { filePath },
                   null,
                   new MediaScannerConnection.OnScanCompletedListener() {

                       public void onScanCompleted(String path, Uri uri) {

                           Log.i("ExternalStorage", "Scanned " + path + ":");
                           Log.i("ExternalStorage", "-> uri=" + uri);
                       }
                   });


       }

       /**
        * Executing ffmpeg binary
        */
       private void execFFmpegBinary(final String[] command) {
           try {
               ffmpeg.execute(command, new ExecuteBinaryResponseHandler() {
                   @Override
                   public void onFailure(String s) {
                       Log.d(TAG, "FAILED with output : " + s);
                   }

                   @Override
                   public void onSuccess(String s) {
                       Log.d(TAG, "SUCCESS with output : " + s);
                           Intent intent = new Intent(VideoCutterActivity.this, PreviewActivity.class);
                           intent.putExtra(FILEPATH, filePath);
                           startActivity(intent);
                   }

                   @Override
                   public void onProgress(String s) {
                       progressDialog.setMessage("progress : " + s);
                   }

                   @Override
                   public void onStart() {
                       progressDialog.setMessage("Processing...");
                       progressDialog.show();
                   }

                   @Override
                   public void onFinish() {
                       progressDialog.dismiss();


                   }
               });
           } catch (FFmpegCommandAlreadyRunningException e) {
               // do nothing for now
           }
       }

    i tried to add a loop in method Calling But than app crashes

       cutVideo.setOnClickListener(new View.OnClickListener() {
               @Override
               public void onClick(View v) {

                   choice = 2;

                   if (selectedVideoUri != null) {
                       int start,end;
                       for (int i=0;i<=duration;i=i+30){
                           start=i;
                           end=start+30;
                           executeCutVideoCommand(start,end);

                       }
    //                    executeCutVideoCommand(rangeSeekBar.getSelectedMinValue().intValue() * 1000, rangeSeekBar.getSelectedMaxValue().intValue() * 1000);

                   } else
                       Snackbar.make(mainlayout, "Please upload a video", 4000).show();
               }
           });


       }

    I hope now you can what i want to do. I want to Ffmpeg command or method which split the video into 30-sec parts and place them on the given filepath. Let me know if we you wanna know more about the code. Help is much appreciated

  • YouTube's HD Video Streaming Server Technology ?

    30 septembre 2013, par bgentry

    Lately I've been researching different methods for streaming MP4s to the browser. Flash Media Server is an obvious choice here (using Cloudfront), and most solutions I've seen use the RTMP protocol.

    However, I spent some time on YouTube with Firebug and Chrome debugger figuring out how their streaming worked and I discovered some interesting differences between some of their videos and quality rates.

    My two sample videos are A and B. A is available up to 480p and B is available up to 1080p. For both videos, all rates up to 480p are served in an FLV container with H.264 video and AAC audio, over HTTP. What's interesting here is that if you have not yet downloaded (cached) the entire video, and you try to skip forward to an uncached part of the video, a new request will be made with a 'begin' parameter equal to the target offset in milliseconds. Example from Video A at 480p :

    http://v11.lscache8.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor%2Coc%3AU0dWTldQVF9FSkNNNl9PSlhJ&fexp=904806%2C902906%2C903711&algorithm=throttle-factor&itag=35&ipbits=0&burst=40&sver=3&expire=1279756800&key=yt1&signature=D2D704D63C242CF187CAA5B5D5BAFB8DFACAC5FF.39180C01559C976717B651A7EB1D0C6249231EB7&factor=1.25&id=8568eb3135971f6f&begin=111863

    Response Headers:
    Cache-Control:public,max-age=23472
    Connection:close
    Content-Length:14320637
    Content-Type:video/x-flv
    Date:Wed, 21 Jul 2010 17:23:48 GMT
    Expires:Wed, 21 Jul 2010 23:55:00 GMT
    Last-Modified:Wed, 19 May 2010 12:31:41 GMT
    Server:gvs 1.0
    X-Content-Type-Options:nosniff

    The file returned by this URL is a fully valid FLV containing only the portion of the video after the requested offset.

    I did the same kind of test on the higher resolution versions of Video B. At 720p and 1080p, YouTube will return a video in an MP4 container, also with H.264 video and AAC audio. What's impressive to me is that their server takes the same type of offset for an MP4 video (via the 'begin' parameter) and returns a valid, streamable MP4 (moov atom at the front of the file with correct offsets) that also only includes the requested portion of the video.

    So, how does YouTube do this ? How do they generate the FLV or MP4 container on the fly with the correct headers and only the desired segment of the requested video ? I know this can be accomplished using FFMPEG to seek to the desired start point and the qt-faststart script to reposition the moov atom to the front of the stream, but it seems like this would be too slow to handle on-demand for millions of YouTube viewers.

    Ideas ?

    Thanks in advance !

    Footnote : I am not allowed to include more than 1 link at this point, so here is Video A's URL : http:// www.youtube .com/watch ?v=hWjrMTWXH28 "Video available up to 480p"