Opened 5 years ago

Last modified 4 years ago

#8079 open defect

s5p-mfc: v4l2_m2m segfaults when encoding

Reported by: jasaw Owned by: Andriy Gelman
Priority: normal Component: avcodec
Version: git-master Keywords: v4l2m2m
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
ffmpeg segfaults when running encode_video example using h264_v4l2m2m encoder.

How to reproduce:

% ./encode_video <output_file> h264_v4l2m2m
ffmpeg version N-94529-g3a557c5d88 (git-master)
built on 2018-08-13

Tested on Odroid XU4, kernel 4.14.127-odroidxu4

I sprinkled extra debug prints everywhere in ffmpeg to trace the program path and where it segfaults. Here's the output:

./encode_video test.mp4 h264_v4l2m2m
[h264_v4l2m2m @ 0x14993b0] driver 'uvcvideo' on card 'UVC Camera (046d:081b)'
[h264_v4l2m2m @ 0x14993b0] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
[h264_v4l2m2m @ 0x14993b0] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
[h264_v4l2m2m @ 0x14993b0] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x14993b0] Using device /dev/video11
[h264_v4l2m2m @ 0x14993b0] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x14993b0] Encoder does not support b-frames yet
[h264_v4l2m2m @ 0x14993b0] h264 profile not found
[h264_v4l2m2m @ 0x14993b0] Encoder adjusted: qmin (0), qmax (51)
Send frame   0
ffmpeg: avcodec_send_frame called
ffmpeg: calling codec->send_frame
v4l2_m2m_enc: v4l2_send_frame called
v4l2_context: ff_v4l2_context_enqueue_frame called
calling ff_v4l2_buffer_avframe_to_buf
v4l2_buffers: ff_v4l2_buffer_avframe_to_buf called, out ptr: 0x149b4a0
num_planes = 2
0: v4l2_bufref_to_buf
0: frame ptr = 0x149ea70
0: &frame->buf[0] = 0x149eb68
0: frame->buf[0] = 0x149ec70
0: frame->buf[0]->size = 156800
0: frame->buf[0]->data ptr = 0xb654a020
1: v4l2_bufref_to_buf
1: frame ptr = 0x149ea70
1: &frame->buf[1] = 0x149eb6c
1: frame->buf[1] = (nil)
Segmentation fault

Change History (5)

comment:1 by Carl Eugen Hoyos, 5 years ago

Please provide backtrace, disassembly and register dump as explained on https://ffmpeg.org/bugreports.html
Use static libraries or --disable-stripping to ensure useful debug information.

comment:2 by Carl Eugen Hoyos, 5 years ago

Keywords: v4l2m2m added; v4l2_m2m removed

comment:3 by jasaw, 5 years ago

backtrace, disassembly and register dump:

gdb --args /tmp/encode_video /tmp/test.mp4 h264_v4l2m2m
GNU gdb (Debian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /tmp/encode_video...done.
(gdb) r
Starting program: /tmp/encode_video /tmp/test.mp4 h264_v4l2m2m
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[h264_v4l2m2m @ 0x14953b0] driver 'uvcvideo' on card 'UVC Camera (046d:081b)'
[h264_v4l2m2m @ 0x14953b0] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
[h264_v4l2m2m @ 0x14953b0] driver 'exynos-gsc' on card 'exynos-gsc gscaler'
[h264_v4l2m2m @ 0x14953b0] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x14953b0] Using device /dev/video11
[h264_v4l2m2m @ 0x14953b0] driver 's5p-mfc' on card 's5p-mfc-enc'
[h264_v4l2m2m @ 0x14953b0] Encoder does not support b-frames yet
[h264_v4l2m2m @ 0x14953b0] h264 profile not found
[h264_v4l2m2m @ 0x14953b0] Encoder adjusted: qmin (0), qmax (51)
Send frame   0

Program received signal SIGSEGV, Segmentation fault.
0x009e7734 in v4l2_bufref_to_buf (bref=0x0,
    size=<error reading variable: Cannot access memory at address 0x8>,
    data=<error reading variable: Cannot access memory at address 0x4>,
    plane=1, out=0x14974a0) at libavcodec/v4l2_buffers.c:267
267         bytesused = FFMIN(size, out->plane_info[plane].length);
(gdb) bt
#0  0x009e7734 in v4l2_bufref_to_buf (bref=0x0,
    size=<error reading variable: Cannot access memory at address 0x8>,
    data=<error reading variable: Cannot access memory at address 0x4>,
    plane=1, out=0x14974a0) at libavcodec/v4l2_buffers.c:267
#1  ff_v4l2_buffer_avframe_to_buf (frame=frame@entry=0x149aa70,
    out=out@entry=0x14974a0) at libavcodec/v4l2_buffers.c:294
#2  0x0098c836 in ff_v4l2_context_enqueue_frame (ctx=0x14972d8,
    frame=0x149aa70) at libavcodec/v4l2_context.c:542
#3  0x004cf262 in avcodec_send_frame (avctx=0x14953b0, frame=0x149aa70)
    at libavcodec/encode.c:409
#4  0x00466a9a in encode (enc_ctx=0x14953b0, frame=0x149aa70, pkt=0x1495790,
    outfile=0x149a908) at encode_video.c:48
#5  0x00466844 in main (argc=<optimized out>, argv=<optimized out>)
    at encode_video.c:182
(gdb) disass $pc-32,$pc+32
Dump of assembler code from 0x9e7714 to 0x9e7754:
   0x009e7714 <ff_v4l2_buffer_avframe_to_buf+4>:        ldr     r7, [pc, #960] ; (0x9e7ad8 <ff_v4l2_buffer_buf_to_avframe+712>)
   0x009e7716 <ff_v4l2_buffer_avframe_to_buf+6>:        cmp     r3, #0
   0x009e7718 <ff_v4l2_buffer_avframe_to_buf+8>:        sub     sp, #20
   0x009e771a <ff_v4l2_buffer_avframe_to_buf+10>:       mov     r6, r1
   0x009e771c <ff_v4l2_buffer_avframe_to_buf+12>:       mov     r10, r0
   0x009e771e <ff_v4l2_buffer_avframe_to_buf+14>:       itttt   gt
   0x009e7720 <ff_v4l2_buffer_avframe_to_buf+16>:       addgt.w r11, r0, #248  ; 0xf8
   0x009e7724 <ff_v4l2_buffer_avframe_to_buf+20>:       movgt   r5, r1
   0x009e7726 <ff_v4l2_buffer_avframe_to_buf+22>:       movgt   r9, r1
   0x009e7728 <ff_v4l2_buffer_avframe_to_buf+24>:       movgt   r7, #0
   0x009e772a <ff_v4l2_buffer_avframe_to_buf+26>:       ble.n   0x9e7760 <ff_v4l2_buffer_avframe_to_buf+80>
   0x009e772c <ff_v4l2_buffer_avframe_to_buf+28>:       ldr.w   r3, [r11], #4
   0x009e7730 <ff_v4l2_buffer_avframe_to_buf+32>:       ldrd    r0, r8, [r5, #16]
=> 0x009e7734 <ff_v4l2_buffer_avframe_to_buf+36>:       ldrd    r1, r4, [r3, #4]
   0x009e7738 <ff_v4l2_buffer_avframe_to_buf+40>:       cmp     r4, r8
   0x009e773a <ff_v4l2_buffer_avframe_to_buf+42>:       it      cs
   0x009e773c <ff_v4l2_buffer_avframe_to_buf+44>:       movcs   r4, r8
   0x009e773e <ff_v4l2_buffer_avframe_to_buf+46>:       mov     r2, r4
   0x009e7740 <ff_v4l2_buffer_avframe_to_buf+48>:       blx     0x42296c <memcpy@plt+4>
   0x009e7744 <ff_v4l2_buffer_avframe_to_buf+52>:       ldr     r3, [r6, #116] ; 0x74
   0x009e7746 <ff_v4l2_buffer_avframe_to_buf+54>:       subs    r3, #9
   0x009e7748 <ff_v4l2_buffer_avframe_to_buf+56>:       cmp     r3, #1
   0x009e774a <ff_v4l2_buffer_avframe_to_buf+58>:       bls.n   0x9e77ee <ff_v4l2_buffer_avframe_to_buf+222>
   0x009e774c <ff_v4l2_buffer_avframe_to_buf+60>:       ldr     r3, [r6, #108] ; 0x6c
   0x009e774e <ff_v4l2_buffer_avframe_to_buf+62>:       adds    r7, #1
   0x009e7750 <ff_v4l2_buffer_avframe_to_buf+64>:       str     r4, [r6, #120] ; 0x78
   0x009e7752 <ff_v4l2_buffer_avframe_to_buf+66>:       adds    r5, #12
End of assembler dump.
(gdb) info all-registers
r0             0xb68dc000          3062743040
r1             0xb6647d20          3060038944
r2             0x18d00             101632
r3             0x0                 0
r4             0x18d00             101632
r5             0x14974ac           21591212
r6             0x14974a0           21591200
r7             0x1                 1
r8             0xc680              50816
r9             0x14974dc           21591260
r10            0x149aa70           21604976
r11            0x149ab70           21605232
r12            0xb6901d00          3062897920
sp             0xbefff418          0xbefff418
lr             0x9e7745            10385221
pc             0x9e7734            0x9e7734 <ff_v4l2_buffer_avframe_to_buf+36>
cpsr           0x20080030          537395248
d0             {u8 = {0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81}, u16 = {0x8181, 0x8181, 0x8181, 0x8181}, u32 = {0x81818181, 0x81818181}, u64 = 0x8181818181818181, f32 = {0x0, 0x0}, f64 = 0x0}
d1             {u8 = {0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81}, u16 = {0x8181, 0x8181, 0x8181, 0x8181}, u32 = {0x81818181, 0x81818181}, u64 = 0x8181818181818181, f32 = {0x0, 0x0}, f64 = 0x0}
d2             {u8 = {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, u16 = {0x8080, 0x8080, 0x8080, 0x8080}, u32 = {0x80808080, 0x80808080}, u64 = 0x8080808080808080, f32 = {0x0, 0x0}, f64 = 0x0}
d3             {u8 = {0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6}, u16 = {0xa09f, 0xa2a1, 0xa4a3, 0xa6a5}, u32 = {0xa2a1a09f, 0xa6a5a4a3}, u64 = 0xa6a5a4a3a2a1a09f, f32 = {0x0, 0x0}, f64 = 0x0}
d4             {u8 = {0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6}, u16 = {0xe0df, 0xe2e1, 0xe4e3, 0xe6e5}, u32 = {0xe2e1e0df, 0xe6e5e4e3}, u64 = 0xe6e5e4e3e2e1e0df, f32 = {0x0, 0x0}, f64 = 0x8000000000000000}
d5             {u8 = {0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26}, u16 = {0x201f, 0x2221, 0x2423, 0x2625}, u32 = {0x2221201f, 0x26252423}, u64 = 0x262524232221201f, f32 = {0x0, 0x0}, f64 = 0x0}
d6             {u8 = {0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66}, u16 = {0x605f, 0x6261, 0x6463, 0x6665}, u32 = {0x6261605f, 0x66656463}, u64 = 0x666564636261605f, f32 = {0xffffffff, 0xffffffff}, f64 = 0x7fffffffffffffff}
d7             {u8 = {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, u16 = {0x8080, 0x8080, 0x8080, 0x8080}, u32 = {0x80808080, 0x80808080}, u64 = 0x8080808080808080, f32 = {0x0, 0x0}, f64 = 0x0}
d8             {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d9             {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d10            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, --Type <RET> for more, q to quit, c to continue without paging--
0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d11            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d12            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d13            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d14            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d15            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d16            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d17            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d18            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d19            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d20            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d21            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d22            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d23            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d24            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d25            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d26            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d27            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d28            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d29            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d30            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
d31            {u8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u16 = {0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0}, u64 = 0x0, f32 = {0x0, 0x0}, f64 = 0x0}
fpscr          0x60000010          1610612752
s0             -4.7572945e-38      (raw 0x81818181)
s1             -4.7572945e-38      (raw 0x81818181)
--Type <RET> for more, q to quit, c to continue without paging--
s2             -4.7572945e-38      (raw 0x81818181)
s3             -4.7572945e-38      (raw 0x81818181)
s4             -1.18010406e-38     (raw 0x80808080)
s5             -1.18010406e-38     (raw 0x80808080)
s6             -4.38092016e-18     (raw 0xa2a1a09f)
s7             -1.14937998e-15     (raw 0xa6a5a4a3)
s8             -2.08336054e+21     (raw 0xe2e1e0df)
s9             -5.4282207e+23      (raw 0xe6e5e4e3)
s10            2.18365735e-18      (raw 0x2221201f)
s11            5.72948491e-16      (raw 0x26252423)
s12            1.03936542e+21      (raw 0x6261605f)
s13            2.70818433e+23      (raw 0x66656463)
s14            -1.18010406e-38     (raw 0x80808080)
s15            -1.18010406e-38     (raw 0x80808080)
s16            0                   (raw 0x00000000)
s17            0                   (raw 0x00000000)
s18            0                   (raw 0x00000000)
s19            0                   (raw 0x00000000)
s20            0                   (raw 0x00000000)
s21            0                   (raw 0x00000000)
s22            0                   (raw 0x00000000)
s23            0                   (raw 0x00000000)
s24            0                   (raw 0x00000000)
s25            0                   (raw 0x00000000)
s26            0                   (raw 0x00000000)
s27            0                   (raw 0x00000000)
s28            0                   (raw 0x00000000)
s29            0                   (raw 0x00000000)
s30            0                   (raw 0x00000000)
s31            0                   (raw 0x00000000)
q0             {u8 = {0x81 <repeats 16 times>}, u16 = {0x8181, 0x8181, 0x8181, 0x8181, 0x8181, 0x8181, 0x8181, 0x8181}, u32 = {0x81818181, 0x81818181, 0x81818181, 0x81818181}, u64 = {0x8181818181818181, 0x8181818181818181}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q1             {u8 = {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6}, u16 = {0x8080, 0x8080, 0x8080, 0x8080, 0xa09f, 0xa2a1, 0xa4a3, 0xa6a5}, u32 = {0x80808080, 0x80808080, 0xa2a1a09f, 0xa6a5a4a3}, u64 = {0x8080808080808080, 0xa6a5a4a3a2a1a09f}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q2             {u8 = {0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26}, u16 = {0xe0df, 0xe2e1, 0xe4e3, 0xe6e5, 0x201f, 0x2221, 0x2423, 0x2625}, u32 = {0xe2e1e0df, 0xe6e5e4e3, 0x2221201f, 0x26252423}, u64 = {0xe6e5e4e3e2e1e0df, 0x262524232221201f}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x8000000000000000, 0x0}}
q3             {u8 = {0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, u16 = {0x605f, 0x6261, 0x6463, 0x6665, 0x--Type <RET> for more, q to quit, c to continue without paging--
8080, 0x8080, 0x8080, 0x8080}, u32 = {0x6261605f, 0x66656463, 0x80808080, 0x80808080}, u64 = {0x666564636261605f, 0x8080808080808080}, f32 = {0xffffffff, 0xffffffff, 0x0, 0x0}, f64 = {0x7fffffffffffffff, 0x0}}
q4             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q5             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q6             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q7             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q8             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q9             {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q10            {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q11            {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q12            {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q13            {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q14            {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
q15            {u8 = {0x0 <repeats 16 times>}, u16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, u32 = {0x0, 0x0, 0x0, 0x0}, u64 = {0x0, 0x0}, f32 = {0x0, 0x0, 0x0, 0x0}, f64 = {0x0, 0x0}}
(gdb)

comment:4 by jasaw, 5 years ago

From my quick investigation, it looks like this driver requires multi-planar buffers. FFmpeg (ff_v4l2_buffer_initialize function) is aware that it is dealing with multi-planar, so set the num_planes to 2. When the example code calls av_frame_get_buffer, it only allocates buffer for one plane and left the other plane buffer as NULL, which causes the segfault.

Question is, how to get the example code to work?

comment:5 by Andriy Gelman, 4 years ago

Owner: set to Andriy Gelman
Status: newopen

Odroid XU4 needs input frames to be in nv21 pix_fmt.
The ./encode_video example is sending frames in yuv420p.

Note: See TracTickets for help on using tickets.