[FFmpeg-user] bad performance when streaming udp from png image2pipe source

Jacobs jacobhameiri at gmail.com
Wed Oct 31 23:36:52 CET 2012


Carl and Roger, both your advise worked I now have much less latency, ffplay
starts playing the stream almost instantly ( also the output quality
increased significantly, I assume it is because I set -g 0).

But still I have a very long delay between frames.  The frame sequence is:
frame, 10 seconds wait another frame, 500 milliseconds wait then another
frame ( F, 10 sec, F, 0.5 sec, F) . 
So the actual frame rate in ffplay is about 0.1 fps although ffmpeg shows an
average of 1.5 fps.

Any idea how to fix this terrible frame rate ?

ffplay command:
ffplay.exe -i udp://127.0.0.1:1234 -probesize 40000 -analyzeduration 0

ffplay output:

ffplay version N-46146-g11d695d Copyright (c) 2003-2012 the FFmpeg
developers
  built on Oct 29 2012 18:10:27 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-pthreads
--enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r
--enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut
--enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs
--enable-libxvid --enable-zlib
  libavutil      52.  1.100 / 52.  1.100
  libavcodec     54. 69.100 / 54. 69.100
  libavformat    54. 35.100 / 54. 35.100
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 20.109 /  3. 20.109
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
[mpegts @ 0000000001f10980] Unable to seek back to the start
[mpegts @ 0000000001f10980] Stream #0: not enough frames to estimate rate;
consider increasing probesize
[mpegts @ 0000000001f10980] Estimating duration from bitrate, this may be
inaccurate
Input #0, mpegts, from 'udp://127.0.0.1:1234':
  Duration: N/A, start: 2.440000, bitrate: 104857 kb/s
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
yuv420p, 800x1280 [SAR 1:1 DAR 5:8], 104857 kb/s, 25 tbr, 90k tbn, 50 tbc
Frame changed from size:0x0 to size:800x1280

ffmpeg command:

ffmpeg -an -y -probesize 32 -analyzeduration 5  -f image2pipe -vcodec png
-loop 1 -i /sdcard/tempfifo -g 0  -preset ultrafast -tune zerolatency  -f
mpegts udp://192.168.1.23:1234

ffmpeg output:

ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct 29 2012 21:27:23 with gcc 4.6.x-google 20120106 (prerelease)
  configuration: --arch=arm --cpu=cortex-a8 --target-os=linux
--enable-runtime-cpudetect --prefix=/data/data/org.witness.sscvideoproto
--enable-pic --disable-shared --enable-static
--cross-prefix=/home/oz/android-ndk-r8b//toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
--sysroot=/home/oz/android-ndk-r8b//platforms/android-3/arch-arm
--extra-cflags='-I../x264 -mfloat-abi=softfp -mfpu=neon -mfpu=vfpv3-d16'
--extra-ldflags=-L../x264 --enable-version3 --enable-gpl --disable-doc
--enable-yasm --enable-decoders --enable-encoders --enable-muxers
--enable-demuxers --enable-parsers --enable-protocols --enable-filters
--enable-avresample --enable-libfreetype --disable-indevs
--enable-indev=lavfi --enable-indev=fbdev --enable-outdevs --enable-hwaccels
--enable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver
--enable-network --enable-libx264 --enable-zlib --enable-postproc
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[image2pipe @ 0x1074520] Stream #0: not enough frames to estimate rate;
consider increasing probesize
[image2pipe @ 0x1074520] Estimating duration from bitrate, this may be
inaccurate
Input #0, image2pipe, from '/sdcard/tempfifo':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgba, 800x1280, 25 tbr, 25 tbn, 25 tbc
[buffer @ 0x1072150] w:800 h:1280 pixfmt:rgba tb:1/25 sar:0/1
sws_param:flags=2
[buffersink @ 0x10723d0] No opaque field provided
[format @ 0x1072560] auto-inserting filter 'auto-inserted scaler 0' between
the filter 'src' and the filter 'format'
[scale @ 0x1073af0] w:800 h:1280 fmt:rgba sar:0/1 -> w:800 h:1280
fmt:yuv420p sar:0/1 flags:0x4
[mpegts @ 0x1083250] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt
every 40 pkts
Output #0, mpegts, to 'udp://192.168.1.23:1234':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Video: mpeg2video, yuv420p, 800x1280, q=2-31, 200 kb/s, 90k
tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (png -> mpeg2video)
Press [q] to stop, [?] for help
frame=    3 fps=0.0 q=7.1 size=     164kB time=00:00:00.04
bitrate=33689.6kbits/s    
frame=    4 fps=2.9 q=4.8 size=     268kB time=00:00:00.08
bitrate=27448.0kbits/s    
frame=    5 fps=2.4 q=5.5 size=     362kB time=00:00:00.12
bitrate=24740.8kbits/s    
frame=    6 fps=2.2 q=7.4 size=     450kB time=00:00:00.16
bitrate=23039.4kbits/s    
frame=    7 fps=2.1 q=9.8 size=     523kB time=00:00:00.20
bitrate=21401.9kbits/s    
frame=    8 fps=2.0 q=12.4 size=     588kB time=00:00:00.24
bitrate=20084.7kbits/s    
frame=    9 fps=1.9 q=15.3 size=     647kB time=00:00:00.28
bitrate=18928.9kbits/s    
frame=   10 fps=1.9 q=18.2 size=     700kB time=00:00:00.32
bitrate=17925.8kbits/s    
frame=   11 fps=1.8 q=21.2 size=     749kB time=00:00:00.36
bitrate=17037.0kbits/s    
frame=   12 fps=1.8 q=24.1 size=     794kB time=00:00:00.40
bitrate=16262.0kbits/s    
frame=   13 fps=1.8 q=24.8 size=     839kB time=00:00:00.44
bitrate=15614.3kbits/s    
frame=   14 fps=1.7 q=24.8 size=     883kB time=00:00:00.48
bitrate=15068.2kbits/s    
frame=   15 fps=1.7 q=24.8 size=     928kB time=00:00:00.52
bitrate=14611.9kbits/s    
frame=   16 fps=1.7 q=24.8 size=     972kB time=00:00:00.56
bitrate=14223.5kbits/s    
frame=   17 fps=1.7 q=24.8 size=    1017kB time=00:00:00.60
bitrate=13884.4kbits/s    
frame=   18 fps=1.7 q=24.8 size=    1061kB time=00:00:00.64
bitrate=13583.0kbits/s    
frame=   19 fps=1.7 q=24.8 size=    1106kB time=00:00:00.68
bitrate=13321.5kbits/s    





--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/bad-performance-when-streaming-udp-from-png-image2pipe-source-tp4654598p4654625.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.


More information about the ffmpeg-user mailing list