[FFmpeg-trac] #5775(avdevice:new): Direct show webcam video capture fails in Windows 10 Anniversary edition

FFmpeg trac at avcodec.org
Fri Aug 12 06:28:00 EEST 2016


#5775: Direct show webcam video capture fails in Windows 10 Anniversary edition
-------------------------------------+-------------------------------------
             Reporter:  ctdavids     |                     Type:  defect
               Status:  new          |                 Priority:  important
            Component:  avdevice     |                  Version:  git-
             Keywords:  webcam       |  master
  dshow windows anniversary          |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 '''Goal''': Capture webcam video with direct show in Windows 10
 Anniversary Edition

 '''Problem''': ffmpeg crashes

 '''Command Line''':

 ffmpeg.exe -f dshow -i video="Logitech HD Webcam C310" test.mp4

 '''Repro''':

 1) Requires Windows 10 Anniversary edition
 (http://go.microsoft.com/fwlink/?LinkID=823759) as there seems to have
 been (breaking) changes to direct show behaviour.  Prior to this edition,
 the command is successful.

 2) Run the above command line (replacing the name of the webcam with one
 appropriate for your system).  I have tested this with: Logitech C170,
 C310 and C615; MS LifeCam CinemaHD and HD-3000; and the integrated camera
 on my laptop.

 3) The camera light will turn on briefly and then ffmpeg will crash.  This
 has occurred for me with my custom-built ffmpeg and the latest Zeranoe
 build
 (https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20160811-b83d907-win64-static.zip)

 '''gdb output'''

 The full gdb output is below. I believe it suggests a failure with a
 direct show call, which seems backed up by the internet being of the
 opinion that microsoft made at least one breaking change in direct show
 with this update (https://social.msdn.microsoft.com/Forums/windowsdesktop
 /en-US/9d6a8704-764f-46df-a41c-8e9d84f7f0f3/mjpg-encoded-media-type-is-
 not-available-for-usbuvc-webcameras-after-
 windows-10-version-1607-os?forum=mediafoundationdevelopment)

 I obtained this by running the application through cygwin.  I will attach
 the build script I used to build it in cygwin (with gcc, wget, gdb, git,
 and https://github.com/transcode-open/apt-cyg installed).

 {{{
 $ gdb ffmpeg_g.exe
 GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1
 Copyright (C) 2015 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 "x86_64-pc-cygwin".
 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 ffmpeg_g.exe...done.
 (gdb) r -f dshow -i video="Logitech HD Webcam C310" test.mp4
 Starting program: /home/ctdav/Anv/ffmpeg/ffmpeg_g.exe -f dshow -i
 video="Logitech HD Webcam C310" test.mp4
 [New Thread 18280.0x1d18]
 [New Thread 18280.0x40c0]
 [New Thread 18280.0x2e8c]
 [New Thread 18280.0x1494]
 ffmpeg version git-2016-08-12-e8b355a Copyright (c) 2000-2016 the FFmpeg
 developers
   built with gcc 4.9.2 (GCC)
   configuration: --enable-gpl --disable-doc --enable-libmp3lame --enable-
 libx264 --enable-version3 --arch=x86_64 --target-os=mingw32
 --logfile=/dev/stdout --extra-ldflags=-static --cross-
 prefix=x86_64-w64-mingw32-
   libavutil      55. 28.100 / 55. 28.100
   libavcodec     57. 51.100 / 57. 51.100
   libavformat    57. 46.100 / 57. 46.100
   libavdevice    57.  0.102 / 57.  0.102
   libavfilter     6. 51.100 /  6. 51.100
   libswscale      4.  1.100 /  4.  1.100
   libswresample   2.  1.100 /  2.  1.100
   libpostproc    54.  0.100 / 54.  0.100
 [New Thread 18280.0x4444]
 [New Thread 18280.0x8e1c]
 [New Thread 18280.0x5808]
 [Thread 18280.0x5808 exited with code 0]
 [New Thread 18280.0x58a0]
 [Thread 18280.0x58a0 exited with code 0]
 [New Thread 18280.0x6928]
 [Thread 18280.0x6928 exited with code 0]
 [New Thread 18280.0x2ed8]
 [New Thread 18280.0x29d8]
 [New Thread 18280.0x3528]
 [New Thread 18280.0x6bf4]
 [New Thread 18280.0x2edc]
 warning: HEAP[ffmpeg_g.exe]:
 warning: Invalid address specified to RtlFreeHeap( 00000000000A0000,
 00000000017688E0 )

 Program received signal SIGTRAP, Trace/breakpoint trap.
 0x00007ffef96eb61f in ntdll!RtlpNtMakeTemporaryKey () from
 /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
 (gdb) bt
 #0  0x00007ffef96eb61f in ntdll!RtlpNtMakeTemporaryKey () from
 /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
 #1  0x00007ffef96b7408 in ntdll!memset () from
 /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
 #2  0x00007ffef9682a71 in ntdll!EtwEventProviderEnabled () from
 /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
 #3  0x00007ffef96acfb3 in ntdll!memset () from
 /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
 #4  0x00007ffef962c214 in ntdll!RtlFreeHeap () from
 /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll
 #5  0x00007ffed1e15f88 in Source!DllUnregisterServer () from
 /cygdrive/c/Windows/System32/mfksproxy.dll
 #6  0x00007ffed1df6b50 in ?? () from
 /cygdrive/c/Windows/System32/mfksproxy.dll
 #7  0x00007ffed45e9464 in QUARTZ!AMGetErrorTextW () from
 /cygdrive/c/Windows/System32/quartz.dll
 #8  0x00007ffed45fb5f7 in QUARTZ!AMGetErrorTextW () from
 /cygdrive/c/Windows/System32/quartz.dll
 #9  0x00007ffed45fab0d in QUARTZ!AMGetErrorTextW () from
 /cygdrive/c/Windows/System32/quartz.dll
 #10 0x00007ffed45fcc79 in QUARTZ!AMGetErrorTextW () from
 /cygdrive/c/Windows/System32/quartz.dll
 #11 0x00007ffed45fc6e5 in QUARTZ!AMGetErrorTextW () from
 /cygdrive/c/Windows/System32/quartz.dll
 #12 0x0000000140025d4a in dshow_read_header (avctx=0xe752a0) at
 libavdevice/dshow.c:1209
 #13 0x000000014026b487 in avformat_open_input (ps=ps at entry=0x5ff848,
 filename=filename at entry=0xe74a93 "video=Logitech HD Webcam C310",
 fmt=fmt at entry=0x140d1a140 <ff_dshow_demuxer>, options=0xe74de8) at
 libavformat/utils.c:555
 #14 0x000000014000db07 in open_input_file (o=o at entry=0x5ffa40,
 filename=<optimized out>) at ffmpeg_opt.c:982
 #15 0x000000014000f0ef in open_files (inout=0x140d635bf
 <global_group+6927> "input", open_file=0x14000c290 <open_input_file>,
 l=<optimized out>, l=<optimized out>) at ffmpeg_opt.c:3069
 #16 ffmpeg_parse_options (argc=argc at entry=6, argv=argv at entry=0xe74830) at
 ffmpeg_opt.c:3106
 #17 0x0000000140c9a70e in main (argc=6, argv=0xe74830) at ffmpeg.c:4325
 (gdb) disass $pc-32,$pc+32
 Dump of assembler code from 0x7ffef96eb5ff to 0x7ffef96eb63f:
    0x00007ffef96eb5ff <ntdll!RtlpNtMakeTemporaryKey+17199>:     int3
    0x00007ffef96eb600 <ntdll!RtlpNtMakeTemporaryKey+17200>:     int3
    0x00007ffef96eb601 <ntdll!RtlpNtMakeTemporaryKey+17201>:     int3
    0x00007ffef96eb602 <ntdll!RtlpNtMakeTemporaryKey+17202>:     int3
    0x00007ffef96eb603 <ntdll!RtlpNtMakeTemporaryKey+17203>:     int3
    0x00007ffef96eb604 <ntdll!RtlpNtMakeTemporaryKey+17204>:     int3
    0x00007ffef96eb605 <ntdll!RtlpNtMakeTemporaryKey+17205>:     int3
    0x00007ffef96eb606 <ntdll!RtlpNtMakeTemporaryKey+17206>:     int3
    0x00007ffef96eb607 <ntdll!RtlpNtMakeTemporaryKey+17207>:     int3
    0x00007ffef96eb608 <ntdll!RtlpNtMakeTemporaryKey+17208>:     mov
 %gs:0x60,%rax
    0x00007ffef96eb611 <ntdll!RtlpNtMakeTemporaryKey+17217>:     cmpb
 $0x0,0x2(%rax)
    0x00007ffef96eb615 <ntdll!RtlpNtMakeTemporaryKey+17221>:     je
 0x7ffef96eb626 <ntdll!RtlpNtMakeTemporaryKey+17238>
    0x00007ffef96eb617 <ntdll!RtlpNtMakeTemporaryKey+17223>:     movb
 $0x1,0x55033(%rip)        # 0x7ffef9740651
    0x00007ffef96eb61e <ntdll!RtlpNtMakeTemporaryKey+17230>:     int3
 => 0x00007ffef96eb61f <ntdll!RtlpNtMakeTemporaryKey+17231>:     movb
 $0x0,0x5502b(%rip)        # 0x7ffef9740651
    0x00007ffef96eb626 <ntdll!RtlpNtMakeTemporaryKey+17238>:     retq
    0x00007ffef96eb627 <ntdll!RtlpNtMakeTemporaryKey+17239>:     int3
    0x00007ffef96eb628 <ntdll!RtlpNtMakeTemporaryKey+17240>:     int3
    0x00007ffef96eb629 <ntdll!RtlpNtMakeTemporaryKey+17241>:     int3
    0x00007ffef96eb62a <ntdll!RtlpNtMakeTemporaryKey+17242>:     int3
    0x00007ffef96eb62b <ntdll!RtlpNtMakeTemporaryKey+17243>:     int3
    0x00007ffef96eb62c <ntdll!RtlpNtMakeTemporaryKey+17244>:     int3
    0x00007ffef96eb62d <ntdll!RtlpNtMakeTemporaryKey+17245>:     int3
    0x00007ffef96eb62e <ntdll!RtlpNtMakeTemporaryKey+17246>:     int3
    0x00007ffef96eb62f <ntdll!RtlpNtMakeTemporaryKey+17247>:     int3
    0x00007ffef96eb630 <ntdll!RtlpNtMakeTemporaryKey+17248>:     mov
 %rbx,0x8(%rsp)
    0x00007ffef96eb635 <ntdll!RtlpNtMakeTemporaryKey+17253>:     mov
 %r9,0x20(%rsp)
    0x00007ffef96eb63a <ntdll!RtlpNtMakeTemporaryKey+17258>:     mov
 %r8b,0x18(%rsp)
 End of assembler dump.
 (gdb) info all-registers
 rax            0x3a0000 3801088
 rbx            0x17688d0        24545488
 rcx            0x975f0c6c27e60000       -7539293592529534976
 rdx            0x39007b005c007d 16044601959514237
 rsi            0x7ffef96fea38   140733083281976
 rdi            0xa0000  655360
 rbp            0x0      0x0
 rsp            0x5fe048 0x5fe048
 r8             0x30002d00610065 13510992161996901
 r9             0x63003000610030 27866228859142192
 r10            0x33003200320039 14355438563885113
 r11            0x7d003600390031 35184604020801585
 r12            0xe7cb68 15190888
 r13            0x0      0
 r14            0x0      0
 r15            0x17688e0        24545504
 rip            0x7ffef96eb61f   0x7ffef96eb61f
 <ntdll!RtlpNtMakeTemporaryKey+17231>
 eflags         0x202    [ IF ]
 cs             0x33     51
 ss             0x2b     43
 ds             0x2b     43
 es             0x2b     43
 fs             0x53     83
 gs             0x2b     43
 st0            <invalid float value>    (raw 0x708b0000007d00300030)
 st1            0        (raw 0x000000000004cba73088)
 st2            <invalid float value>    (raw 0x000500000000000a6790)
 st3            <invalid float value>    (raw 0x001400000000005fdb40)
 st4            <invalid float value>    (raw 0x000200007ffecba73088)
 st5            <invalid float value>    (raw 0x00630000a8c10c735e78)
 st6            <invalid float value>    (raw 0x00020000000000000001)
 st7            <invalid float value>    (raw 0x240e0000000000000002)
 fctrl          0x37f    895
 fstat          0x0      0
 ftag           0x640000 6553600
 fiseg          0x32     50
 fioff          0x2d0036 2949174
 foseg          0x30     48
 fooff          0x620064 6422628
 fop            0x0      0
 xmm0           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc8, 0x2, 0xe7, 0x0,
 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0x2, 0x0, 0x0, 0x0, 0x2c8, 0xe7, 0x0,
 0x0}, v4_int32 = {0x2, 0x0, 0xe702c8, 0x0}, v2_int64 = {0x2,
     0xe702c8}, uint128 = 0x0000000000e702c80000000000000002}
 xmm1           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0xe0, 0xdd, 0x5f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe7,
 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0xdde0, 0x5f, 0x0, 0x0, 0x0, 0xe7,
 0x0, 0x0}, v4_int32 = {0x5fdde0, 0x0, 0xe70000, 0x0},
   v2_int64 = {0x5fdde0, 0xe70000}, uint128 =
 0x0000000000e7000000000000005fdde0}
 xmm2           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0x1, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0},
 v4_int32 = {0x1, 0x0, 0x2, 0x0}, v2_int64 = {0x1, 0x2},
   uint128 = 0x00000000000000020000000000000001}
 xmm3           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x20, 0x89, 0x76, 0x1, 0x0, 0x0, 0x0, 0x0, 0x65, 0xaa, 0x62,
 0xf9, 0xfe, 0x7f, 0x0, 0x0}, v8_int16 = {0x8920, 0x176, 0x0, 0x0, 0xaa65,
 0xf962, 0x7ffe, 0x0}, v4_int32 = {0x1768920, 0x0,
     0xf962aa65, 0x7ffe}, v2_int64 = {0x1768920, 0x7ffef962aa65}, uint128 =
 0x00007ffef962aa650000000001768920}
 xmm4           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0, 0x0, 0xe7, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0, 0xdd, 0x5f,
 0x0, 0x0, 0x0, 0x0, 0x0}, v8_int16 = {0x0, 0xe7, 0x0, 0x0, 0xdde0, 0x5f,
 0x0, 0x0}, v4_int32 = {0xe70000, 0x0, 0x5fdde0, 0x0},
   v2_int64 = {0xe70000, 0x5fdde0}, uint128 =
 0x00000000005fdde00000000000e70000}
 xmm5           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x10, 0x89, 0x76, 0x1, 0x0, 0x0, 0x0, 0x0, 0x14, 0xc2, 0x62,
 0xf9, 0xfe, 0x7f, 0x0, 0x0}, v8_int16 = {0x8910, 0x176, 0x0, 0x0, 0xc214,
 0xf962, 0x7ffe, 0x0}, v4_int32 = {0x1768910, 0x0,
     0xf962c214, 0x7ffe}, v2_int64 = {0x1768910, 0x7ffef962c214}, uint128 =
 0x00007ffef962c2140000000001768910}
 xmm6           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
 uint128 = 0x00000000000000000000000000000000}
 xmm7           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
 uint128 = 0x00000000000000000000000000000000}
 xmm8           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
 uint128 = 0x00000000000000000000000000000000}
 xmm9           {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
 uint128 = 0x00000000000000000000000000000000}
 xmm10          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
 uint128 = 0x00000000000000000000000000000000}
 xmm11          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
 uint128 = 0x00000000000000000000000000000000}
 xmm12          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
 uint128 = 0x00000000000000000000000000000000}
 xmm13          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
 uint128 = 0x00000000000000000000000000000000}
 xmm14          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
 uint128 = 0x00000000000000000000000000000000}
 xmm15          {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
 v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
 uint128 = 0x00000000000000000000000000000000}
 mxcsr          0x1fa0   [ PE IM DM ZM OM UM PM ]
 (gdb)
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5775>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list