[FFmpeg-user] libx264 vs android 4.4

Patrick Shirkey pshirkey at boosthardware.com
Wed Jul 16 14:42:08 CEST 2014


On Fri, July 11, 2014 9:33 pm, Patrick Shirkey wrote:
>
> On Fri, July 11, 2014 8:37 pm, Carl Eugen Hoyos wrote:
>> Patrick Shirkey <pshirkey <at> boosthardware.com> writes:
>>
>>> On Fri, July 11, 2014 4:55 pm, Carl Eugen Hoyos wrote:
>>> > Patrick Shirkey <pshirkey <at> boosthardware.com> writes:
>>> >
>>> >> ffmpeg -f rawvideo -i /dev/graphics/fb0
>>> >
>>> > This looks plain wrong.
>>
>>> The commandline works if I do not use libx264 for
>>> the stream codec.
>>
>> http://ffmpeg.org/ffmpeg-devices.html#fbdev
>> indicates that ffmpeg -f fbdev -i /dev/graphics/fb0
>> should be used but I unfortunately cannot test here.
>>
>> Concerning that x264 doesn't work at all, please test:
>> $ ffmpeg -f lavfi -i testsrc -pix_fmt yuv420p out.mov
>> If this doesn't work, we have to find out why.
>>
>> If it works, please replace "-f lavfi -i testsrc" with
>> the framebuffer input.
>>

I have been able to get a working commandline with libx264 encodiing.

On a dual core allwinner a20 chipset with mali GPU I see about between 5 -
10% additonal cpuload. The stream runs for 58 frames at -r 1.

- I'm using this command line:

ffmpeg -f fbdev -r 1 -i /dev/graphics/fb0 -vcodec libx264 -f h264 
-preset:v slow -pix_fmt yuv420p http://localhost:8090/feed1.ffm

If I use -f h264 the cpuload jumps up to 80%

- I run ffserver like this:

ffserver   -f /data/ffserver.conf

ffserver.conf
++++
Port 8090
RTSPPort 7654
BindAddress 0.0.0.0
RTSPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -
<Feed feed1.ffm>
   File /data/feed1.ffm
   ACL allow 127.0.0.1
</Feed>

<Stream live.h264>
  Format rtp
  Feed feed1.ffm
  VideoCodec libx264
  VideoFrameRate 1
  VideoBitRate 100
  VideoSize 480x800
#  AVPresetVideo default
#  AVPresetVideo baseline
  NoAudio
  AVOptionVideo flags +global_header
</Stream>
++++

ffmpeg output:

ffmpeg version N-64597-g4576eff Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 11 2014 10:59:49 with gcc 4.7 (GCC)
  configuration: --arch=arm --target-os=linux --enable-cross-compile
--cross-prefix=/4.4/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-
--sysroot=/4.4/prebuilts/ndk/current/platforms/android-18/arch-arm
--enable-gpl --enable-avresample --enable-libx264 --enable-ffplay
--extra-cflags='-fno-builtin-sin -fno-builtin-sinf -I/4.4/external/x264'
--extra-ldflags=-L/4.4/external/x264
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 45.100 / 55. 45.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libavresample   1.  3.  0 /  1.  3.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[fbdev @ 0x1c42d40] w:800 h:480 bpp:32 pixfmt:bgra fps:1/1 bit_rate:12288000
Input #0, fbdev, from '/dev/graphics/fb0':
  Duration: N/A, start: 1405514019.655622, bitrate: 12288 kb/s
    Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 800x480, 12288
kb/s, 1 fps, 1 tbr, 1000k tbn, 1 tbc
[libx264 @ 0x1c45260] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x1c45260] profile High, level 2.2
[h264 @ 0x1c44460] Using AVStream.codec.time_base as a timebase hint to
the muxer is deprecated. Set AVStream.time_base instead.
Output #0, h264, to 'http://localhost:8090/feed1.ffm':
  Metadata:
    encoder         : Lavf55.45.100
    Stream #0:0: Video: h264 (libx264), yuv420p, 800x480, q=-1--1, 1 fps,
1 tbn, 1 tbc
    Metadata:
      encoder         : Lavc55.69.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
av_interleaved_write_frame(): Connection reset by peer0.00 bitrate=N/A
frame=   58 fps=0.9 q=-1.0 Lsize=      69kB time=00:00:-1.00 bitrate=N/A
video:69kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.000000%
[libx264 @ 0x1c45260] frame I:1     Avg QP: 6.88  size: 70966
[libx264 @ 0x1c45260] frame P:15    Avg QP:12.18  size:   200
[libx264 @ 0x1c45260] frame B:42    Avg QP:18.33  size:    47
[libx264 @ 0x1c45260] consecutive B-frames:  3.4%  0.0%  0.0% 96.6%
[libx264 @ 0x1c45260] mb I  I16..4: 42.3% 27.5% 30.3%
[libx264 @ 0x1c45260] mb P  I16..4:  0.1%  0.0%  0.0%  P16..4:  1.8%  0.0%
 0.2%  0.0%  0.0%    skip:98.0%
[libx264 @ 0x1c45260] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  2.0%  0.0%
 0.0%  direct: 0.0%  skip:98.0%  L0:24.4% L1:75.6% BI: 0.0%
[libx264 @ 0x1c45260] 8x8 transform intra:27.3% inter:84.0%
[libx264 @ 0x1c45260] direct mvs  spatial:95.2% temporal:4.8%
[libx264 @ 0x1c45260] coded y,uvDC,uvAC intra: 82.0% 32.0% 29.6% inter:
0.2% 0.1% 0.0%
[libx264 @ 0x1c45260] i16 v,h,dc,p: 77%  8% 14%  0%
[libx264 @ 0x1c45260] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 13% 40%  2%  1% 
1%  3%  1%  4%
[libx264 @ 0x1c45260] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 21%  9%  8%  8% 
7%  8%  7%  7%
[libx264 @ 0x1c45260] i8c dc,h,v,p: 54% 15% 30%  1%
[libx264 @ 0x1c45260] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x1c45260] ref P L0: 93.0%  0.0%  4.7%  2.3%
[libx264 @ 0x1c45260] ref B L0: 63.7% 35.0%  1.3%
[libx264 @ 0x1c45260] ref B L1: 76.0% 24.0%
[libx264 @ 0x1c45260] kb/s:10.48
Conversion failed!


- Seperately I am trying to view the stream remotely with this commandline:

$ ./ffplay -analyzeduration 2147483647 -probesize 2147483647 -vcodec
libx264  http://192.168.1.106:8090/live.h264


ffplay version N-64597-g4576eff Copyright (c) 2003-2014 the FFmpeg developers
  built on Jul 16 2014 15:24:17 with gcc 4.7 (Debian 4.7.2-5)
  configuration: --enable-gpl --enable-avresample --enable-libx264
--enable-ffplay --disable-shared --enable-static
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 45.100 / 55. 45.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libavresample   1.  3.  0 /  1.  3.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[h264 @ 0x26ba3e0] Format h264 detected only with low score of 1,
misdetection possible!
[h264 @ 0x26ba3e0] Could not find codec parameters for stream 0 (Video:
h264): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize'
options
http://192.168.1.106:8090/l.h264: could not find codec parameters
    nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0



--
Patrick Shirkey
Boost Hardware Ltd


More information about the ffmpeg-user mailing list