Recherche avancée

Médias (1)

Mot : - Tags -/sintel

Autres articles (96)

  • Configuration spécifique d’Apache

    4 février 2011, par

    Modules spécifiques
    Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
    Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
    Création d’un (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (6969)

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

           }
       });

    }
  • xuggler : no video in encoded 3gp file

    1er août 2012, par khizar

    i am trying to encode videos into 3gp format using xuggler, i somehow got it to work, work as in the program stopped throwing errors and exceptions, but the new file that is created does not have any video. Now there is no error or exception for me to work with so i have stuck a wall.
    EDIT : Note the audio is working as it shud.

    This is the code for the main function where the listeners are configured

    IMediaReader reader = ToolFactory.makeReader("/home/hp/mms/b.flv") ;

       IMediaWriter writer = ToolFactory.makeWriter("/home/hp/mms/xuggle/a_converted.3gp", reader);

       IMediaDebugListener debugListener = ToolFactory.makeDebugListener();
       writer.addListener(debugListener);

       ConvertVideo convertor = new ConvertVideo(new File("/home/hp/mms/b.flv"), new File("/home/hp/mms/xuggle/a_converted.3gp"));
       // convertor.addListener(writer);
       reader.addListener(writer);
       writer.addListener(convertor);

       while (reader.readPacket() == null)
           ;

    And this is the code for the convertor that i wrote.

    public ConvertVideo(File inputFile, File outputFile)
    {
       this.outputFile = outputFile;
       reader = ToolFactory.makeReader(inputFile.getAbsolutePath());
       reader.addListener(this);
    }
    private IVideoResampler videoResampler = null;
    private IAudioResampler audioResampler = null;

    @Override
    public void onAddStream(IAddStreamEvent event)
    {
       if (writer == null)
       {
           writer = ToolFactory.makeWriter(outputFile.getAbsolutePath(), reader);

       }

       int streamIndex = event.getStreamIndex();
       IStreamCoder streamCoder = event.getSource().getContainer().getStream(streamIndex).getStreamCoder();

       if (streamCoder.getCodecType() == ICodec.Type.CODEC_TYPE_AUDIO)
       {
           streamCoder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, false);
           writer.addAudioStream(streamIndex, 0, 1, 8000);
       }
       else if (streamCoder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO)
       {
           streamCoder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, false);
           streamCoder.setCodec(ICodec.findEncodingCodecByName("h263"));
           writer.addVideoStream(streamIndex, 0, VIDEO_WIDTH, VIDEO_HEIGHT);

       }
       super.onAddStream(event);
    }

    // //
    @Override
    public void onVideoPicture(IVideoPictureEvent event)
    {
       IVideoPicture pic = event.getPicture();
       if (videoResampler == null)
       {
           videoResampler = IVideoResampler.make(VIDEO_WIDTH, VIDEO_HEIGHT, pic.getPixelType(), pic.getWidth(), pic.getHeight(), pic.getPixelType());
       }
       IVideoPicture out = IVideoPicture.make(pic.getPixelType(), VIDEO_WIDTH, VIDEO_HEIGHT);
       videoResampler.resample(out, pic);

       IVideoPictureEvent asc = new VideoPictureEvent(event.getSource(), out, event.getStreamIndex());
       super.onVideoPicture(asc);
       out.delete();
    }

    @Override
    public void onAudioSamples(IAudioSamplesEvent event)
    {
       IAudioSamples samples = event.getAudioSamples();
       if (audioResampler == null)
       {
           audioResampler = IAudioResampler.make(1, samples.getChannels(), 8000, samples.getSampleRate());
       }
       if (event.getAudioSamples().getNumSamples() > 0)
       {
           IAudioSamples out = IAudioSamples.make(samples.getNumSamples(), samples.getChannels());
           audioResampler.resample(out, samples, samples.getNumSamples());

           AudioSamplesEvent asc = new AudioSamplesEvent(event.getSource(), out, event.getStreamIndex());
           super.onAudioSamples(asc);
           out.delete();
       }
    }

    I just cant seem to figure out where the problem is. I wud be thankful if someone wud plz point me in the right direction.

    EDIT : If i see the properties of my newly encoded video, its audio properties are set and its video properties are not i.e in video properties, dimension= 0 x 0, frame rate= N/A and codec= h.263. The problem here is the 0 x 0 dimension.

  • How to use ffmpeg to add a drop shadow ?

    26 mars 2024, par mrstudy

    I'm trying to add a drop shadow to an overlay video using ffmpeg, but haven't had any luck. I was trying using something similar to the command in this post, but I haven't been able to understand it/get it working.

    


    Here is an example of what I'm trying to do.

    


    It's not super easy to tell from my screenshot, but I want a shadow behind the overlay video similar to box-shadow from css.

    


    Any help is appreciated !