[FFmpeg-user] Performance Tuning for Raspberry Pi
Bruce Diesel
bruce.diesel at gmail.com
Wed Oct 17 22:24:24 EEST 2018
Hi Carl,
The command is:
ffmpeg -f v4l2 -i /dev/video0 -vf
drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=/dev/shm/Sensors.txt:reload=1:x=(w-text_w)/2:y=(h-text_h)/2"
test.mpg
The output is:
ffmpeg version 3.2.10-1~deb9u1+rpt2 Copyright (c) 2000-2018 the FFmpeg
developers
built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
configuration: --prefix=/usr --extra-version='1~deb9u1+rpt2'
--toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf
--incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping
--enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libebur128 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg
--enable-libopenmpt --enable-libopus --enable-libpulse
--enable-librubberband --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-omx-rpi --enable-mmal --enable-openal
--enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883
--arch=armhf --enable-chromaprint --enable-frei0r --enable-libopencv
--enable-libx264 --enable-shared
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
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 19249.680868, bitrate: 283115 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1024x768,
283115 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
[Parsed_drawtext_0 @ 0x1bc90f0] Using
"/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
[mpeg @ 0x1bcb010] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'test.mpg':
Metadata:
encoder : Lavf57.56.101
Stream #0:0: Video: mpeg1video, yuv420p, 1024x768, q=2-31, 200 kb/s, 30
fps, 90k tbn, 30 tbc
Metadata:
encoder : Lavc57.64.101 mpeg1video
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg1video (native))
Press [q] to stop, [?] for help
frame= 11 fps=7.9 q=4.5 size= 98kB time=00:00:00.26
bitrate=3010.4kbits/s
frame= 17 fps=7.6 q=8.4 size= 150kB time=00:00:00.46
bitrate=2633.1kbits/s
frame= 22 fps=6.5 q=7.4 size= 154kB time=00:00:00.63
bitrate=1991.9kbits/s
frame= 27 fps=5.9 q=6.9 size= 210kB time=00:00:00.80
bitrate=2150.4kbits/s
frame= 32 fps=5.9 q=7.2 size= 210kB time=00:00:00.96
bitrate=1779.6kbits/s
frame= 37 fps=5.9 q=8.0 size= 218kB time=00:00:01.13
bitrate=1575.7kbits/s
frame= 43 fps=6.0 q=9.3 size= 260kB time=00:00:01.33
bitrate=1597.4kbits/s
frame= 48 fps=5.8 q=10.8 size= 264kB time=00:00:01.50
bitrate=1441.8kbits/s
frame= 53 fps=5.7 q=19.1 size= 292kB time=00:00:01.66
bitrate=1435.2kbits/s
frame= 58 fps=5.6 q=17.0 size= 294kB time=00:00:01.83
bitrate=1313.7kbits/s
frame= 63 fps=5.6 q=17.0 size= 320kB time=00:00:02.00
bitrate=1310.7kbits/
frame= 69 fps=5.7 q=18.9 size= 324kB time=00:00:02.20
bitrate=1206.5kbits/
frame= 74 fps=5.6 q=12.1 size= 350kB time=00:00:02.36
bitrate=1211.5kbits/
frame= 79 fps=5.6 q=17.9 size= 354kB time=00:00:02.53
bitrate=1144.7kbits/
frame= 84 fps=5.6 q=17.2 size= 354kB time=00:00:02.70
bitrate=1074.1kbits/
frame= 89 fps=5.6 q=23.5 size= 380kB time=00:00:02.86
bitrate=1085.9kbits/
frame= 95 fps=5.6 q=26.3 size= 384kB time=00:00:03.06
bitrate=1025.8kbits/frame= 100 fps=5.6 q=30.3 size= 406kB
time=00:00:03.23 bitrate=1028.6kbits/frame= 105 fps=5.5 q=31.0 size=
406kB time=00:00:03.40 bitrate= 978.2kbits/frame= 110 fps=5.6 q=20.7
size= 428kB time=00:00:03.56 bitrate= 983.0kbits/frame= 115 fps=5.6
q=29.1 size= 428kB time=00:00:03.73 bitrate= 939.2kbits/frame= 121
fps=5.6 q=26.3 size= 430kB time=00:00:03.93 bitrate= 895.6kbits/frame=
126 fps=5.6 q=31.0 size= 452kB time=00:00:04.10 bitrate=
903.1kbits/frame= 131 fps=5.6 q=31.0 size= 452kB time=00:00:04.26
bitrate= 867.8kbits/frame= 136 fps=5.6 q=31.0 size= 472kB
time=00:00:04.43 bitrate= 872.2kbits/frame= 141 fps=5.6 q=31.0 size=
474kB time=00:00:04.60 bitrate= 844.1kbits/frame= 147 fps=5.6 q=31.0
size= 494kB time=00:00:04.80 bitrate= 843.1kbits/frame= 152 fps=5.6
q=31.0 size= 496kB time=00:00:04.96 bitrate= 818.1kbits/frame= 157
fps=5.6 q=31.0 size= 498kB time=00:00:05.13 bitrate= 794.7kbits/frame=
162 fps=5.6 q=31.0 size= 518kB time=00:00:05.30 bitrate=
800.7kbits/frame= 167 fps=5.6 q=31.0 size= 518kB time=00:00:05.46
bitrate= 776.2kbits/frame= 173 fps=5.6 q=31.0 size= 542kB
time=00:00:05.66 bitrate= 783.5kbits/frame= 178 fps=5.6 q=31.0 size=
546kB time=00:00:05.83 bitrate= 766.8kbits/frame= 178 fps=5.4 q=31.0
Lsize= 548kB time=00:00:05.86 bitrate= 765.2kbits/s dup=143 drop=0
speed=0.177x
video:545kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.612837%
On Wed, Oct 17, 2018 at 2:01 PM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 2018-10-17 12:16 GMT+02:00, Bruce Diesel <bruce.diesel at gmail.com>:
>
> > Please forgive my somewhat basic question, but my searching has not
> yielded
> > much information that I can easily understand as I don't have much
> > knowledge in this space.
> >
> > I am building a dash cam type application using a Raspberry Pi Zero, some
> > sensors, and a Pi Camera. I am burning data from the sensors onto video
> > using drawtext from a memory file that a separate python program is
> > continuously updating atomically.
> >
> > I am really struggling to get reasonable performance. I get around 6
> > frames/second at HD quality. I am not running X Windows, and not
> > displaying the video, just capturing it.
> >
> > Using an ffmpeg command line such as: ffmpeg -i /dev/video0 -vf
> > drawtext="....." test.mpg
> >
> > Inside the drawtext I am setting the font, centering the text and giving
> it
> > the filename to read.
> >
> > I have very limited understanding of the pros/cons of different codecs
> etc
> > so I am looking for a source of information that can help me through this
> > without me having to become an expert in the subject.
>
> Please provide the command line that you tested together with
> the complete, uncut console output.
>
> Assuming you are not doing anything stupid, only small
> improvements will be possible with software encoding,
> the overlay is always expensive.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-user
mailing list