Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (70)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

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

Sur d’autres sites (5111)

  • Converted Avi to Mp4 using FFMPEG, Converted video not working in html 5 Tag

    21 mars 2015, par Suprabhat

    I have a section in my web page where user can upload any types of videos of any format , currently only restricted to .mp4 and .avi. After successfull upload i have displayed the same video to the user. I have bind the path in HTML5 video so that the user can view the content he/she has uploded. Video with extension .mp4 no doubt are working properly as HTML5 support them. Tricky part is it don’t support Avi files. Now here what the problem has arised. In order to display avi videos i have used FFMPEG to convert videos with extension .avi to .mp4. With lots of googling and reading forum, i have succesfully converted avi videos to mp4 . Here’s what i have used :-

    1. ffmpeg -i input.avi -acodec libfaac -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4

    2. ffmpeg -i input.avi -c:v libx264 -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4

    Above two are working perfectly, they have succesfully converted the video. But when i run them on browser in HTML5 and in new tab (Flash Player Plugin Installed), HTML5 doesn’t play it and flash player return an error message "Video can’t be played because the file is corrupt". But when i played them on KMplayer and in Window media player they are running perfectly.

    I have been to various threads in stackoverflow related to convert avi to mp4 and here i found following in one of the forum. where one of user has accepted this a correct answer but it ain’t worked out for me.

    1. ffmpeg -y -i sample.avi -b:v 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 sample.mp4

    Above argument returned me following error "File for preset ’slow’ not found".

    Following my futher searches i came across this thread ffmpeg convert mov file to mp4 for HTML5 video tag IE9. Here following argument worked perfectly and it able to convert video in such way that it is playble on browser.

    1. ffmpeg -y -i input.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k -pix_fmt yuv420p output.mp4.

    Problem i faced here was video is converted to 420p reso which quality is noty upto mark. Smaller resolution videos are been enlarged and seems pixelated

    Thus, i had to finally put up a question. I will be very obliged if someone can give a solution for above problem. I need to convert an avi video to mp4 supported by HTML5 video tag. It should able to play it on browser and during conversion of video it should maintain original audio and video quality plus resolution.

    Thanks

    My C# Code :

           public void Create(string input, string output, string parametri, string ThumbnailPhysicalPath, int ConvertType)
           {
               ffmpeg = new Process();

               if (ConvertType == Convert.ToInt32(ConversionType.Thumbnail))
                   ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -vframes 1 \"" + output + "\"";
               else if (ConvertType == Convert.ToInt32(ConversionType.AviToMp4))
                   ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -c:v libx264 -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 \"" + output + "\"";
                   //ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k -pix_fmt yuv420p \"" + output + "\"";
               ffmpeg.StartInfo.FileName = ThumbnailPhysicalPath + @"ffmpeg.exe";
               ffmpeg.StartInfo.UseShellExecute = false;
               ffmpeg.StartInfo.RedirectStandardOutput = true;
               ffmpeg.StartInfo.RedirectStandardError = true;
               ffmpeg.StartInfo.CreateNoWindow = true;
               try
               {
                   ffmpeg.Start();
                   ffmpeg.WaitForExit();
                   string error = ffmpeg.StandardError.ReadToEnd();
               }
               catch (Exception Ex)
               {
                   Common.WriteLog("Exception occurred during conversion. Error Message :- " + Ex.Message + "\n Input Parameter :- " + input+ "\n Output Paramenter :- "+ output);
               }
               finally
               {
                   ffmpeg.Close();
                   if (ConvertType == Convert.ToInt32(ConversionType.AviToMp4))
                       UpdateConvertedVideoDetails(input,output);
               }
           }

    Command Prompt FFMPEG Output :-

    Sample 3 Result :-

    D:\Client\WebSite\Converter_Tools>ffmpeg -y -i sample.avi -b:v 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 sample.mp4
    ffmpeg version N-70239-g111d79a Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.2 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
    ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
    b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
    enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
    le-zlib
     libavutil      54. 19.100 / 54. 19.100
     libavcodec     56. 26.100 / 56. 26.100
     libavformat    56. 23.105 / 56. 23.105
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 11.101 /  5. 11.101
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    [avi @ 037c8480] non-interleaved AVI
    Guessed Channel Layout for  Input Stream #0.1 : mono
    Input #0, avi, from 'sample.avi':
     Duration: 00:00:34.00, start: 0.000000, bitrate: 1433 kb/s
       Stream #0:0: Video: cinepak (cvid / 0x64697663), rgb24, 320x240, 15 fps, 15 tbr, 15 tbn, 15 tbc
       Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, u8, 176 kb/s
    File for preset 'slow' not found

    Sample 4 Result :-

    D:\Client\WebSite\Converter_Tools>ffmpeg -y -i input.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_
    aacenc -b:a 128k -pix_fmt yuv420p output.mp4
    ffmpeg version N-70239-g111d79a Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.2 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
    ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
    b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
    enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
    le-zlib
     libavutil      54. 19.100 / 54. 19.100
     libavcodec     56. 26.100 / 56. 26.100
     libavformat    56. 23.105 / 56. 23.105
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 11.101 /  5. 11.101
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, avi, from 'input.avi':
     Duration: 00:00:03.93, start: 0.000000, bitrate: 3255 kb/s
       Stream #0:0: Video: msrle ([1][0][0][0] / 0x0001), pal8, 300x250, 3301 kb/s, 15 fps, 15 tbr, 15 tbn, 15 tbc
    [libx264 @ 002ec860] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
    [libx264 @ 002ec860] profile High, level 2.2
    [libx264 @ 002ec860] 264 - core 144 r2525 40bb568 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subm
    e=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i
    nterlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=15 scenecut=40 intra_refresh=0 rc_lookahead=50 rc
    =cbr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'output.mp4':
     Metadata:
       encoder         : Lavf56.23.105
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 576x480, q=-1--1, 500 kb/s, 15 fps, 15360 tbn, 15 tbc
       Metadata:
         encoder         : Lavc56.26.100 libx264
    Stream mapping:
     Stream #0:0 -> #0:0 (msrle (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    frame=   59 fps= 30 q=-1.0 Lsize=     229kB time=00:00:03.80 bitrate= 493.5kbits/s
    video:227kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.637976%
    [libx264 @ 002ec860] frame I:3     Avg QP:26.53  size: 10657
    [libx264 @ 002ec860] frame P:25    Avg QP:30.49  size:  5608
    [libx264 @ 002ec860] frame B:31    Avg QP:32.26  size:  1935
    [libx264 @ 002ec860] consecutive B-frames: 22.0% 16.9% 20.3% 40.7%
    [libx264 @ 002ec860] mb I  I16..4: 16.7% 69.0% 14.4%
    [libx264 @ 002ec860] mb P  I16..4: 11.1% 29.9%  3.8%  P16..4: 21.3%  6.8%  2.6%  0.0%  0.0%    skip:24.6%
    [libx264 @ 002ec860] mb B  I16..4:  1.7%  3.0%  0.3%  B16..8: 29.7%  5.6%  0.8%  direct: 2.1%  skip:56.8%  L0:50.5% L1:45.6% BI: 3.9%
    [libx264 @ 002ec860] 8x8 transform intra:66.5% inter:79.4%
    [libx264 @ 002ec860] direct mvs  spatial:93.5% temporal:6.5%
    [libx264 @ 002ec860] coded y,uvDC,uvAC intra: 40.3% 48.8% 25.7% inter: 12.4% 8.4% 1.4%
    [libx264 @ 002ec860] i16 v,h,dc,p: 19% 59%  6% 17%
    [libx264 @ 002ec860] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 25% 16%  7%  8%  6% 11%  7% 10%
    [libx264 @ 002ec860] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 21%  9%  7%  9%  8% 10%  7% 10%
    [libx264 @ 002ec860] i8c dc,h,v,p: 41% 33% 13% 13%
    [libx264 @ 002ec860] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 002ec860] ref P L0: 67.6%  8.1%  9.6%  5.4%  6.6%  2.8%
    [libx264 @ 002ec860] ref B L0: 84.6% 10.5%  3.9%  1.0%
    [libx264 @ 002ec860] ref B L1: 95.9%  4.1%
    [libx264 @ 002ec860] kb/s:472.20
  • FFmpegFrameGrabber video artefacts from RTSP network camera

    2 février 2015, par UncleChris

    I’m using JavaCV FFmpegFrameGrabber to grab frames from my network camera through RTSP protocol. Simplified code looks like this :

    /* from ini method */
    // url like: rtsp://ip:port/stream1
    grabber = new FFmpegFrameGrabber(stream.getUrl());
    // type: RTP
    grabber.setFormat(stream.getMediaType());
    grabber.start();

    /* it's called in while loop from outside */
    public void grab() throws FrameProcessorsException {

       try {
           LOGGER.info(grabber.getFrameNumber());
           frame = grabber.grab();
       } catch (FrameGrabber.Exception e) {
           throw new FrameProcessorsException(e);
       }

       // I save my frames to other grabber, to make mp4 file to watch it later
       try {
           videoRecorder.recordFrame(frame, grabber.getTimestamp(), grabber.getImageWidth(), grabber.getImageHeight(), grabber.getAudioChannels());
       } catch (FrameRecorder.Exception e) {
           throw new FrameProcessorsException(e);
       }

       // my processing, the troublemaker
       long currentFrameNum = grabber.getFrameNumber();
       if (processing && currentFrameNum - lastFrameWithAnalysis >= PROCESS_FREQUENCY) {

           lastFrameWithAnalysis = currentFrameNum;

           Mat frameMat = new Mat(frame, false);
           try {
               LOGGER.info("Processing :" + grabber.getFrameNumber());
               AnalysisResult result = frameAnalyzer.processFrame(frameMat, (int) currentFrameNum);
               videoAnalysisSaver.saveFrameAnalysisResult(frameMat, result, (int) currentFrameNum);
           } catch (ServerErrorException | NotExistException e) {
               LOGGER.warn(e);
           }

    In code You can see processing variable. If it’s set to false, I can watch my network streams on page with no problems. But if I set it to true, suddenly, I got visual artefacts, looking like this :

    http://answers.opencv.org/upfiles/1400931120927032.png

    And also I can see some infos on my logs :

    [libx264 @ 0x7fe2a7e2ae00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x7fe2a7e2ae00] profile High, level 4.0
    [libx264 @ 0x7fe2a7e2ae00] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1,00:0,00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=400 ratetol=1,0 qcomp=0,60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1,40 aq=1:1,00
    [mp4 @ 0x7fe2909feee0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    2015-02-02 10:34:31,986 INFO  [img.StreamGrabber] 6
    2015-02-02 10:34:31,998 INFO  [img.StreamGrabber] Processing :1
    2015-02-02 10:34:32,881 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1524, 1564, 678, 718) is above threshold
    2015-02-02 10:34:32,882 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1538, 1577, 678, 717) is above threshold
    2015-02-02 10:34:32,884 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1320, 1420, 298, 398) is above threshold
    2015-02-02 10:34:33,199 INFO  [img.StreamGrabber] 1
    2015-02-02 10:34:33,212 INFO  [img.StreamGrabber] 2
    2015-02-02 10:34:33,222 INFO  [img.StreamGrabber] 3
    2015-02-02 10:34:33,232 INFO  [img.StreamGrabber] 4
    2015-02-02 10:34:33,244 INFO  [img.StreamGrabber] 5
    2015-02-02 10:34:33,255 INFO  [img.StreamGrabber] Processing :6
    2015-02-02 10:34:33,870 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1537, 1578, 678, 719) is above threshold
    2015-02-02 10:34:33,871 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1315, 1422, 298, 405) is above threshold
    2015-02-02 10:34:34,318 INFO  [img.StreamGrabber] 6
    2015-02-02 10:34:34,338 INFO  [img.StreamGrabber] 7
    2015-02-02 10:34:34,347 INFO  [img.StreamGrabber] 8
    2015-02-02 10:34:34,357 INFO  [img.StreamGrabber] 9
    2015-02-02 10:34:34,368 INFO  [img.StreamGrabber] 10
    2015-02-02 10:34:34,379 INFO  [img.StreamGrabber] Processing :11
    2015-02-02 10:34:35,025 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1561, 1618, 477, 534) is above threshold
    2015-02-02 10:34:35,027 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1318, 1421, 300, 403) is above threshold
    2015-02-02 10:34:35,185 INFO  [img.StreamGrabber] 11
    2015-02-02 10:34:35,202 INFO  [img.StreamGrabber] 12
    2015-02-02 10:34:35,213 INFO  [img.StreamGrabber] 13
    2015-02-02 10:34:35,223 INFO  [img.StreamGrabber] 14
    2015-02-02 10:34:35,235 INFO  [img.StreamGrabber] 15
    2015-02-02 10:34:35,286 INFO  [img.StreamGrabber] Processing :16
    2015-02-02 10:34:35,952 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1429, 1470, 703, 744) is above threshold
    2015-02-02 10:34:35,954 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1315, 1422, 295, 402) is above threshold
    2015-02-02 10:34:36,218 INFO  [img.StreamGrabber] 16
    2015-02-02 10:34:36,237 INFO  [img.StreamGrabber] 17
    2015-02-02 10:34:36,246 INFO  [img.StreamGrabber] 18
    2015-02-02 10:34:36,257 INFO  [img.StreamGrabber] 19
    2015-02-02 10:34:36,268 INFO  [img.StreamGrabber] 20
    2015-02-02 10:34:36,279 INFO  [img.StreamGrabber] Processing :21
    2015-02-02 10:34:36,967 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1562, 1616, 480, 534) is above threshold
    2015-02-02 10:34:36,968 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1314, 1420, 296, 402) is above threshold
    2015-02-02 10:34:37,186 INFO  [img.StreamGrabber] 21
    2015-02-02 10:34:37,206 INFO  [img.StreamGrabber] 22
    2015-02-02 10:34:37,217 INFO  [img.StreamGrabber] 23
    2015-02-02 10:34:37,227 INFO  [img.StreamGrabber] 24
    [h264 @ 0x7fe2915b30a0] RTP: missed 1514 packets
    [h264 @ 0x7fe2f1050ea0] Cannot use next picture in error concealment
    [h264 @ 0x7fe2f1050ea0] concealing 4608 DC, 4608 AC, 4608 MV errors in P frame
    2015-02-02 10:34:37,238 INFO  [img.StreamGrabber] 25
    2015-02-02 10:34:37,250 INFO  [img.StreamGrabber] Processing :26
    2015-02-02 10:34:37,944 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1562, 1616, 479, 533) is above threshold
    2015-02-02 10:34:37,945 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1315, 1422, 297, 404) is above threshold
    2015-02-02 10:34:38,107 INFO  [img.StreamGrabber] 26
    [h264 @ 0x7fe2915b30a0] RTP: missed 295 packets
    [h264 @ 0x7fe2a5713e00] Cannot use next picture in error concealment
    [h264 @ 0x7fe2a5713e00] concealing 1996 DC, 1996 AC, 1996 MV errors in P frame
    2015-02-02 10:34:38,120 INFO  [img.StreamGrabber] 27
    2015-02-02 10:34:38,130 INFO  [img.StreamGrabber] 28
    2015-02-02 10:34:38,143 INFO  [img.StreamGrabber] 29
    2015-02-02 10:34:38,231 INFO  [img.StreamGrabber] 30
    2015-02-02 10:34:38,249 INFO  [img.StreamGrabber] Processing :31
    2015-02-02 10:34:38,962 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1170, 1211, 322, 363) is above threshold
    2015-02-02 10:34:38,964 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1316, 1421, 298, 403) is above threshold
    2015-02-02 10:34:39,329 INFO  [img.StreamGrabber] 31
    [h264 @ 0x7fe2915b30a0] RTP: missed 232 packets
    [h264 @ 0x7fe2a4203d80] Cannot use next picture in error concealment
    [h264 @ 0x7fe2a4203d80] concealing 1142 DC, 1142 AC, 1142 MV errors in P frame
    2015-02-02 10:34:39,342 INFO  [img.StreamGrabber] 32
    2015-02-02 10:34:39,352 INFO  [img.StreamGrabber] 33
    [h264 @ 0x7fe2915b30a0] RTP: missed 1 packets
    [h264 @ 0x7fe2915b43c0] corrupted macroblock 86 67 (total_coeff=-1)
    [h264 @ 0x7fe2915b43c0] error while decoding MB 86 67
    [h264 @ 0x7fe2915b43c0] Cannot use next picture in error concealment
    [h264 @ 0x7fe2915b43c0] concealing 83 DC, 83 AC, 83 MV errors in P frame
    2015-02-02 10:34:39,362 INFO  [img.StreamGrabber] Processing :144
    2015-02-02 10:34:40,071 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1563, 1614, 480, 531) is above threshold
    2015-02-02 10:34:40,074 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1318, 1423, 296, 401) is above threshold
    2015-02-02 10:34:40,462 INFO  [img.StreamGrabber] 144
    2015-02-02 10:34:40,482 INFO  [img.StreamGrabber] 145
    [h264 @ 0x7fe2915b30a0] RTP: missed 377 packets
    [h264 @ 0x7fe2a515baa0] Cannot use next picture in error concealment
    [h264 @ 0x7fe2a515baa0] concealing 6822 DC, 6822 AC, 6822 MV errors in P frame
    2015-02-02 10:34:40,494 INFO  [img.StreamGrabber] Processing :167
    2015-02-02 10:34:41,222 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1563, 1615, 479, 531) is above threshold
    2015-02-02 10:34:41,230 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1319, 1421, 295, 397) is above threshold
    2015-02-02 10:34:41,930 INFO  [img.StreamGrabber] 167
    2015-02-02 10:34:41,947 INFO  [img.StreamGrabber] 168
    2015-02-02 10:34:41,958 INFO  [img.StreamGrabber] 169
    2015-02-02 10:34:41,970 INFO  [img.StreamGrabber] 170
    2015-02-02 10:34:41,985 INFO  [img.StreamGrabber] 171
    [h264 @ 0x7fe2915b30a0] RTP: missed 311 packets
    [h264 @ 0x7fe2f10506c0] Cannot use next picture in error concealment
    [h264 @ 0x7fe2f10506c0] concealing 1409 DC, 1409 AC, 1409 MV errors in P frame
    2015-02-02 10:34:41,997 INFO  [img.StreamGrabber] Processing :190
    2015-02-02 10:34:42,715 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1322, 1384, 340, 402) is above threshold
    2015-02-02 10:34:42,717 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1312, 1425, 290, 403) is above threshold
    2015-02-02 10:34:42,929 INFO  [img.StreamGrabber] 190
    [h264 @ 0x7fe2915b30a0] RTP: missed 13 packets
    [h264 @ 0x7fe2f1050ea0] Cannot use next picture in error concealment
    [h264 @ 0x7fe2f1050ea0] concealing 6489 DC, 6489 AC, 6489 MV errors in P frame
    2015-02-02 10:34:42,943 INFO  [img.StreamGrabber] 191
    [h264 @ 0x7fe2915b30a0] RTP: missed 484 packets
    [h264 @ 0x7fe2915b43c0] concealing 6609 DC, 6609 AC, 6609 MV errors in I frame
    2015-02-02 10:34:42,957 INFO  [img.StreamGrabber] 192
    2015-02-02 10:34:42,970 INFO  [img.StreamGrabber] 193
    [h264 @ 0x7fe2915b30a0] RTP: missed 313 packets
    [h264 @ 0x7fe2a51a0fc0] Cannot use next picture in error concealment
    [h264 @ 0x7fe2a51a0fc0] concealing 1666 DC, 1666 AC, 1666 MV errors in P frame
    2015-02-02 10:34:43,271 INFO  [img.StreamGrabber] 194
    2015-02-02 10:34:43,314 INFO  [img.StreamGrabber] Processing :249
    2015-02-02 10:34:44,099 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1322, 1384, 340, 402) is above threshold
    2015-02-02 10:34:44,100 INFO  [img.analysis.face.PersonFaceRecognizer] Predicted face (1313, 1403, 300, 390) is above threshold
    2015-02-02 10:34:45,473 INFO  [img.save.event.EventMaker] Creating 1 face recognition events
    2015-02-02 10:34:45,618 INFO  [core.task.StreamRecordingTaskExecutor] Stream recording task ended: rtsp://MYURL

    My guess is, that my computer is simply too busy to catch all packages from camera stream. I’m operating on two streams, one is low quality with like 3 fps, and other is 30. Of course problems show up all the time on fast one, and rarely on slow stream.
    I’m wondering if there is possibility to force somehow FFmpegFrameGraber not to create artifacts, but simply drop current frame and go to next one ? Fps and frame continuity is not so important. I was trying to use grabber’s setfps, settimestamp, delayedGrab method’s to somehow slow down 30-fps stream, but it didn’t even react to that. I’m sure I’m doing something wrong.

    I’ve found some topics related to my problem, but they did not helped me, maybe You will see more :
    http://answers.opencv.org/question/34012/ip-camera-h264-error-while-decoding/
    How to deal with cv::VideoCapture decode errors ?
    http://superuser.com/questions/663928/ffmpeg-to-capture-stills-from-h-264-stream

    Thank You for Your help.

  • Paperclip-ffmpeg not working on Rails

    28 juillet 2013, par Lee7355512727

    I installed Paperclip-ffmpeg and tried to upload a flv file, but it seems there are some problems converting the file.

    I added Paperclip.options[:command_path] = "/usr/bin/" (I got the path by using which ffmpeg) to my config/environments/development.rb file, following the instructions on the paperclip-ffmpeg github page.

    Here is my model subquestion.rb, which contains a paperclip field called qflv :

    class Subquestion < ActiveRecord::Base
       belongs_to :question
       has_many :qimages , :dependent =>  :destroy

       has_attached_file :qflv, styles: {
           medium: {geometry: "640*480", format: 'flv'},
           thumb: {geometry: "100*100#", format: 'jpg', time: 10}
       }, processors: [:ffmpeg]

    And here is my _subquestion_fields.html.erb file, where users upload videos :

    <%= f.file_field :qflv %>

    _subquestion_fields.html.erb is rendered by question.html.erb file :

    <%= nested_form_for @question, :url => {:action => 'create_question'} do |f| %>
          <%= f.fields_for :subquestions do |builder| %>
          <%= render 'subquestion_fields', :f => builder %>

    And here is part of the error message :

    WARNING: gnome-keyring:: couldn't connect to: /run/user/li/keyring-CsW4u8/pkcs11: No such file or directory
    ffmpeg version 0.8.6-6:0.8.6-1ubuntu2, Copyright (c) 2000-2013 the Libav developers
     built on Mar 30 2013 22:23:21 with gcc 4.7.2
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    [flv @ 0x8ba50a0] Estimating duration from bitrate, this may be inaccurate
    Input #0, flv, from '/tmp/03000201005171FC8274A20623ECA86B119768-56C7-7A62-DB7A-A4B599F64EE720130727-1837-13757l9.flv':
     Metadata:
       metadatacreator : modified by youku.com in 20111202
       hasKeyframes    : true
       hasVideo        : true
       hasAudio        : true
       hasMetadata     : true
     Duration: 00:05:25.03, start: 0.000000, bitrate: N/A
       Stream #0.0: Video: h264 (High), yuv420p, 448x336 [PAR 1:1 DAR 4:3], 15 tbr, 1k tbn, 30 tbc
       Stream #0.1: Audio: aac, 44100 Hz, stereo, s16
    Incorrect frame size
    Failed to set value '0x0' for option 's'
    WARNING: gnome-keyring:: couldn't connect to: /run/user/li/keyring-CsW4u8/pkcs11: No such file or directory
    ffmpeg version 0.8.6-6:0.8.6-1ubuntu2, Copyright (c) 2000-2013 the Libav developers
     built on Mar 30 2013 22:23:21 with gcc 4.7.2
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    [flv @ 0x86490a0] Estimating duration from bitrate, this may be inaccurate
    Input #0, flv, from '/tmp/03000201005171FC8274A20623ECA86B119768-56C7-7A62-DB7A-A4B599F64EE720130727-1837-13757l9.flv':
     Metadata:
       metadatacreator : modified by youku.com in 20111202
       hasKeyframes    : true
       hasVideo        : true
       hasAudio        : true
       hasMetadata     : true
     Duration: 00:05:25.03, start: 0.000000, bitrate: N/A
       Stream #0.0: Video: h264 (High), yuv420p, 448x336 [PAR 1:1 DAR 4:3], 15 tbr, 1k tbn, 30 tbc
       Stream #0.1: Audio: aac, 44100 Hz, stereo, s16
    Incompatible pixel format 'yuv420p' for codec 'mjpeg', auto-selecting format 'yuvj420p'
    [buffer @ 0x864c180] w:448 h:336 pixfmt:yuv420p
    [scale @ 0x8653840] w:448 h:336 fmt:yuv420p -> w:448 h:336 fmt:yuvj420p flags:0x4
    [crop @ 0x864dc20] w:448 h:336 -> w:0 h:0
    [crop @ 0x864dc20] Invalid too big or non positive size for width '0' or height '0'
    Error opening filters!


    Started POST "/test_geisinger/roots/questions/create" for 127.0.0.1 at 2013-07-27 23:12:31 -0400
    Processing by RootsController#create_question as HTML
     Parameters: {"utf8"=>"✓", "authenticity_token"=>"EiJk5dBf1nL96BtUiKc0qALCg0Bj9mQ0dx9IodfYdO0=", "question"=>{"explanation"=>"flv", "choice_id"=>"8", "correct_selection_id"=>"32", "quiz_id"=>"10", "subquestions_attributes"=>{"0"=>{"subquestion_type"=>"flv", "_destroy"=>"false", "qflv"=>#x-flv\r\n", @tempfile=#tmp/RackMultipart20130727-1837-1f6g2s0>>}}}, "commit"=>"Submit"}
    [paperclip] [ffmpeg] ffmpeg -i "/tmp/03000201005171FC8274A20623ECA86B119768-56C7-7A62-DB7A-A4B599F64EE720130727-1837-13757l9.flv" 2>&1
    [paperclip] [ffmpeg] Command Success
    [paperclip] [ffmpeg] Making...
    [paperclip] [ffmpeg] Building Destination File: '03000201005171FC8274A20623ECA86B119768-56C7-7A62-DB7A-A4B599F64EE720130727-1837-13757l9' + 'flv'
    [paperclip] [ffmpeg] Destination File Built
    [paperclip] [ffmpeg] Adding Geometry
    [paperclip] [ffmpeg] Extracting Target Dimensions
    [paperclip] [ffmpeg] Target Size is Available
    [paperclip] [ffmpeg] Keeping Aspect Ratio
    [paperclip] [ffmpeg] Resize
    [paperclip] [ffmpeg] Convert Options: 0x0
    [paperclip] [ffmpeg] Adding Format
    [paperclip] [ffmpeg] Adding Source
    [paperclip] [ffmpeg] Building Parameters
    [paperclip] [ffmpeg] -i :source -s 0x0 -y :dest
    Command :: ffmpeg -i '/tmp/03000201005171FC8274A20623ECA86B119768-56C7-7A62-DB7A-A4B599F64EE720130727-1837-13757l9.flv' -s 0x0 -y '/tmp/03000201005171FC8274A20623ECA86B119768-56C7-7A62-DB7A-A4B599F64EE720130727-1837-13757l920130727-1837-11o3enh.flv'
    [paperclip] An error was received while processing: #tmp/03000201005171FC8274A20623ECA86B119768-56C7-7A62-DB7A-A4B599F64EE720130727-1837-13757l9.flv' -s 0x0 -y '/tmp/03000201005171FC8274A20623ECA86B119768-56C7-7A62-DB7A-A4B599F64EE720130727-1837-13757l920130727-1837-11o3enh.flv'' returned 1. Expected 0

    There might be some problems with pkcs11 so I found this article :

    https://bugzilla.redhat.com/show_bug.cgi?id=783568

    But I could not find /etc/xdg/autostart/gnome-keyring-*.desktop.

    Thank you !