Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (81)

  • 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 (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, 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 (...)

Sur d’autres sites (13273)

  • Impossible to redirect video stream after conversion (mkv to mp4)

    17 décembre 2019, par elgrusko

    I’m currently realising a school project which aims a streaming video website (like Netflix) using torrent-stream (with the magnet link). I am using NodeJS for the stream part.

    My problem is : I can’t redirect the stream to the HTML 5 player while i’m trying to stream and converting (with ffmpeg) video at the same time. I think it’s because I just can’t know what’s will be the final size of the converted file.
    In browser’s console I have this message : net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)

    I tried to put this in the header : Transfer-Encoding: chunked instead of Content-Length
    I specify that the stream (before conversion) works perfectly

    This is my code :

    getTorrentFile.then(function (file) {
                   res.setHeader('Content-Type', 'video/mp4');
                   res.setHeader('Content-Length', file.length);
                   const ranges = parseRange(file.length, '15' /* variable à comprendre */, { combine: true });
                   console.log(ranges);
                   if (ranges === -1) {
                       // 416 Requested Range Not Satisfiable
                       console.log('416')
                       res.statusCode = 416;
                       return res.end();
                   } else if (ranges === -2 || ranges.type !== 'bytes' || ranges.length > 1) {
                       // 200 OK requested range malformed or multiple ranges requested, stream ent'ire video
                       if (req.method !== 'GET') return res.end();
                       console.log('200')
                       stream = file.createReadStream()
                       ffmpeg(stream)
                       .videoCodec('libx264')
                       .audioCodec('aac')
                       .output(res)
                       .output('./video/' + film + '_s' + season + '_e' + episode + '.mp4')
                       .outputFormat('mp4')
                       .outputOptions('-movflags frag_keyframe+empty_moov')
                       .on('error', function(err) {
                           console.log('An error occurred: ' + err.message);
                       })
                       .on('progress', function(progress) {
                           console.log('Processing: ' + progress.targetSize + 'kb done');
                         })
                       .on('end', function() {
                           console.log('Processing finished !');
                       })
                       .addOutputOption('-acodec')
                       .run()

    Sorry if i’m not really clear, ask me some questions if you need more informations :)

    Thanks for your help, bye :)

  • Revision 33976 : bugs html

    27 décembre 2009, par cedric@… — Log

    bugs html

  • Unable to merge videos in Android using JavaCV ("Sample Description" Error)

    15 décembre 2015, par San

    I am creating a video from images via FFMPEG and I am able to get the video from images. I am also making use of JavaCV to merge two videos and I am able to join videos using JavaCV without any issues provided both the videos are taken via camera, i.e, a video actually recorded via mobile camera.

    Issue that I’m facing :

    I am not able to merge the video that was generated from FFMPEG using the images along with the video user has chosen which will mostly be a video that was not generated and taken via mobile camera.

    CODE :
    Code to generate Video via Images :

                     FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(path + "/" + "dec16.mp4", 800, 400);
                               try {
                                   recorder.setVideoCodec(avcodec.AV_CODEC_ID_MPEG4);
                                   //recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
                                   recorder.setVideoCodecName("H264");
                                   recorder.setVideoOption("preset", "ultrafast");
                                   recorder.setFormat("mp4");
                                   recorder.setFrameRate(frameRate);
                                   recorder.setVideoBitrate(60);
                                   recorder.setPixelFormat(avutil.AV_PIX_FMT_YUV420P);
                                   startTime = System.currentTimeMillis();
                                   recorder.start();
                                   for(int j=0;j recorder.getTimestamp()) {

                                           recorder.setTimestamp(t);
                                           recorder.record(image);
                                       }
                                   }
                                   recorder.stop();
                               } catch (Exception e) {
                                   e.printStackTrace();
                               }

    Code to merge Videos :

    int count = file_path.size();
               System.out.println("final_joined_list size " + file_path.size());
               if (file_path.size() != 1) {
                   try {
                       Movie[] inMovies = new Movie[count];
                       mediaStorageDir = new File(
                               Environment.getExternalStorageDirectory()
                                       + "/Pictures");

                       for (int i = 0; i < count; i++) {
                           File file = new File(file_path.get(i));
                           System.out.println("fileeeeeeeeeeeeeeee " + file);
                           System.out.println("file exists!!!!!!!!!!");

                           FileInputStream fis = new FileInputStream(file);
                           FileChannel fc = fis.getChannel();
                           inMovies[i] = MovieCreator.build(fc);
                           fis.close();
                           fc.close();

                       }
                       List<track> videoTracks = new LinkedList<track>();
                       List<track> audioTracks = new LinkedList<track>();
                       Log.d("Movies length", "isss  " + inMovies.length);
                       if (inMovies.length != 0) {

                           for (Movie m : inMovies) {

                               for (Track t : m.getTracks()) {
                                   if (t.getHandler().equals("soun")) {
                                       audioTracks.add(t);
                                   }
                                   if (t.getHandler().equals("vide")) {
                                       videoTracks.add(t);
                                   }
                                   if (t.getHandler().equals("")) {

                                   }
                               }

                           }
                       }

                       Movie result = new Movie();

                       System.out.println("audio and videoo tracks : "
                               + audioTracks.size() + " , " + videoTracks.size());
                       if (audioTracks.size() > 0) {
                           result.addTrack(new AppendTrack(audioTracks
                                   .toArray(new Track[audioTracks.size()])));
                       }
                       if (videoTracks.size() > 0) {
                           result.addTrack(new AppendTrack(videoTracks
                                   .toArray(new Track[videoTracks.size()])));
                       }
                       IsoFile out = null;
                       try {
                           out = (IsoFile) new DefaultMp4Builder().build(result);
                       } catch (Exception e) {
                           // TODO Auto-generated catch block
                           e.printStackTrace();
                       }

                       long timestamp = new Date().getTime();
                       String timestampS = "" + timestamp;

                       File storagePath = new File(mediaStorageDir
                               + File.separator);
                       storagePath.mkdirs();
                       File myMovie = new File(storagePath, String.format("%s.mp4", timestampS));
                       FileOutputStream fos = new FileOutputStream(myMovie);
                       FileChannel fco = fos.getChannel();
                       fco.position(0);
                       out.getBox(fco);
                       fco.close();
                       fos.close();

                   } catch (FileNotFoundException e) {
                       // TODO Auto-generated catch block
                       e.printStackTrace();
                   } catch (IOException e) {
                       // TODO Auto-generated catch block
                       e.printStackTrace();
                   }
                   String mFileName = Environment.getExternalStorageDirectory()
                           .getAbsolutePath();
                   // mFileName += "/output.mp4";

                   File sdCardRoot = Environment.getExternalStorageDirectory();
                   File yourDir = new File(mediaStorageDir + File.separator);
                   for (File f : yourDir.listFiles()) {
                       if (f.isFile())
                           name = f.getName();
                       // make something with the name
                   }
                   mFileName = mediaStorageDir.getPath() + File.separator
                           + "output-%s.mp4";
                   System.out.println("final filename : "
                           + mediaStorageDir.getPath() + File.separator
                           + "output-%s.mp4" + "names of files : " + name);
                   single_video = false;
                   return name;
               } else {
                   single_video = true;
                   name = file_path.get(0);
                   return name;
               }
    </track></track></track></track>

    Error :

    The Error that I am facing while trying to merge the videos generated via Images and a normal video is

    12-15 12:26:06.155  26022-26111/? W/System.err﹕ java.io.IOException: Cannot append com.googlecode.mp4parser.authoring.Mp4TrackImpl@45417c38 to com.googlecode.mp4parser.authoring.Mp4TrackImpl@44ffac60 since their Sample Description Boxes differ
    12-15 12:26:06.155  26022-26111/? W/System.err﹕ at com.googlecode.mp4parser.authoring.tracks.AppendTrack.<init>(AppendTrack.java:48)
    </init>

    Fix that I tried :

    Google advised me to change the CODEC in JavaCV from avcodec.AV_CODEC_ID_MPEG4 to avcodec.AV_CODEC_ID_H264. But when I did that, I am not able to get the video from images thereby throwing the following error :

    12-15 12:26:05.840  26022-26089/? W/linker﹕ libavcodec.so has text relocations. This is wasting memory and is a security risk. Please fix.
    12-15 12:26:05.975  26022-26089/? W/System.err﹕ com.googlecode.javacv.FrameRecorder$Exception: avcodec_open2() error -1: Could not open video codec.
    12-15 12:26:05.975  26022-26089/? W/System.err﹕ at com.googlecode.javacv.FFmpegFrameRecorder.startUnsafe(FFmpegFrameRecorder.java:492)
    12-15 12:26:05.975  26022-26089/? W/System.err﹕ at com.googlecode.javacv.FFmpegFrameRecorder.start(FFmpegFrameRecorder.java:267)

    What I need :

    Creating video from Images is inevitable and that video will definitely be used to merge with other videos which might have any Codec Formats. So I need to find a way to merge any kind of videos irrespective of their Codecs or any other parameters. I am trying to keep it simple by just using the Jars and SO files and I dont want to drive myself crazy by going on a full scale implementation of FFMPEG Library. That being said, I am also ready to look into that library if I dont have any other ways to achieve what I want but a solid resource with an ALMOST working code would be much appreciated. Cheers.

    Update :
    I looked upon the issues mentioned at GitHub of OpenCV, but didnt find anything solid from it.
    OpenCV Issues