Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (50)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

Sur d’autres sites (7874)

  • JavaCV/FFmpeg causes crash only on Lollipop

    13 novembre 2015, par WeirdHat

    I get reports of this crash from users of my app on Galaxy Note devices running Android Lollipop (might happen on other devices but the majority of my users have Galaxy Note because it’s a drawing app). Below is the relevant code from my ASyncTask which exports a series of images (plus audio) to a video file using JavaCV/FFmpeg, and the stack trace from the reported crash. It works fine on my Note 8.0 running KitKat (there’s no Lollipop update available for that device), and works fine in Lollipop on the emulator, so I’m having a hard time tracking down the cause and don’t know what to do.

    @Override
    protected String doInBackground(final File... params) {
       FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(params[0],canvas_width,canvas_height, 0);
       FrameGrabber audiograbber = null;
       if(audio!=null) audiograbber = new FFmpegFrameGrabber(audio);
       Frame audioframe;
       Frame image;
       AndroidFrameConverter converter = new AndroidFrameConverter();

       try {
           recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
           recorder.setFrameRate(framerate);
           recorder.setPixelFormat(0);
           if(audio!=null) {
               audiograbber.setFrameRate(framerate);
               audiograbber.start();
               recorder.setAudioChannels(audiograbber.getAudioChannels());
               recorder.setSampleRate(audiograbber.getSampleRate());
           }
           recorder.start();

           Bitmap drawframe = createBitmap(canvas_width, canvas_height, Bitmap.Config.ARGB_8888);
           Canvas c = new Canvas(drawframe);
           Paint p = new Paint();

           for(int frame=0; frame/code to draw image

               image = converter.convert(drawframe);
               recorder.record(image);
           }

           if(isCancelled()) {
               bgbitmap.recycle();
               drawframe.recycle();
               return "Cancelled";
           }

           if(audio!=null) {
               while((audioframe = audiograbber.grabFrame()) != null) {
                   recorder.record(audioframe);
               }
           }

           recorder.stop();
           bgbitmap.recycle();
           drawframe.recycle();
           if(audio!=null) audiograbber.stop();
           return "Saved "+params[0];
       } catch (Exception e) {
           e.printStackTrace();
       }
       return "Failed";
    }

    -

    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Build fingerprint: 'samsung/treltexx/trelte:5.1.1/LMY47X/N910CXXU1COH4:user/release-keys'
    Revision: '21'
    ABI: 'arm'
    pid: 12039, tid: 12053, name: GCDaemon  >>> com.weirdhat.roughanimator <<<
    signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    Abort message: 'sart/runtime/gc/collector/mark_sweep.cc:381] Can't mark invalid object'
       r0 00000000  r1 00002f15  r2 00000006  r3 00000000
       r4 b366bdb8  r5 00000006  r6 00000002  r7 0000010c
       r8 00000001  r9 b446f550  sl b4429000  fp 9a975c60
       ip 00002f15  sp b366b008  lr b6db9cb9  pc b6ddd3ac  cpsr 60070010

    backtrace:
       #00 pc 0003b3ac  /system/lib/libc.so (tgkill+12)
       #01 pc 00017cb5  /system/lib/libc.so (pthread_kill+52)
       #02 pc 000188c7  /system/lib/libc.so (raise+10)
       #03 pc 00015165  /system/lib/libc.so (__libc_android_abort+36)
       #04 pc 00012fac  /system/lib/libc.so (abort+4)
       #05 pc 00242f17  /system/lib/libart.so (art::Runtime::Abort()+170)
       #06 pc 000ad991  /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
       #07 pc 0013ec53  /system/lib/libart.so (bool art::gc::accounting::HeapBitmap::AtomicTestAndSet(art::mirror::Object const*, art::gc::collector::MarkSweepMarkObjectSlowPath const&)+422)
       #08 pc 0013ed27  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkObjectParallel(art::mirror::Object const*)+142)
       #09 pc 0013ff23  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkRootParallelCallback(art::mirror::Object**, void*, art::RootInfo const&)+26)
       #10 pc 0025893d  /system/lib/libart.so (art::ReferenceMapVisitor::VisitQuickFrame()+1024)
       #11 pc 00258cad  /system/lib/libart.so (art::ReferenceMapVisitor::VisitFrame()+224)
       #12 pc 0024c8e9  /system/lib/libart.so (art::StackVisitor::WalkStack(bool)+276)
       #13 pc 0024e617  /system/lib/libart.so (art::Thread::VisitRoots(void (*)(art::mirror::Object**, void*, art::RootInfo const&), void*)+994)
       #14 pc 0013ef9f  /system/lib/libart.so (art::gc::collector::CheckpointMarkThreadRoots::Run(art::Thread*)+126)
       #15 pc 0025b44d  /system/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*)+296)
       #16 pc 0013dc0d  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkRootsCheckpoint(art::Thread*, bool)+96)
       #17 pc 0014165d  /system/lib/libart.so (art::gc::collector::MarkSweep::PreCleanCards()+172)
       #18 pc 001417d3  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkingPhase()+126)
       #19 pc 001418b9  /system/lib/libart.so (art::gc::collector::MarkSweep::RunPhases()+176)
       #20 pc 00138527  /system/lib/libart.so (art::gc::collector::GarbageCollector::Run(art::gc::GcCause, bool)+246)
       #21 pc 0015865b  /system/lib/libart.so (art::gc::Heap::CollectGarbageInternal(art::gc::collector::GcType, art::gc::GcCause, bool)+1426)
       #22 pc 00159af5  /system/lib/libart.so (art::gc::Heap::ConcurrentGC(art::Thread*)+56)
       #23 pc 000003ef  /system/framework/arm/boot.oat
  • FFMPEG conversion error from MKV to MP4 using libfdk_aac codec

    23 août 2014, par Charlie Brown

    The purpose of doing this is because my "Smart" samsung TV doesn’t play MKV files.

    This thread mentions that there is no need for video conversion, just changing the container might suffice. After reading multiple threads on how to change the container of MKV to MP4, I downloaded and compiled the FFMPEG with libfdk_aac support from here. I tried converting a sample MKV file using this command :

    ffmpeg -i "C:\VideoTest\Sample1.mkv" -c:v copy -c:a libfdk_aac -b:a 384k "C:\VideoTest\Sample2.mp4"

    but getting the following errors (copied from command prompt) :

    [hevc @ 0000000000308ae0] Could not find ref with POC 113
    [hevc @ 0000000000308ae0] Could not find ref with POC 111
    [hevc @ 0000000000308ae0] Could not find ref with POC 109
    [hevc @ 0000000000308ae0] Could not find ref with POC 107
    Input #0, matroska,webm, from 'C:\VideoTest\Sample-1.mk
    v':
     Metadata:
       encoder         : libebml v1.3.0 + libmatroska v1.4.1
       creation_time   : 2014-07-16 08:54:02
     Duration: 00:00:58.68, start: 0.042000, bitrate: 3520 kb/s
       Chapter #0.0: start 0.000000, end 58.717000
       Metadata:
         title           : Chapter 4
       Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x816, SAR 1:1 DAR 40:17, 2
    4 fps, 24 tbr, 1k tbn, 1k tbc (default)
       Metadata:
         _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
    Jun  9 2014 15:16:27
         _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
    t on Jun  9 2014 15:16:27
         _STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
         _STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
         _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
         _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
         BPS             : 2733260
         BPS-eng         : 2733260
         DURATION        : 00:00:58.667000000
         DURATION-eng    : 00:00:58.667000000
         NUMBER_OF_FRAMES: 1408
         NUMBER_OF_FRAMES-eng: 1408
         NUMBER_OF_BYTES : 20044023
         NUMBER_OF_BYTES-eng: 20044023
       Stream #0:1: Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 768 kb/s (default)

       Metadata:
         _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
    Jun  9 2014 15:16:27
         _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
    t on Jun  9 2014 15:16:27
         _STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
         _STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
         _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
         _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
         BPS             : 767986
         BPS-eng         : 767986
         DURATION        : 00:00:58.625000000
         DURATION-eng    : 00:00:58.625000000
         NUMBER_OF_FRAMES: 5496
         NUMBER_OF_FRAMES-eng: 5496
         NUMBER_OF_BYTES : 5627904
         NUMBER_OF_BYTES-eng: 5627904
       Stream #0:2(eng): Subtitle: hdmv_pgs_subtitle, 1920x1080 (default)
       Metadata:
         _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
    Jun  9 2014 15:16:27
         _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
    t on Jun  9 2014 15:16:27
         _STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
         _STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
         _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
         _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
         BPS             : 17485
         BPS-eng         : 17485
         DURATION        : 00:00:56.750000000
         DURATION-eng    : 00:00:56.750000000
         NUMBER_OF_FRAMES: 40
         NUMBER_OF_FRAMES-eng: 40
         NUMBER_OF_BYTES : 124036
         NUMBER_OF_BYTES-eng: 124036
    Output #0, mp4, to 'C:\VideoTest\Sample.mp4':
     Metadata:
       encoder         : Lavf56.1.100
       Chapter #0.0: start 0.000000, end 58.675000
       Metadata:
         title           : Chapter 4
       Stream #0:0: Video: hevc ([35][0][0][0] / 0x0023), yuv420p, 1920x816 [SAR 1:
    1 DAR 40:17], q=2-31, 24 fps, 16k tbn, 1k tbc (default)
       Metadata:
         _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
    Jun  9 2014 15:16:27
         _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
    t on Jun  9 2014 15:16:27
         _STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
         _STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
         _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
         _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
         BPS             : 2733260
         BPS-eng         : 2733260
         DURATION        : 00:00:58.667000000
         DURATION-eng    : 00:00:58.667000000
         NUMBER_OF_FRAMES: 1408
         NUMBER_OF_FRAMES-eng: 1408
         NUMBER_OF_BYTES : 20044023
         NUMBER_OF_BYTES-eng: 20044023
       Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, 5.1
    , s16, 128 kb/s (default)
       Metadata:
         _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
    Jun  9 2014 15:16:27
         _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
    t on Jun  9 2014 15:16:27
         _STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
         _STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
         _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
         _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
         BPS             : 767986
         BPS-eng         : 767986
         DURATION        : 00:00:58.625000000
         DURATION-eng    : 00:00:58.625000000
         NUMBER_OF_FRAMES: 5496
         NUMBER_OF_FRAMES-eng: 5496
         NUMBER_OF_BYTES : 5627904
         NUMBER_OF_BYTES-eng: 5627904
         encoder         : Lavc56.0.101 libfdk_aac
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (dts (dca) -> aac (libfdk_aac))
    Press [q] to stop, [?] for help
    [mp4 @ 0000000003be0500] Invalid DTS: 656 PTS: -672 in output stream 0:0
    av_interleaved_write_frame(): Invalid argument
    [libfdk_aac @ 00000000042fa640] Trying to remove 1024 samples, but the queue is
    empty
    [mp4 @ 0000000003be0500] Encoder did not produce proper pts, making some up.
    [libfdk_aac @ 00000000042fa640] Trying to remove 1024 samples, but the queue is
    empty
    frame=    2 fps=0.0 q=-1.0 Lsize=      96kB time=00:00:00.04 bitrate=18415.0kbit
    s/s
    video:95kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing ov
    erhead: 0.570364%
    Conversion failed!

    Also tried using this command :

    ffmpeg -i input.wav -c:a libfdk_aac -b:a 128k output.mp4

    But this screws up the video quality and I start seeing some bad pixelated patches during the playback.

    Any help would be appreciated.

    Just an FYI : I got this far by reading blogs and posts. I have 0 knowledge about video conversion.

  • H264 streamed video stutter and freeze with MediaCodec, Android 4.1.2

    5 mars 2015, par Wajih

    I have been trying my heart out to remove the stutter from an android RTSP client.
    Here is my setup

    1. FFMPEG server streams a live video on Win7. The video is 1200x900 in size. The video streamed is in H264 format.
    2. I receive the video packets on android (4.1.2) clinet under JNI which pushes the packet to java - Device is a Samsung Tab4
    3. Packets are decoded using MediaCodec. Once call from JNI to push the packets into MediaCodec, another thread in Java tries to de-queue the data and display them to a SurfaceView (its a GLSurfaceView)

    Despite my efforts of using queue to buffer the packets, changing wait times to 0,-1, 1000000, i am unable to get a clean streamed video. I understand that there is some packet loss (1% to 10%), but I am getting a broken video, with stutter (some call it even jitter). Green patches, pink screens, gray slices. You name it, it is there, the problem seems to be exaggerated when there is a fast movement in the video.
    At the moment I am not sure where the problem lies, I tried a windows version of the client (with ffmpeg decoding) and it works smoothly despite the packet loss.

    What am I doing wrong ? Any guidance is appreciated.
    Below is the client end code for Android and the server end FFMPEG settings I read from a config file.

    // Function called from JNI
       public int decodeVideo(byte[] data, int size, long presentationTimeUs, boolean rtpMarker, int flag)
           {
               if(vdecoder == null)
                   return -1;
               if(currVInbufIdx == -1) {
                   vdecoderInbufIdx = vdecoder.dequeueInputBuffer(1000000); //1000000/*1s*/
                   if(vdecoderInbufIdx < 0) {
                       Log.d("log","decodeVideo@1: frame dropped");
                       vdecoderRet = -1;
                       return vdecoderRet;
                   }
                   currVInbufIdx = vdecoderInbufIdx;
                   currVPts = presentationTimeUs;
                   currVFlag = flag;
                   inputVBuffers[currVInbufIdx].clear();
               }

               vdecoderPos = inputVBuffers[currVInbufIdx].position();
               vdecoderRemaining = inputVBuffers[currVInbufIdx].remaining();
               if(flag==currVFlag && vdecoderRemaining >= size && currVPts == presentationTimeUs
                       && rtpMarker == false
                       /*&&(pos < vbufferLevel || vbufferLevel<=0)*/)
               {
                   /* Queue without decoding */
                   inputVBuffers[currVInbufIdx].put(data, 0,size);
               }
               else
               {

                   if(flag==currVFlag && vdecoderRemaining >= size && currVPts == presentationTimeUs
                           && rtpMarker)
                   {
                       inputVBuffers[currVInbufIdx].put(data, 0, size);
                       queued = true;
                   }
                   Log.d("log", "decodeVideo: submit,"
                           + " pts=" + Long.toString(currVPts)
                           + " position="+inputVBuffers[currVInbufIdx].position()
                           + " capacity="+inputVBuffers[currVInbufIdx].capacity()
                           + " VBIndex="+currVInbufIdx
                           );
                   vdecoder.queueInputBuffer(currVInbufIdx, 0, inputVBuffers[currVInbufIdx].position(), currVPts, currVFlag);

                   //
                   vdecoderInbufIdx = vdecoder.dequeueInputBuffer(1000000);//1000000/*1s*/
                   if(vdecoderInbufIdx >= 0)
                   {
                       currVInbufIdx = vdecoderInbufIdx;
                       currVPts = presentationTimeUs;
                       currVFlag = flag;
                       inputVBuffers[currVInbufIdx].clear();
                       //if(queued == false)
                       {
                           inputVBuffers[vdecoderInbufIdx].put(data, 0, size);

                       }

                   }
                   else
                   {
                       currVInbufIdx = -1;
                       currVPts = -1;
                       vdecoderRet = -1;
                       Log.d("log","decodeVideo@2: frame dropped");                        
                   }
               }              
               return vdecoderRet;
           }

    And here we have the thread that calls for a render

    // Function at android. Called by a separate thread.
       private void videoRendererThreadProc() {

               if(bufinfo == null)
                   bufinfo = new MediaCodec.BufferInfo();
               videoRendered = false;

               Log.d("log", "videoRenderer started.");

               while(!Thread.interrupted() && !quitVideoRenderer)
               {

                   Log.d("log", "videoRendererThreadProc");

                   outbufIdx = vdecoder.dequeueOutputBuffer(bufinfo,1000000);//500000
                   switch (outbufIdx)
                   {
                   case MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED:
                       Log.d("log", "decodeVideo: output buffers changed.");
                       // outputBuffers = vdecoder.getOutputBuffers();
                       break;
                   case MediaCodec.INFO_OUTPUT_FORMAT_CHANGED:
                       Log.d("log", "decodeVideo: format changed - " + vdecoder.getOutputFormat());
                       break;
                   case MediaCodec.INFO_TRY_AGAIN_LATER:
                       // Log.d("log", "decodeVideo: try again later.");
                       break;
                   default:

                       // decoded or rendered
                       videoRendered = true;
                       vdecoder.releaseOutputBuffer(outbufIdx, true);
                       //Log.d("log", "decodeVideo: Rendering...!!!.");    
                   }
               }

               // flush decoder
               //vdecoder.queueInputBuffer(0, 0, 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM);

               outbufIdx = vdecoder.dequeueOutputBuffer(bufinfo, 1000000);//10000
               if(outbufIdx >= 0)
               {
                   vdecoder.releaseOutputBuffer(outbufIdx, true);      
               }  
               bufinfo = null;
               videoRendered = false;
               //
               Log.d("log", "videoRenderer terminated.");
           }

    And the ffmpeg setting at server at as follows.

    [slices] =  4       # --slices
    [threads] = 4       # --threads  
    [profile] = high        # --profile main|baseline
    [preset] = faster       # --preset faster|ultrafast
    [tune] = zerolatency    # --tune