Recherche avancée

Médias (0)

Mot : - Tags -/metadatas

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

Autres articles (51)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

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

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

  • FFMPEG : RTSP to HLS restream stops with "No more output streams to write to, finishing."

    1er juin 2022, par Tim W

    I'm trying to do a live restream an RTSP feed from a webcam using ffmpeg, but the stream repeatedly stops with the error :

    



    "No more output streams to write to, finishing."

    



    The problem seems to get worse at higher bitrates (256kbps is mostly reliable) and is pretty random in its occurrence. At 1mbps, sometimes the stream will run for several hours without any trouble, on other occasions the stream will fail every few minutes. I've got a cron job running which restarts the stream automatically when it fails, but I would prefer to avoid the continued interruptions.

    



    I have seen this problem reported in a handful of other forums, so this is not a unique problem, but not one of those reports had a solution attached to it. My ffmpeg command looks like this :

    



    ffmpeg -loglevel verbose -r 25 -rtsp_transport tcp -i rtsp ://user:password@camera.url/live/ch0 -reset_timestamps 1 -movflags frag_keyframe+empty_moov -bufsize 7168k -stimeout 60000 -hls_flags temp_file -hls_time 5 -hls_wrap 180 -acodec copy -vcodec copy streaming.m3u8 > encode.log 2>&1

    



    What gets me is that the error makes no sense, this is a live stream so output is always wanted until I shut off the stream. So having it shut down because output isn't wanted is downright odd. If ffmpeg was complaining because of a problem with input it would make more sense.

    



    I'm running version 3.3.4, which I believe is the latest.

    



    Update 13 Oct 17 :

    



    After extensive testing I've established that "No more outputs" error message generated by FFMPEG is very misleading. The error seems to be generated if the data coming in from RTSP is delayed, eg by other activity on the router the camera is connected via. I've got a large buffer and timeout set which should be sufficient for 60 seconds, but I can still deliberately trigger this error with far shorter interruptions, so clearly the buffer and timeout aren't having the desired effect. This might be fixed by setting a QOS policy on the router and by checking that the TCP packets from the camera have a suitably high priority set, it's possible this isn't the case.

    



    However, I would still like to improve the robustness of the input stream if it is briefly interrupted. Is there any way to persuade FFMPEG to tolerate this or to actually make use of the buffer it seems to be ignoring ? Can FFMPEG be persuaded to simply stop writing output and wait for input to become available rather than bailing out ? Or could I get FFMPEG to duplicate the last complete frame until it's able to get more data ? I can live with the stream stuttering a bit, but I've got to significantly reduce the current behaviour where the stream drops at the slightest hint of a problem.

    



    Further update 13 Oct 2017 :

    



    After more tests, I've found that the problem actually seems to be that HLS is incapable of coping with a discontinuity in the incoming video stream. If I deliberately cut the network connection between the camera and FFMPEG, FFMPEG will wait for the connection to be re-established for quite a long time. If the interruption was long (>10 seconds) the stream will immediately drop with the "No More Outputs" error the instant that the connection is re-established. If the interruption is short, then RTSP will actually start pulling data from the camera again, but the stream will then drop with the same error a few seconds later. So it seems clear that the gap in the input data is causing the HLS encoder to have a fit and give up once the stream is resumed, but the size of the gap has an impact on whether the drop is instant or not.

    


  • Too large number of skipped frames. FFMPEG, C program

    27 novembre 2017, par gogoer

    I’m writing program on C to capture RTSP stream and write it to files.
    But after some time i get errors :

    Too large number of skipped frames xxxx > 60000

    After this files become incorrect and very small size.
    What the reason of it and how can o fix this problems ?

    a piece of code, where i capture frames and put them to buffer.

           ofmt = av_guess_format( NULL, sFileOutput, NULL );
           ofcx = avformat_alloc_context();
           ofcx->oformat = ofmt;
           int ret2=avio_open( &ofcx->pb, sFileOutput, AVIO_FLAG_WRITE);
           if(ret2<0){
               fprintf(stderr, "\nError occurred when opening output file: %s\n",av_err2str(ret2));
           }

           ost = avformat_new_stream( ofcx, NULL );
           avcodec_copy_context( ost->codec, iccx );

           ost->sample_aspect_ratio.num = iccx->sample_aspect_ratio.num;
           ost->sample_aspect_ratio.den = iccx->sample_aspect_ratio.den;

           ost->r_frame_rate = ist->r_frame_rate;
           ost->avg_frame_rate = ost->r_frame_rate;
           ost->time_base = av_inv_q( ost->r_frame_rate );
           ost->codec->time_base = ost->time_base;
           ost->codec->width = 1280;
           ost->codec->height = 800;

           av_init_packet( &pkt );

           while ( av_read_frame( ifcx, &pkt ) >= 0 && start_flag==0 && stop_flag==0){
               if ( pkt.stream_index == i_index ) {
                   pkt.stream_index = ost->id;
                   pkt.pts = av_rescale_q_rnd(pkt.pts, ist->time_base, ost->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
                   pkt.dts = av_rescale_q_rnd(pkt.dts, ist->time_base, ost->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
                   pkt.duration = av_rescale_q(pkt.duration, ist->time_base, ost->time_base);
                   pkt.pos = -1;
                   av_copy_packet(&pkt_arr[pkg_index],&pkt);
               }
               av_free_packet( &pkt );
               av_init_packet( &pkt );
               pkg_index++;

               if(pkg_index>=bufer_size){
                   pkg_index=pkg_index-bufer_size;
               }
           }
  • How to acheive 1x writing speed for 4K encoding in ffmpeg ?

    11 octobre 2017, par Anand92

    Is it possible to encode 4K asset in 1x writing speed ?

    Below are our encoding commands and details of CPU, source assets, and encoding command output :

    Encoding command

    ffmpeg -i 4K_Source.mp4 -c:v libx265 -preset ultrafast
       -x265-params fps=60:profile=main:min-keyint=60:crf=19 -vf "scale=3840:2160"
       -sc_threshold 0 4K_UF_3840x2160_CRF19.mp4

    Source Asset Details

    Overall bit rate mode      : Constant
    Overall bit rate           : 51.6 Mb/s
    Format                     : HEVC
    Format/Info                : High Efficiency Video Coding
    Format profile             : Main 10@L5.1@High
    Duration                   : 1 min 33 s
    Width                      : 3 840 pixels
    Height                     : 2 160 pixels
    Display aspect ratio       : 16:9
    Frame rate                 : 59.940 (60000/1001) FPS

    CPU details

    Intel(R) Xeon(R) CPU E7-8870 v3 @ 2.10GHz (144 core)

    FFMPEG command output

    ffmpeg version 3.2.4-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.1 (Debian 5.4.1-5) 20170205
     configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
     libavutil      55. 34.101 / 55. 34.101
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.101 / 57. 56.101
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    [mpegts @ 0x3a2b600] start time for stream 1 is not set in estimate_timings_from_pts
    [mpegts @ 0x3a2b600] Could not find codec parameters for stream 1 (Audio:  
    aac ([15][0][0][0] / 0x000F), 0 channels, fltp): unspecified sample rate
    Consider increasing the value for the 'analyzeduration' and 'probesize'  
    options
    Input #0, mpegts, from 'Samsung_SUHD_Colorful_Food.mp4':
     Duration: 00:01:33.11, start: 1.050044, bitrate: 52076 kb/s
     Program 1
       Stream #0:0[0x101]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv), 3840x2160 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k  
    tbn, 59.94 tbc
       Stream #0:1[0x102](und): Audio: aac ([15][0][0][0] / 0x000F), 0 channels, fltp
    [libx265 @ 0x3a53d40] Unknown option: profile.
    x265 [info]: HEVC encoder version 2.2ßfe2f2dd96f8c
    x265 [info]: build info [Linux][GCC 5.4.1][64 bit] 10bit
    x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    x265 [info]: Main 10 profile, Level-5.1 (Main tier)
    x265 [info]: Thread pool 0 using 64 threads on numa nodes 0,1,2,3
    x265 [info]: Thread pool 1 using 64 threads on numa nodes 0,1,2,3
    x265 [info]: Slices                              : 1
    x265 [info]: frame threads / pool features       : 8 / wpp(68 rows)
    x265 [info]: Coding QT: max CU size, min CU size : 32 / 16
    x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
    x265 [info]: ME / range / subpel / merge         : dia / 57 / 0 / 2
    x265 [info]: Keyframe min / max / scenecut / bias: 60 / 250 / 0 / 5.00
    x265 [info]: Lookahead / bframes / badapt        : 5 / 3 / 0
    x265 [info]: b-pyramid / weightp / weightb       : 1 / 0 / 0
    x265 [info]: References / ref-limit  cu / depth  : 1 / off / off
    x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 0.0 / 32 / 1
    x265 [info]: Rate Control / qCompress            : CRF-19.0 / 0.60
    x265 [info]: tools: rd=2 psy-rd=2.00 early-skip rskip tmvp fast-intra
    x265 [info]: tools: strong-intra-smoothing lslices=8 deblock
    Output #0, mp4, to 'Samsung_UF_3840x2160_CRF19.mp4':
     Metadata:
       encoder         : Lavf57.56.101
       Stream #0:0: Video: hevc (libx265) ([35][0][0][0] / 0x0023), yuv420p10le, 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 59.94 fps, 60k tbn, 59.94 tbc
       Metadata:
         encoder         : Lavc57.64.101 libx265
    Stream mapping:
     Stream #0:0 -> #0:0 (hevc (native) -> hevc (libx265))
    Press [q] to stop, [?] for help
    frame= 5581 fps= 20 q=-0.0 Lsize=  212585kB time=00:01:33.05
    bitrate=18713.8kbits/s speed=0.336x
    video:212514kB audio:0kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 0.033184%
    x265 [info]: frame I:     23, Avg QP:24.29  kb/s: 133747.47
    x265 [info]: frame P:   1401, Avg QP:26.43  kb/s: 31994.19
    x265 [info]: frame B:   4157, Avg QP:29.67  kb/s: 13602.20
    x265 [info]: consecutive B-frames: 1.3% 1.4% 1.5% 95.9%
    encoded 5581 frames in 276.59s (20.18 fps), 18714.28 kb/s, Avg QP:28.83

    The encoding speed we get is 0.3x only. we are trying encode HEVC codec asset to HEVC codec itself with 4K resolution in 1x writing speed.

    Are we missing any parameters in ffmpeg command which can tweak encoding speed ?