Recherche avancée

Médias (91)

Autres articles (79)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

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

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (11638)

  • ffmpeg stops randomly with "No more output streams to write to, finishing" when reading rtsp stream [on hold]

    7 juin 2016, par ImagineDragon

    Basically I am running the following ffmpeg command to read an h264 rtsp stream using hls muxer, under Ubuntu 14.04 64bit with i7 CPU and 8GB memory :

    ffmpeg -v debug -i rtsp://172.16.11.247:554/live/ch00_0?token=hQttXvrjSPOcClQB -codec copy -flags -global_header -f hls -hls_time 5 -use_localtime 1 -hls_segment_filename '/home/eason/ffmpeg-test/%s.ts' '/home/eason/ffmpeg-test/live.m3u8'
    ffmpeg version N-79139-gde1a0d4 Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
     configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab
     libavutil      55. 19.100 / 55. 19.100
     libavcodec     57. 30.100 / 57. 30.100
     libavformat    57. 29.101 / 57. 29.101
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 40.102 /  6. 40.102
     libavresample   3.  0.  0 /  3.  0.  0
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    Splitting the commandline.
    Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
    Reading option '-re' ... matched as option 're' (read input at native frame rate) with argument '1'.
    Reading option '-i' ... matched as input file with argument 'rtsp://172.16.11.247:554/live/ch00_0?token=hQttXvrjSPOcClQB'.
    Reading option '-codec' ... matched as option 'codec' (codec name) with argument 'copy'.
    Reading option '-flags' ... matched as AVOption 'flags' with argument '-global_header'.
    Reading option '-f' ... matched as option 'f' (force format) with argument 'hls'.
    Reading option '-hls_time' ... matched as AVOption 'hls_time' with argument '5'.
    Reading option '-use_localtime' ... matched as AVOption 'use_localtime' with argument '1'.
    Reading option '-hls_segment_filename' ... matched as AVOption 'hls_segment_filename' with argument '/home/eason/ffmpeg-test/%s.ts'.
    Reading option '/home/eason/ffmpeg-test/live.m3u8' ... matched as output file.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option v (set logging level) with argument debug.
    Successfully parsed a group of options.
    Parsing a group of options: input file rtsp://172.16.11.247:554/live/ch00_0?token=hQttXvrjSPOcClQB.
    Applying option re (read input at native frame rate) with argument 1.
    Successfully parsed a group of options.
    Opening an input file: rtsp://172.16.11.247:554/live/ch00_0?token=hQttXvrjSPOcClQB.
    [tcp @ 0x29c4d60] No default whitelist set
    [rtsp @ 0x29c2e20] SDP:
    m=video 0 RTP/AVP 96
    a=rtpmap:96 H264/90000
    a=fmtp:96 packetization-mode=1;profile-level-id=640028;sprop-parameter-sets=Z2QAKKzoBQBbkA==,aO48sA==
    a=control:trackID=0
    m=audio 0 RTP/AVP 98
    a=rtpmap:98 MPEG4-GENERIC/16000/1
    a=fmtp:98 profile-level-id=1;mode=AAC-lbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1408;cpresent=0;
    a=control:trackID=1


    [rtsp @ 0x29c2e20] video codec set to: h264
    [rtsp @ 0x29c2e20] RTP Packetization Mode: 1
    [rtsp @ 0x29c2e20] RTP Profile IDC: 64 Profile IOP: 0 Level: 28
    [rtsp @ 0x29c2e20] Extradata set to 0x29c4ff0 (size: 22)
    [rtsp @ 0x29c2e20] audio codec set to: aac
    [rtsp @ 0x29c2e20] audio samplerate set to: 16000
    [rtsp @ 0x29c2e20] audio channels set to: 1
    [rtp @ 0x29c50a0] No default whitelist set
    [udp @ 0x29c5200] No default whitelist set
    [udp @ 0x29c5200] end receive buffer size reported is 131072
    [udp @ 0x29d9480] No default whitelist set
    [udp @ 0x29d9480] end receive buffer size reported is 131072
    [rtsp @ 0x29c2e20] method SETUP failed: 461 Unsupported transport
    [rtsp @ 0x29c2e20] CSeq: 3

    [rtsp @ 0x29c2e20] setting jitter buffer size to 0
       Last message repeated 1 times
    [rtsp @ 0x29c2e20] hello state=0
    [rtsp @ 0x29c2e20] All info found
    [rtsp @ 0x29c2e20] rfps: 24.250000 0.018062
    [rtsp @ 0x29c2e20] rfps: 24.333333 0.012911
    [rtsp @ 0x29c2e20] rfps: 24.416667 0.008627
    [rtsp @ 0x29c2e20] rfps: 24.500000 0.005207
       Last message repeated 1 times
    [rtsp @ 0x29c2e20] rfps: 24.583333 0.002653
       Last message repeated 1 times
    [rtsp @ 0x29c2e20] rfps: 24.666667 0.000965
       Last message repeated 1 times
    [rtsp @ 0x29c2e20] rfps: 24.750000 0.000142
       Last message repeated 1 times
    [rtsp @ 0x29c2e20] rfps: 24.833333 0.000185
       Last message repeated 1 times
    [rtsp @ 0x29c2e20] rfps: 24.916667 0.001093
       Last message repeated 1 times
    [rtsp @ 0x29c2e20] rfps: 25.000000 0.002867
       Last message repeated 1 times
    [rtsp @ 0x29c2e20] rfps: 25.083333 0.005507
       Last message repeated 1 times
    [rtsp @ 0x29c2e20] rfps: 25.166667 0.009011
    [rtsp @ 0x29c2e20] rfps: 25.250000 0.013382
    [rtsp @ 0x29c2e20] rfps: 25.333333 0.018618
    [rtsp @ 0x29c2e20] rfps: 50.000000 0.011469
    Input #0, rtsp, from 'rtsp://172.16.11.247:554/live/ch00_0?token=hQttXvrjSPOcClQB':
     Duration: N/A, start: 0.000000, bitrate: N/A
       Stream #0:0, 28, 1/90000: Video: h264 (High), 1 reference frame, yuv420p(left), 1280x720, 1/180000, 24.75 tbr, 90k tbn, 180k tbc
       Stream #0:1, 23, 1/16000: Audio: aac (LC), 16000 Hz, mono, fltp
    Successfully opened the file.
    Parsing a group of options: output file /home/eason/ffmpeg-test/live.m3u8.
    Applying option codec (codec name) with argument copy.
    Applying option f (force format) with argument hls.
    Successfully parsed a group of options.
    Opening an output file: /home/eason/ffmpeg-test/live.m3u8.
    Successfully opened the file.
    [file @ 0x2cae180] Setting default whitelist 'file,crypto'
    [mpegts @ 0x29f7ce0] muxrate VBR, pcr every 9000 pkts, sdt every 2147483647, pat/pmt every 2147483647 pkts
    Output #0, hls, to '/home/eason/ffmpeg-test/live.m3u8':
     Metadata:
       encoder         : Lavf57.29.101
       Stream #0:0, 0, 1/90000: Video: h264, 1 reference frame, yuv420p(left), 1280x720 (0x0), 1/90000, q=2-31, 24.75 tbr, 90k tbn, 90k tbc
       Stream #0:1, 0, 1/90000: Audio: aac (LC), 16000 Hz, mono
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
       Last message repeated 103 times
    [hls @ 0x2a0fc00] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
    [AVIOContext @ 0x2c998c0] Statistics: 0 seeks, 155 writeouts=N/A speed=1.01x    
    [file @ 0x2ba60e0] Setting default whitelist 'file,crypto'
    [file @ 0x2ca9fc0] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:0
    [AVIOContext @ 0x2caa080] Statistics: 0 seeks, 1 writeouts
    [AVIOContext @ 0x2c99480] Statistics: 0 seeks, 103 writeouts=N/A speed=   1x    
    [file @ 0x2ba60e0] Setting default whitelist 'file,crypto'
    [file @ 0x2c97c60] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:0
    [AVIOContext @ 0x2c97d20] Statistics: 0 seeks, 1 writeouts
    [AVIOContext @ 0x2c99480] Statistics: 0 seeks, 104 writeouts=N/A speed=   1x    
    [file @ 0x2ba60e0] Setting default whitelist 'file,crypto'
    [file @ 0x2c99680] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:0
    [AVIOContext @ 0x2c99820] Statistics: 0 seeks, 1 writeouts
    [AVIOContext @ 0x2c99480] Statistics: 0 seeks, 28 writeoutse=N/A speed=   1x    
    [file @ 0x29c50c0] Setting default whitelist 'file,crypto'
    [file @ 0x2ba60e0] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:0
    [AVIOContext @ 0x29c2ce0] Statistics: 0 seeks, 1 writeouts
    [AVIOContext @ 0x2c99480] Statistics: 0 seeks, 111 writeouts=N/A speed=   1x    
    [file @ 0x2c97d40] Setting default whitelist 'file,crypto'
    [file @ 0x2a134e0] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:0
    [AVIOContext @ 0x2a11000] Statistics: 0 seeks, 1 writeouts
    [AVIOContext @ 0x2c99480] Statistics: 0 seeks, 105 writeouts=N/A speed=   1x    
    [file @ 0x29c50c0] Setting default whitelist 'file,crypto'
    [file @ 0x2a10c00] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:1
    [AVIOContext @ 0x2a10cc0] Statistics: 0 seeks, 1 writeouts
    [AVIOContext @ 0x2c99480] Statistics: 0 seeks, 103 writeouts=N/A speed=   1x    
    [file @ 0x29c50c0] Setting default whitelist 'file,crypto'
    [file @ 0x2c99480] Setting default whitelist 'file,crypto'

    .......repeat........

    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:71
    [AVIOContext @ 0x2c97fa0] Statistics: 0 seeks, 1 writeouts
    [rtsp @ 0x29c2e20] Too short data for FU-A H264 RTP packette=N/A speed=   1x    
    [AVIOContext @ 0x2ba60e0] Statistics: 0 seeks, 103 writeouts=N/A speed=   1x    
    [file @ 0x2c97b20] Setting default whitelist 'file,crypto'
    [file @ 0x2c97c60] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:72
    [AVIOContext @ 0x2c99480] Statistics: 0 seeks, 1 writeouts
    [AVIOContext @ 0x2ba60e0] Statistics: 0 seeks, 156 writeouts=N/A speed=   1x    
    [file @ 0x2c99480] Setting default whitelist 'file,crypto'
    [file @ 0x2cab600] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:73
    [AVIOContext @ 0x2cab6c0] Statistics: 0 seeks, 1 writeouts
    [AVIOContext @ 0x2ba60e0] Statistics: 0 seeks, 104 writeouts=N/A speed=   1x    
    [file @ 0x2cadc00] Setting default whitelist 'file,crypto'
    [file @ 0x2c99480] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:74
    [AVIOContext @ 0x29c2ce0] Statistics: 0 seeks, 1 writeouts
    [AVIOContext @ 0x2ba60e0] Statistics: 0 seeks, 103 writeouts=N/A speed=   1x    
    [file @ 0x2a13540] Setting default whitelist 'file,crypto'
    [file @ 0x2cab680] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:75
    [AVIOContext @ 0x2c99480] Statistics: 0 seeks, 1 writeouts
    No more output streams to write to, finishing.:46.09 bitrate=N/A speed=0.993x    
    [AVIOContext @ 0x2ba60e0] Statistics: 0 seeks, 138 writeouts
    [file @ 0x29c50c0] Setting default whitelist 'file,crypto'
    [hls @ 0x2a0fc00] EXT-X-MEDIA-SEQUENCE:76
    [AVIOContext @ 0x2ba60e0] Statistics: 0 seeks, 1 writeouts
    frame= 8423 fps= 21 q=-1.0 Lsize=N/A time=00:06:46.09 bitrate=N/A speed=0.993x    
    video:37031kB audio:1586kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Input file #0 (rtsp://172.16.11.247:554/live/ch00_0?token=hQttXvrjSPOcClQB):
     Input stream #0:0 (video): 8423 packets read (37919815 bytes);
     Input stream #0:1 (audio): 6345 packets read (1624337 bytes);
     Total: 14768 packets (39544152 bytes) demuxed
    Output file #0 (/home/eason/ffmpeg-test/live.m3u8):
     Output stream #0:0 (video): 8423 packets muxed (37919815 bytes);
     Output stream #0:1 (audio): 6345 packets muxed (1624337 bytes);
     Total: 14768 packets (39544152 bytes) muxed
    0 frames successfully decoded, 0 decoding errors

    The problem is that ffmpeg exits randomly after 5 to 20 minutes. The RTSP is a live stream so stopping every 5 minute is really not acceptable. In the ffmpeg log I can’t see any noticeable error except "No more output streams to write to, finishing." near the end. Can someone shed some light upon this ? How can I make ffmpeg run without stopping ? Thanks

  • ffmpeg mp4 x264 encoding -> playback causes "pending" in both Chrome and IE causing 10+ seconds delay

    26 novembre 2015, par user1978645

    After encoding a video to mp4(x264 with aac) ; I have the following weird behaviour in both crome and IE :

    Im serving the content from https with spdy enables.

    It takes up to 30 seconds before the video is actually played, in the mean time i cannot reload the page it shows up as "pending". (even after i have visual on the video sometimes it takes 10-20 seconds before i can actually reload the page, or navigate to another url on the same domain)

    After looking at the "network" tab in developer tools, i see the following requests for 1 page/video :

    Path        Method Status   Type         Initiator   Size/content  Time/latency
    video.mp4   GET    206 OK   video/mp4    other       32.3KB/32.0kb  600ms/339MS
    video.mp4   GET    206 OK   video/mp4    other       123kb/123b     21.85s/21.46s
    video.mp4   GET    206 OK   video/mp4    other       7.1MB/7.2MB    1.4min/2ms

    I tried to isolate the problem, When i use an mp4 video from the internet (for example the demo video of jplayer) and load it from my server, it loads rapidly, without delays.

    So it makes me think the problem lies within the encoding. I tried various things.
    FFmpeg :

    • csr 69 (low quality)

    • various options

    HTML :

    • preload="none"

    • javascript loading/playing of the movie

    • type=’mp4/video’

    • no posterimage

    But i cannot resolve the problem. Does anyone have a clue what is causing this ?

    I have a download speed of 300kb/s and the movie is 6MB.

    After the video starts, the video isn’t fully buffered, so i wonder : What is the html5 videoplayer doing all this time ?

    The problem also blocks the connections. When i press "F5" in both chrome and IE the page beeing reloaded comes up in the network tab as "pending" and it can take 10 to 20 seconds before the page actually reloads.

    ffmpeg command : (i used various commands but this is just 1 example which causes the problem)

    /root/bin/ffmpeg    -threads 1 -y  -i /home/flirtzo/public_html//userfiles/files/94e76a18a7838e62ecb23cf0c374b1b798e7b936  -threads 0 -codec:a libfdk_aac -b:a 128k  -vf "scale=-2:320" -preset veryslow -vcodec h264 -acodec aac -strict -2  /home/flirtzo/public_html/userfiles/files/b2/72/695f4eba95169a3f29564bf9571c703b05f1b5974f5156da633eb139c80a1575452e2858dfc61cc82bfca02d2b156aa64d4503695756481dc2a5d1c673a4cdea-94e76a18a7838e62ecb23cf0c374b1b798e7b936.mp4

    Output :

    ffmpeg version git-2014-04-16-c150e2c Copyright (c) 2000-2014 the FFmpeg developers
     built on Sep 28 2014 21:08:17 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-4)
     configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-        ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-nonfree -    -enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-    libx264
     libavutil      52. 76.100 / 52. 76.100
     libavcodec     55. 58.103 / 55. 58.103
     libavformat    55. 37.100 / 55. 37.100
     libavdevice    55. 13.100 / 55. 13.100
     libavfilter     4.  4.100 /  4.  4.100
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mpeg, from         '/home/flirtzo/public_html//userfiles/files/94e76a18a7838e62ecb23cf0c374b1b798e7b936':
     Duration: 00:00:25.97, start: 0.340078, bitrate: 29004 kb/s
       Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p(tv), 352x240 [SAR 200:219 DAR 880:657], 1150     kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
       Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16p, 224 kb/s
    [libx264 @ 0x2b189c0] using SAR=1199/1314
    [libx264 @ 0x2b189c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x2b189c0] profile High, level 1.3
    [libx264 @ 0x2b189c0] 264 - core 142 r2 d6b4e63 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 -     http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex     subme=4 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0     deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=1 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=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0     rc_lookahead=20 rc=crf mbtree=1 crf=51.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to     '/home/flirtzo/public_html/userfiles/files/b2/72/695f4eba95169a3f29564bf9571c703b05f1b5974f5156da633e    b139c80a1575452e2858dfc61cc82bfca02d2b156aa64d4503695756481dc2a5d1c673a4cdea-    94e76a18a7838e62ecb23cf0c374b1b798e7b936.mp4':
     Metadata:
       encoder         : Lavf55.37.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 320x218 [SAR 1199:1314        DAR 880:657], q=-1--1, 30k tbn, 29.97 tbc
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (mpeg1video -> libx264)
     Stream #0:1 -> #0:1 (mp2 -> aac)
    Press [q] to stop, [?] for help
    frame=16127 fps=786 q=-1.0 Lsize=   10559kB time=00:08:58.12 bitrate= 160.7kbits/s dup=12 drop=0
    video:1586kB audio:8410kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:     5.638589%
    [libx264 @ 0x2b189c0] frame I:109   Avg QP:50.58  size:   494
    [libx264 @ 0x2b189c0] frame P:9537  Avg QP:51.00  size:   138
    [libx264 @ 0x2b189c0] frame B:6481  Avg QP:51.00  size:    40
    [libx264 @ 0x2b189c0] consecutive B-frames: 21.8% 72.1%  5.4%  0.7%
    [libx264 @ 0x2b189c0] mb I  I16..4: 46.1% 53.9%  0.0%
    [libx264 @ 0x2b189c0] mb P  I16..4:  6.0%  6.1%  0.0%  P16..4: 12.7%  1.1%  0.1%  0.0%  0.0%        skip:74.1%
    [libx264 @ 0x2b189c0] mb B  I16..4:  0.1%  0.1%  0.0%  B16..8:  6.3%  0.0%  0.0%  direct: 0.7%      skip:92.9%  L0:38.6% L1:61.2% BI: 0.2%
    [libx264 @ 0x2b189c0] 8x8 transform intra:50.8% inter:85.6%
    [libx264 @ 0x2b189c0] coded y,uvDC,uvAC intra: 5.9% 39.5% 0.1% inter: 0.1% 1.0% 0.0%
    [libx264 @ 0x2b189c0] i16 v,h,dc,p: 56% 30%  7%  7%
    [libx264 @ 0x2b189c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 11% 62%  3%  3%  3%  3%  2%  2%
    [libx264 @ 0x2b189c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19%  5% 73%  2%  0%  0%  0%  0%  2%
    [libx264 @ 0x2b189c0] i8c dc,h,v,p: 97%  1%  2%  0%
    [libx264 @ 0x2b189c0] Weighted P-Frames: Y:5.5% UV:2.7%
    [libx264 @ 0x2b189c0] ref P L0: 64.8% 35.2%
    [libx264 @ 0x2b189c0] ref B L0: 75.2% 24.8%
    [libx264 @ 0x2b189c0] ref B L1: 99.3%  0.7%
    [libx264 @ 0x2b189c0] kb/s:24.13
    ffmpeg version git-2014-04-16-c150e2c Copyright (c) 2000-2014 the FFmpeg developers
     built on Sep 28 2014 21:08:17 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-4)
     configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-    ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-nonfree -    -enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-    libx264
     libavutil      52. 76.100 / 52. 76.100
     libavcodec     55. 58.103 / 55. 58.103
     libavformat    55. 37.100 / 55. 37.100
     libavdevice    55. 13.100 / 55. 13.100
     libavfilter     4.  4.100 /  4.  4.100
     libswscale      2.  6.100 /  2.  6.100
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mpeg, from     '/home/flirtzo/public_html//userfiles/files/94e76a18a7838e62ecb23cf0c374b1b798e7b936':
     Duration: 00:00:25.97, start: 0.340078, bitrate: 29004 kb/s
       Stream #0:0[0x1e0]: Video: mpeg1video, yuv420p(tv), 352x240 [SAR 200:219 DAR 880:657], 1150         kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
       Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, stereo, s16p, 224 kb/s
    [libx264 @ 0x300d9c0] using SAR=200/219
    [libx264 @ 0x300d9c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x300d9c0] profile High, level 2.2
    [libx264 @ 0x300d9c0] 264 - core 142 r2 d6b4e63 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 -                     http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:0:0 analyse=0x3:0x133 me=umh         subme=10 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=1 cqm=0     deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=1 sliced_threads=0 nr=0     decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=8 b_pyramid=2 b_adapt=2 b_bias=0     direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0     rc_lookahead=60 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to     '/home/flirtzo/public_html/userfiles/files/b2/72/73d4a3245c0b0e174ab7ce0f872ba3f649f8b93f73a6deeab364    4a994009d73638ce61aecc7dc2e0250c4e74ff2d9a4d479ed35cef26b3f6e1a77e8bf5938518-    94e76a18a7838e62ecb23cf0c374b1b798e7b936.mp4':
     Metadata:
       encoder         : Lavf55.37.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 352x240 [SAR 200:219     DAR 880:657], q=-1--1, 30k tbn, 29.97 tbc
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (mpeg1video -> libx264)
     Stream #0:1 -> #0:1 (mp2 -> aac)
      Press [q] to stop, [?] for help
    frame=16127 fps= 88 q=-1.0 Lsize=   29190kB time=00:08:58.12 bitrate= 444.4kbits/s dup=12 drop=0
    video:20221kB audio:8410kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead:     1.954086%
    [libx264 @ 0x300d9c0] frame I:73    Avg QP:24.31  size:  8024
    [libx264 @ 0x300d9c0] frame P:4399  Avg QP:26.97  size:  2600
    [libx264 @ 0x300d9c0] frame B:11655 Avg QP:32.51  size:   745
    [libx264 @ 0x300d9c0] consecutive B-frames:  3.8%  5.0% 27.2% 18.4%  8.4% 33.9%  1.7%  0.7%  0.9%
    [libx264 @ 0x300d9c0] mb I  I16..4: 10.8% 68.5% 20.7%
    [libx264 @ 0x300d9c0] mb P  I16..4:  2.9%  7.5%  0.8%  P16..4: 45.1% 18.4% 12.4%  0.5%  0.1%        skip:12.3%
    [libx264 @ 0x300d9c0] mb B  I16..4:  0.6%  1.3%  0.1%  B16..8: 40.1%  8.7%  1.7%  direct: 2.1%      skip:45.5%  L0:47.2% L1:41.7% BI:11.1%
    [libx264 @ 0x300d9c0] 8x8 transform intra:66.7% inter:76.7%
    [libx264 @ 0x300d9c0] direct mvs  spatial:99.9% temporal:0.1%
    [libx264 @ 0x300d9c0] coded y,uvDC,uvAC intra: 60.3% 75.8% 16.4% inter: 17.3% 16.8% 0.6%
    [libx264 @ 0x300d9c0] i16 v,h,dc,p: 16% 27% 11% 47%
    [libx264 @ 0x300d9c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 13% 18%  6%  9%  9% 11%  9% 11%
    [libx264 @ 0x300d9c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 15%  7%  7% 14% 14% 13%  8% 10%
    [libx264 @ 0x300d9c0] i8c dc,h,v,p: 26% 32% 20% 22%
    [libx264 @ 0x300d9c0] Weighted P-Frames: Y:10.1% UV:6.9%
    [libx264 @ 0x300d9c0] ref P L0: 40.6% 12.1% 10.0%  5.2%  5.2%  4.7%  4.6%  3.0%  2.5%  2.1%  1.9%      1.8%  1.7%  1.7%  1.6%  1.3%
    [libx264 @ 0x300d9c0] ref B L0: 71.4%  5.6%  3.2%  3.0%  3.1%  2.8%  2.5%  1.8%  1.3%  1.0%  1.1%      1.2%  1.0%  0.7%  0.5%
    [libx264 @ 0x300d9c0] ref B L1: 96.3%  3.7%
    [libx264 @ 0x300d9c0] kb/s:307.82
  • Streaming H.264 over UDP using FFmpeg, and "dimensions not set" error

    3 septembre 2015, par Baris Demiray

    I’m trying to stream H.264 over UDP with no luck so far. Here is a minimal code that you can reproduce the problem.

    To compile,

    g++ -o test -lavcodec -lavformat -lavutil test.cpp

    Extra information, I start ffplay as follows. Currently it’s of no use.

    ffplay -i udp://127.0.0.1:8554/live.sdp

    Output of my code (see avio_open() call),

    [libx264 @ 0x6a26c0] using mv_range_thread = 24
    [libx264 @ 0x6a26c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
    [libx264 @ 0x6a26c0] profile High, level 3.1
    Output #0, h264, to 'udp://127.0.0.1:8554/live.sdp':
       Stream #0:0, 0, 0/0: Video: h264 (libx264), -1 reference frame, none, q=-1--1
    [h264 @ 0x6a2020] dimensions not set
    Cannot write header to stream: Success

    And the code,

    extern "C" {
       #include <libavcodec></libavcodec>avcodec.h>
       #include <libavformat></libavformat>avformat.h>
       #include <libavutil></libavutil>avutil.h>
    }

    #include <iostream>
    using namespace std;

    int main() {
       AVCodecContext* m_codecContext;
       AVCodec* m_codec;
       AVFormatContext* m_formatContext;
       AVStream* m_stream;

       unsigned m_outWidth = 768;
       unsigned m_outHeight = 608;

       av_register_all();
       avcodec_register_all();
       avformat_network_init();

       int errorStatus = 0;
       char errorLog[128] = { 0 };
       av_log_set_level(AV_LOG_TRACE);

       string m_output("udp://127.0.0.1:8554/live.sdp");

       if (avformat_alloc_output_context2(&amp;m_formatContext, NULL, "h264", m_output.c_str()) &lt; 0) {
           cerr &lt;&lt; "Cannot allocate output context: "
                &lt;&lt; av_make_error_string(errorLog, 128, errorStatus) &lt;&lt; endl;
           return -1;
       }

       AVOutputFormat *m_outputFormat = m_formatContext->oformat;

       m_codec = avcodec_find_encoder(AV_CODEC_ID_H264);
       if (!m_codec) {
           cerr &lt;&lt; "Cannot find an encoder: "
                &lt;&lt; av_make_error_string(errorLog, 128, errorStatus) &lt;&lt; endl;
           return -1;
       }

       m_codecContext = avcodec_alloc_context3(m_codec);
       if (!m_codecContext) {
           cerr &lt;&lt; "Cannot allocate a codec context: "
                &lt;&lt; av_make_error_string(errorLog, 128, errorStatus) &lt;&lt; endl;
           return -1;
       }

       m_codecContext->pix_fmt = AV_PIX_FMT_YUV420P;
       m_codecContext->width = m_outWidth;
       m_codecContext->height = m_outHeight;

       if (avcodec_open2(m_codecContext, m_codec, NULL) &lt; 0) {
           cerr &lt;&lt; "Cannot open codec: "
                &lt;&lt; av_make_error_string(errorLog, 128, errorStatus) &lt;&lt; endl;
           return -1;
       }

       m_stream = avformat_new_stream(m_formatContext, m_codec);
       if (!m_stream) {
           cerr &lt;&lt; "Cannot create a new stream: "
                &lt;&lt; av_make_error_string(errorLog, 128, errorStatus) &lt;&lt; endl;
           return -1;
       }

       av_dump_format(m_formatContext, 0, m_output.c_str(), 1);

       if ((errorStatus = avio_open(&amp;m_formatContext->pb, m_output.c_str(), AVIO_FLAG_WRITE)) &lt; 0) {
           cerr &lt;&lt; "Cannot open output: "
                &lt;&lt; av_make_error_string(errorLog, 128, errorStatus) &lt;&lt; endl;
           return -1;
       }

       if (avformat_write_header(m_formatContext, NULL) &lt; 0) {
           cerr &lt;&lt; "Cannot write header to stream: "
                &lt;&lt; av_make_error_string(errorLog, 128, errorStatus) &lt;&lt; endl;
           return -1;
       }

       cout &lt;&lt; "All done." &lt;&lt; endl;

       return 0;
    }
    </iostream>

    For those who has even more time to spare on my problem, when I change m_output to rtsp://127.0.0.1:8554/live.sdp, and ffplay command to ffplay -rtsp_flags listen -i rtsp://127.0.0.1:8554/live.sdp I get the error,

    [libx264 @ 0x1e056c0] using mv_range_thread = 24
    [libx264 @ 0x1e056c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
    [libx264 @ 0x1e056c0] profile High, level 3.1
    Output #0, h264, to 'rtsp://127.0.0.1:8554/live.sdp':
       Stream #0:0, 0, 0/0: Video: h264 (libx264), -1 reference frame, none, q=-1--1
    Cannot open output: Protocol not found

    Am I naive to expect that streaming protocol will be changed like this ?