Jump to content

Update from 3.30 to 3.36 brokes ffmpeg with OV5640


Recommended Posts

Quick debugging info, subject says all.

Other apps like cap.c or motion or motioneye works perfect and capture and streams live video.

 

Working onliner: ffmpeg -f v4l2 -channel 0 -video_size 640x480 -i /dev/video0 -pix_fmt nv12 -vcodec h264 -preset fast -b:v 2000k -qp 20 ffmpegtest.mkv

Working distro

Armbian 5.30
root@nanopiair:~# cat /etc/armbian-release
# PLEASE DO NOT EDIT THIS FILE
BOARD=nanopiair
BOARD_NAME="NanoPi Air"
VERSION=5.30
LINUXFAMILY=sun8i
BRANCH=default
ARCH=arm
IMAGE_TYPE=stable
root@nanopiair:~# modinfo  vfe_v4l2
filename:       /lib/modules/3.4.113-sun8i/kernel/drivers/media/video/sunxi-vfe/vfe_v4l2.ko
description:    Video front end driver for sunxi
license:        Dual BSD/GPL
author:         raymonxiu
depends:        videobuf-core,vfe_os,vfe_subdev,videobuf-dma-contig,cci
intree:         Y
vermagic:       3.4.113-sun8i SMP preempt mod_unload modversions ARMv7 p2v8 
parm:           ccm:string
parm:           i2c_addr:uint
parm:           act_name:string
parm:           act_slave:uint
parm:           define_sensor_list:uint
parm:           vfe_i2c_dbg:uint
parm:           isp_log:uint
parm:           vips:uint
root@nanopiair:~# modinfo ov5640
filename:       /lib/modules/3.4.113-sun8i/kernel/drivers/media/video/sunxi-vfe/device/ov5640.ko
license:        GPL
description:    A low-level driver for ov5640 sensors (H3 / A20)
author:         @lex
author:         raymonxiu
alias:          i2c:ov5640
depends:        cci,vfe_subdev
intree:         Y
vermagic:       3.4.113-sun8i SMP preempt mod_unload modversions ARMv7 p2v8 
parm:           frame_rate:frame_rate=0 (default with no parameters), frame_rate=1 (7.5 FPS), frame_rate=2 (15 FPS), frame_rate=3 (30 FPS) (default=0 - or no parms - default settings) (uint)
root@nanopiair:~# ffmpeg -f v4l2 -channel 0 -s 320x240 -i /dev/video0 -c:v libx264 -preset ultrafast -qp 20 ffmpegtest.mkv
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --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-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1512652641.063736, bitrate: 27648 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240, 27648 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
File 'ffmpegtest.mkv' already exists. Overwrite ? [y/N] 

After apt update/upgrade, not working distro:

root@NanoPiAir:~# cat /etc/armbian-release 
# PLEASE DO NOT EDIT THIS FILE
BOARD=nanopiair
BOARD_NAME="NanoPi Air"
BOARDFAMILY=sun8i
VERSION=5.36
LINUXFAMILY=sun8i
BRANCH=default
ARCH=arm
IMAGE_TYPE=user-built
BOARD_TYPE=conf
INITRD_ARCH=arm
KERNEL_IMAGE_TYPE=zImage
root@NanoPiAir:~#

root@NanoPiAir:~# modinfo vfe_v4l2
filename:       /lib/modules/3.4.113-sun8i/kernel/drivers/media/video/sunxi-vfe/vfe_v4l2.ko
description:    Video front end driver for sunxi
license:        Dual BSD/GPL
author:         raymonxiu
depends:        videobuf-core,vfe_os,vfe_subdev,videobuf-dma-contig,cci
intree:         Y
vermagic:       3.4.113-sun8i SMP preempt mod_unload modversions ARMv7 p2v8 
parm:           ccm:string
parm:           i2c_addr:uint
parm:           act_name:string
parm:           act_slave:uint
parm:           define_sensor_list:uint
parm:           vfe_i2c_dbg:uint
parm:           isp_log:uint
parm:           vips:uint

ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --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-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[video4linux2,v4l2 @ 0xfaf800] Dequeued v4l2 buffer contains 118784 bytes, but 115200 were expected. Flags: 0x00000001.
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, bitrate: 27648 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240, 27648 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
File 'ffmpegtest.mkv' already exists. Overwrite ? [y/N] 
[libx264 @ 0xfb21c0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0xfb21c0] profile Constrained Baseline, level 1.3
[libx264 @ 0xfb21c0] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=20 ip_ratio=1.40 aq=0
Output #0, matroska, to 'ffmpegtest.mkv':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 320x240, q=-1--1, 30 fps, 1k tbn, 30 tbc
    Metadata:
      encoder         : Lavc56.60.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0xfaf800] Dequeued v4l2 buffer contains 118784 bytes, but 115200 were expected. Flags: 0x00000001.
/dev/video0: Invalid data found when processing input
frame=    0 fps=0.0 q=0.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

The error: [video4linux2,v4l2 @ 0xfaf800] Dequeued v4l2 buffer contains 118784 bytes, but 115200 were expected. Flags: 0x00000001.

 

Debugging test of FFMPEG: 

root@NanoPiAir# ffmpeg -loglevel debug -f v4l2 -framerate 30 -video_size 1920x1080 -i /dev/video0 -c:v libx264 -preset ultrafast -crf 10 microcorder.mkv

  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'v4l2'.
Reading option '-framerate' ... matched as AVOption 'framerate' with argument '30'.
Reading option '-video_size' ... matched as AVOption 'video_size' with argument '1920x1080'.
Reading option '-i' ... matched as input url with argument '/dev/video0'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'ultrafast'.
Reading option '-crf' ... matched as AVOption 'crf' with argument '10'.
Reading option 'microcorder.mkv' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url /dev/video0.
Applying option f (force format) with argument v4l2.
Successfully parsed a group of options.
Opening an input file: /dev/video0.
[video4linux2,v4l2 @ 0x1ec1800] fd:4 capabilities:5000001
[video4linux2,v4l2 @ 0x1ec1800] Current input_channel: 0, input_name: , input_std: 0
[video4linux2,v4l2 @ 0x1ec1800] Setting time per frame to 1/30
[video4linux2,v4l2 @ 0x1ec1800] Dequeued v4l2 buffer contains 3112960 bytes, but 3110400 were expected. Flags: 0x00000001.
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, bitrate: 746496 kb/s
    Stream #0:0, 0, 1/1000000: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 1920x1080 (0x0), 1/1000000, 746496 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Successfully opened the file.
Parsing a group of options: output url microcorder.mkv.
Applying option c:v (codec name) with argument libx264.
Successfully parsed a group of options.
Opening an output file: microcorder.mkv.
File 'microcorder.mkv' already exists. Overwrite ? [y/N] 
Successfully opened the file.
detected 4 logical cores
[graph 0 input from stream 0:0 @ 0x1ec1760] Setting 'video_size' to value '1920x1080'
[graph 0 input from stream 0:0 @ 0x1ec1760] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x1ec1760] Setting 'time_base' to value '1/1000000'
[graph 0 input from stream 0:0 @ 0x1ec1760] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:0 @ 0x1ec1760] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x1ec1760] Setting 'frame_rate' to value '30/1'
[graph 0 input from stream 0:0 @ 0x1ec1760] w:1920 h:1080 pixfmt:yuv420p tb:1/1000000 fr:30/1 sar:0/1 sws_param:flags=2
[format @ 0x1ecea60] compat: called with args=[yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21]
[format @ 0x1ecea60] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21'
[AVFilterGraph @ 0x1ecde10] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[libx264 @ 0x1ec4230] using mv_range_thread = 88
[libx264 @ 0x1ec4230] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x1ec4230] profile Constrained Baseline, level 4.0
[libx264 @ 0x1ec4230] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=10.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, matroska, to 'microcorder.mkv':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0, 0, 1/1000: Video: h264 (libx264), -1 reference frame (H264 / 0x34363248), yuv420p, 1920x1080, 1/30, q=-1--1, 30 fps, 1k tbn, 30 tbc
    Metadata:
      encoder         : Lavc56.60.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0x1ec1800] Dequeued v4l2 buffer contains 3112960 bytes, but 3110400 were expected. Flags: 0x00000001.
/dev/video0: Invalid data found when processing input
[output stream 0:0 @ 0x1ece620] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
[matroska @ 0x1ec2e60] end duration = 0
[matroska @ 0x1ec2e60] stream 0 end duration = 0
frame=    0 fps=0.0 q=0.0 Lsize=       1kB time=00:00:00.00 bitrate=N/A    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (/dev/video0):
  Input stream #0:0 (video): 0 packets read (0 bytes); 0 frames decoded; 
  Total: 0 packets (0 bytes) demuxed
Output file #0 (microcorder.mkv):
  Output stream #0:0 (video): 0 frames encoded; 0 packets muxed (0 bytes); 
  Total: 0 packets (0 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x1ec4b40] Statistics: 15 seeks, 12 writeouts

 

Armbianinfo is here http://sprunge.us/jfKV

 

PS:Also tried to copy boot.cmd and boot.scr from 5.35, there is no image with 5.36 to avoid problem in that way 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines