Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (99)

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

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (10134)

  • Evolution #4280 : Affichage les états autres que "stable"

    28 janvier 2019, par RastaPopoulos ♥

    +1 c’est un super gros problème ergonomique. Je n’utilise pas souvent SVP, mais du coup même moi à chaque fois que j’y reviens je ne me souviens plus pourquoi ça fait ça et je ne comprends bien à ce qu’il se passe et si j’ai le droit de les installer. Déjà le truc de base : aucune information importante ne doit être faite uniquement par des styles graphiques, ça doit toujours être marqué explicitement. Mais en plus de ça, c’est même pas la norme graphique adapté à l’idée à véhiculer ! Grisé c’est habituellement utilisé pour indiquer un truc inactif (disabled), un truc sur lequel on ne peut PAS interagir. Alors que là il s’agit de plugin tout à fait ok avec notre version de SPIP et qu’on a le droit d’installer, donc aucun rapport.

  • Allowing downloads of partial video files from Django

    18 janvier 2019, par DataVis

    I have a Django app that allows users to make/save ’clips’ of video files, that is keep timestamps of start and end times of video files to save in playlists. I would like users to be able to download clips (and playlists as well) they have saved.

    I have done quite a bit of research on the topic and have gotten ffmpeg working from my terminal to save partial clips (though I’ve struggled to figure out pathnames for using subprocess.call with ffmpeg), and I have also gotten moviepy working via the terminal to save partial clips.

    I’m struggling to figure out how to incorporate this into my Django app so that users can click a link and subsequently begin a download of a specific clip (or playlist). I believe I will want to use celery to avoid tying up the server but I’m not even to the point where I can offload a task as I can’t figure out how to :

    1. ’Clip’ the original, longer video file to make it shorter (do I need to make a local copy of a new file first ?).
    2. Send a response as a download to the user.

    Here is my models.py :

    class Match(models.Model):
       game_id = models.IntegerField(primary_key=True,
           validators=[MinValueValidator(1)],db_column="game_id")
       wide = models.FileField(upload_to='games/2018/',blank=True,null=True)

    class Playlist(models.Model):
           name = models.CharField(default='',null=True,blank=True,max_length=200)
           created_by = models.ForeignKey(User,related_name="playlists",on_delete=models.CASCADE)
           created =   models.DateTimeField(editable=False)
           modified =  models.DateTimeField()


           def save(self, *args, **kwargs):
               ''' On save, update timestamps '''
               if not self.id:
                   entries = Playlist.objects.order_by('-id')
                   try:
                       self.id = entries[0].id + 1
                   except IndexError:
                       # we don't have any PlaylistEntries yet, so we just start @ 0
                       self.id = 0
                   self.created = timezone.now()
               self.modified = timezone.now()

               return super(Playlist, self).save(*args, **kwargs)


       class Clip(models.Model):
           name =  models.CharField(default='',null=True,blank=True,max_length=200)
           game_id = models.ForeignKey(Match,related_name="clips",on_delete=models.CASCADE,
               db_column="game_id",null=True,blank=True)
           clipstart = models.IntegerField(null=True,blank=True)
           clipend = models.IntegerField(null=True,blank=True)
           playlist = models.ForeignKey(Playlist,related_name="clips",on_delete=models.CASCADE,
               db_column="playlist",null=True,blank=True)
           created_by = models.ForeignKey(User,related_name="clips",on_delete=models.CASCADE)
           created =   models.DateTimeField(editable=False)
           modified =  models.DateTimeField()
           duration = models.IntegerField(null=True,blank=True)

           def save(self, *args, **kwargs):
               ''' On save, update timestamps '''
               if not self.id:
                   entries = Clip.objects.order_by('-id')
                   try:
                       self.id = entries[0].id + 1
                   except IndexError:
                       # we don't have any PlaylistEntries yet, so we just start @ 0
                       self.id = 0
                   self.created = timezone.now()
               self.modified = timezone.now()
               self.duration = int(self.clipend) - int(self.clipstart)
               return super(Clip, self).save(*args, **kwargs)

    And views.py where I’m struggling (I’m not sure if I’m working with FileField properly etc) :

    from moviepy.editor import *
    def ClipDownload(request,pk,*args,**kwargs):

       this_clip = models.Clip.objects.filter(pk=pk)
       file_name = this_clip[0].game_id.wide

       p = VideoFileClip(file_name,audio=False).subclip(this_clip.clipstart,this_clip.clipend)

       response = HttpResponse(p, content_type='application/force-download')
       response['Content-Disposition'] = 'attachment; filename=%s' % this_clip.name
       response['Content-Length'] = os.path.getsize(file_name)
       return response

    The current code is not working, I’m getting the proper Clip but I’m not able to make a subclip of the FileField as I’m getting an attribute error :

    AttributeError: 'FieldFile' object has no attribute 'endswith'

    I would be very appreciative if someone can point me in the right direction to get the file downloading so I can move on to trying to incorporate it into celery ?

  • FFmpeg record and stream

    16 janvier 2019, par Robert

    I’m getting the following error.

      E/FFmpeg: Exception while trying to run:
      [/data/user/0/com.example.pathways.testipcam/files/ffmpeg, -y, -i,
     rtsp://log:pass@IP:port/video.h264, -acodec, copy, -vcodec, copy, -t,
    00:03:00,
    content://com.example.android.fileprovider/external_files/Android/data/com.example.pathways.testipcam/files/Movies/IPcam_20190116_150628_6019720208966811003.m>kv]
    java.io.IOException: Cannot run program "/data/user/0/com.example.pathways.testipcam/files/ffmpeg": error=2, No such >file or directory

    OK I’m trying to learn how to record and stream my IP cam on android. I can stream the video in a surface view media player no problem so I then went to the record task. Now I’m a bit lost. I know this is possible as I have read people say they used this to do it.

    I started with implamenting

    implementation 'nl.bravobit:android-ffmpeg:1.1.5'

    But I can’t figure out what I am missing or doing wrong as there aren’t really any tutorials explaining this completely. So hopefully this can be the thread everyone else finds for a solution. I have listed my code below. Exactly what have I got wrong here. It runs and goes to onStart...then right on onFailure.
    DO I need to have 2 streams in order to view and watch ? or what the deal.
    I know FFmpeg can do that.
    "ffmpeg supports multiple outputs created out of the same input(s) in the same process. The usual way to accomplish this is :

    ffmpeg -i input1 -i input2 \
    -acodec … -vcodec … output1 \
    -acodec … -vcodec … output2 \"

    but I have no idea how to sue that.
    Anyway, I know I’m kind of close, at least I hope I need a little help on getting over the finish line on this. What have I done wrong, how does this work.

    Here is what I did, I streamed the video as the app does. no problem

       surfaceView = (SurfaceView) findViewById(R.id.videoView);
       _surfaceHolder = surfaceView.getHolder();
       _surfaceHolder.addCallback(this);
       _surfaceHolder.setFixedSize(320, 240);

    ....

    @Override
    public void surfaceCreated(SurfaceHolder holder) {
       mpPlayerRun();

    }

    public void mpPlayerRun(){
       _mediaPlayer = new MediaPlayer();
       _mediaPlayer.setDisplay(_surfaceHolder);

       try {
           // Specify the IP camera's URL and auth headers.
           _mediaPlayer.setDataSource(RTSP_URL);

           // Begin the process of setting up a video stream.
           _mediaPlayer.setOnPreparedListener(this);
           _mediaPlayer.prepareAsync();
       }
       catch (Exception e) {}
    }
    ...
    @Override
    public void onPrepared(MediaPlayer mp) {
       _mediaPlayer.start();
    }

    OK, so then I created a button to record.

    @Override
    public void onClick(View view) {
       switch (view.getId()) {
           case R.id.IPcamback:
               break;

           case R.id.IPcamrecord:
               if (ContextCompat.checkSelfPermission(this,
                       Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
                   takeIPvid();
               } else {
                   requestIPCamPermission();
               }

    .....

    requested permission then results.

       private void requestIPCamPermission() {
       if (ActivityCompat.shouldShowRequestPermissionRationale(this,
               Manifest.permission.WRITE_EXTERNAL_STORAGE)) {

           new AlertDialog.Builder(this)
                   .setTitle("Permission needed")
                   .setMessage("This permission is needed do to android safety protocol")
                   .setPositiveButton("ok", new DialogInterface.OnClickListener() {
                       @Override
                       public void onClick(DialogInterface dialog, int which) {
                           ActivityCompat.requestPermissions(MainActivity.this,
                                   new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE}, 420);
                       }
                   })
                   .setNegativeButton("cancel", new DialogInterface.OnClickListener() {
                       @Override
                       public void onClick(DialogInterface dialog, int which) {
                           dialog.dismiss();
                       }
                   })
                   .create().show();

       } else {
           ActivityCompat.requestPermissions(this,
                   new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE}, 420);
       }
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {

       if (requestCode == 420)  {
           if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
               takeIPvid();
           } else {
               Toast.makeText(this, "Permission DENIED", Toast.LENGTH_SHORT).show();
           }
    .....

    then I made the file provider and createVideoOutputFile() method and the takeIPvid method.

    private File createVideoOutputFile() throws IOException {
       String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
       String imageFileName = "IPcam_" + timeStamp + "_";
       IPstorageDir = getExternalFilesDir(Environment.DIRECTORY_MOVIES);
       IPvideo_file = File.createTempFile(
               imageFileName,  /* prefix */
               ".mp4",         /* suffix */
               IPstorageDir      /* directory */
       );

       // Save a file: path for use with ACTION_VIEW intents
       String IPmVideoFilename = IPvideo_file.getAbsolutePath();
       return IPvideo_file;
    }

      private void takeIPvid() {

           File ipfile = null;
           try {
               ipfile = createVideoOutputFile();
           } catch (IOException e) {
               e.printStackTrace();
           }
       IPvideo_uri = FileProvider.getUriForFile(this,
               "com.example.android.fileprovider",
               ipfile);


       String[] cmd = {"-y", "-i", "rtsp://Login:Passord@IP:port/video.h264", "-acodec", "copy", "-vcodec", "copy","-t","00:00:20", IPvideo_uri.toString() };

       FFmpeg.getInstance(this).execute(cmd,new ExecuteBinaryResponseHandler(){

           @Override
           public void onStart() {
               super.onStart();


           }

           @Override
           public void onFailure(String message) {
               super.onFailure(message);



           }

           @Override
           public void onSuccess(String message) {
               super.onSuccess(message);


           }

           @Override
           public void onProgress(String message) {
               super.onProgress(message);

           }

           @Override
           public void onFinish() {
               super.onFinish();

           }
       });

    }