DirectShow Capture support

Announcements made by users.
rogerdpack
Posts: 1877
Joined: Fri Aug 05, 2011 9:56 pm

Re: DirectShow Capture support

Post by rogerdpack » Thu Feb 14, 2013 6:22 pm

CSiller wrote:Ok, so I'll post the new console output when I get your adjusted executable file.
Could you also post your complete uncut command line and console output with the latest zeranoe builds first please, with -loglevel verbose? (both command line and uncut console output).
Thanks.
-roger-

rogerdpack
Posts: 1877
Joined: Fri Aug 05, 2011 9:56 pm

Re: DirectShow Capture support

Post by rogerdpack » Fri Feb 15, 2013 9:28 pm

Ok re: C920 could you run this (with -pix_fmt XXX):

http://rogerdpack.t28.net/incoming/ffmp ... eaders3.7z

and see if outputs a line like this near the top:

looking at VIH2, biSize=%
Thanks!

CSiller
Posts: 5
Joined: Mon Feb 11, 2013 10:50 pm

Re: DirectShow Capture support

Post by CSiller » Mon Feb 18, 2013 8:05 pm

I've tried that build but it does not show VIH2 but only VIH. Here's the command line and the complete console output:

ffmpeg -loglevel verbose -f dshow -vcodec h264 -i video="Logitech HD Pro Webcam C920" -pix_fmt yuvj420p output.mp4

Code: Select all

ffmpeg version N-49973-g75758f8 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 15 2013 11:08:16 with gcc 4.7.2 (GCC)
  configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/home/rogerdpack/
dev/ffmpeg-windows-build-helpers/sandbox/mingw-w64-i686/bin/i686-w64-mingw32- --
pkg-config=pkg-config --enable-gpl --enable-libsoxr --enable-libx264 --enable-av
isynth --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --en
able-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-li
bopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconf
ig --enable-libass --enable-libutvideo --enable-libopus --disable-w32threads --e
nable-frei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enabl
e-libxavs --extra-cflags=-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libb
luray --enable-libvpx --enable-static --disable-shared --enable-runtime-cpudetec
t
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.103 / 54. 91.103
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 37.101 /  3. 37.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[dshow @ 021ac9e0]  looking at VIH, biSize=40, BITMAPINFOHEADER size=40
    Last message repeated 55 times
[dshow @ 021ac9e0] Estimating duration from bitrate, this may be inaccurate
Input #0, dshow, from 'video=Logitech HD Pro Webcam C920':
  Duration: N/A, start: 1708.763000, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p, 640x480 [SAR 1:1
DAR 4:3], 62.50 tbr, 10000k tbn, 60 tbc
[graph 0 input from stream 0:0 @ 021afda0] w:640 h:480 pixfmt:yuvj420p tb:1/1000
0000 fr:125/2 sar:1/1 sws_param:flags=2
[libx264 @ 03911d20] using SAR=1/1
[libx264 @ 03911d20] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE
4.2 AVX
[libx264 @ 03911d20] profile High, level 3.1
[libx264 @ 03911d20] 264 - core 129 r2238 9c4ba4b - H.264/MPEG-4 AVC codec - Cop
yleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deb
lock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 m
e_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chro
ma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i
nterlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenec
ut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=
0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf54.63.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 640x480 [SAR 1:
1 DAR 4:3], q=-1--1, 16k tbn, 62.50 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
Press [q] to stop, [?] for help
*** 3 dup!
    Last message repeated 2 times
*** 4 dup!
*** 3 dup!
    Last message repeated 3 times
*** 4 dup!
*** 3 dup!
    Last message repeated 4 times
*** 4 dup!
*** 3 dup!
    Last message repeated 3 times
frame=   80 fps=0.0 q=32.0 size=      64kB time=00:00:00.44 bitrate=1174.9kbits/
*** 3 dup!rop=0
*** 4 dup!
*** 3 dup!
    Last message repeated 4 times
*** 4 dup!
*** 3 dup!
frame=  118 fps= 74 q=2686103.0 Lsize=     154kB time=00:00:01.85 bitrate= 678.4
kbits/s dup=89 drop=0
video:152kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.420812%
[libx264 @ 03911d20] frame I:1     Avg QP:26.94  size: 12766
[libx264 @ 03911d20] frame P:32    Avg QP:25.29  size:  4050
[libx264 @ 03911d20] frame B:85    Avg QP:32.64  size:   142
[libx264 @ 03911d20] consecutive B-frames:  3.4%  0.0%  5.1% 91.5%
[libx264 @ 03911d20] mb I  I16..4: 34.2% 32.8% 33.1%
[libx264 @ 03911d20] mb P  I16..4:  1.6%  1.4%  1.2%  P16..4: 41.6%  9.0%  6.8%
 0.0%  0.0%    skip:38.5%
[libx264 @ 03911d20] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 14.9%  0.0%  0.0%
 direct: 0.0%  skip:85.1%  L0:51.6% L1:47.8% BI: 0.6%
[libx264 @ 03911d20] 8x8 transform intra:33.4% inter:69.2%
[libx264 @ 03911d20] coded y,uvDC,uvAC intra: 50.9% 50.6% 13.9% inter: 5.1% 9.3%
 1.1%
[libx264 @ 03911d20] i16 v,h,dc,p: 54% 23% 13% 11%
[libx264 @ 03911d20] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 20% 25%  3%  3%  4%  4%
 5%  4%
[libx264 @ 03911d20] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 44% 23%  8%  4%  3%  6%  2%
 7%  3%
[libx264 @ 03911d20] i8c dc,h,v,p: 49% 21% 27%  3%
[libx264 @ 03911d20] Weighted P-Frames: Y:12.5% UV:12.5%
[libx264 @ 03911d20] ref P L0: 71.9% 10.9% 13.6%  3.5%  0.1%
[libx264 @ 03911d20] ref B L0: 89.0%  9.0%  2.0%
[libx264 @ 03911d20] ref B L1: 94.8%  5.2%
[libx264 @ 03911d20] kb/s:654.51
This is the output of the latest build from the download page. Ffmpeg crashes when I press q to finish.

ffmpeg -loglevel verbose -f dshow -vcodec h264 -i video="Logitech HD Pro Webcam C920" -pix_fmt yuvj420p output.mp4

Code: Select all

ffmpeg version N-50025-gb8bb661 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 17 2013 02:37:45 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
sm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --e
nable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --e
nable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-
libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable
-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.103 / 54. 91.103
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 38.100 /  3. 38.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[dshow @ 0211b060] Estimating duration from bitrate, this may be inaccurate
Input #0, dshow, from 'video=Logitech HD Pro Webcam C920':
  Duration: N/A, start: 2435.071000, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p, 640x480 [SAR 1:1
DAR 4:3], 62.50 tbr, 10000k tbn, 60 tbc
[graph 0 input from stream 0:0 @ 0211fea0] w:640 h:480 pixfmt:yuvj420p tb:1/1000
0000 fr:125/2 sar:1/1 sws_param:flags=2
[libx264 @ 0386dde0] using SAR=1/1
[libx264 @ 0386dde0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE
4.2 AVX
[libx264 @ 0386dde0] profile High, level 3.1
[libx264 @ 0386dde0] 264 - core 129 r2245 bc13772 - H.264/MPEG-4 AVC codec - Cop
yleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deb
lock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 m
e_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chro
ma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i
nterlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenec
ut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=
0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf54.63.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 640x480 [SAR 1:
1 DAR 4:3], q=-1--1, 16k tbn, 62.50 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
Press [q] to stop, [?] for help
*** 3 dup!
    Last message repeated 1 times
*** 4 dup!
*** 3 dup!
    Last message repeated 1 times
*** 4 dup!
*** 3 dup!
    Last message repeated 4 times
*** 4 dup!
*** 3 dup!
    Last message repeated 4 times
*** 4 dup!
frame=   77 fps=0.0 q=32.0 size=      48kB time=00:00:00.40 bitrate= 976.9kbits/
*** 3 dup!rop=0
    Last message repeated 2 times
frame=   89 fps= 65 q=2686103.0 Lsize=     116kB time=00:00:01.39 bitrate= 684.9
kbits/s dup=67 drop=0
video:115kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.582891%
Thanks for looking into that!

rogerdpack
Posts: 1877
Joined: Fri Aug 05, 2011 9:56 pm

Re: DirectShow Capture support

Post by rogerdpack » Tue Feb 19, 2013 2:46 pm

CSiller wrote: [dshow @ 021ac9e0] looking at VIH, biSize=40, BITMAPINFOHEADER size=40
Last message repeated 55 times
[dshow @ 021ac9e0] Estimating duration from bitrate, this may be inaccurate
Dang I had hoped maybe there was some h264 "metadata" in there that i would just need to copy out "and be done". Guess not though. I'll try to research some more this week sometime...

notes:
http://stackoverflow.com/questions/1126 ... deccontext
http://msdn.microsoft.com/en-us/library ... s.85).aspx

rogerdpack
Posts: 1877
Joined: Fri Aug 05, 2011 9:56 pm

Re: DirectShow Capture support

Post by rogerdpack » Wed Feb 20, 2013 12:14 am

@c920: could you try this, maybe it will help somehow?

-vbsf h264_mp4toannexb

like

ffmpeg -i ... -vcodec copy -vbsf h264_mp4toannexb output_file.ts

ref: http://www.shortword.net/blog/2009/12/1 ... th-ffmpeg/

CSiller
Posts: 5
Joined: Mon Feb 11, 2013 10:50 pm

Re: DirectShow Capture support

Post by CSiller » Wed Feb 20, 2013 6:38 pm

That didn't change anything, unfortunately, there's still no output. Here is the command line I used:

ffmpeg -loglevel verbose -f dshow -vcodec h264 -i video="Logitech HD Pro Webcam C920" -vcodec copy -vbsf h264_mp4toannexb output.ts

Code: Select all

ffmpeg version N-49973-g75758f8 Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 15 2013 11:08:16 with gcc 4.7.2 (GCC)
  configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/home/rogerdpack/
dev/ffmpeg-windows-build-helpers/sandbox/mingw-w64-i686/bin/i686-w64-mingw32- --
pkg-config=pkg-config --enable-gpl --enable-libsoxr --enable-libx264 --enable-av
isynth --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --en
able-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-li
bopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-fontconf
ig --enable-libass --enable-libutvideo --enable-libopus --disable-w32threads --e
nable-frei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enabl
e-libxavs --extra-cflags=-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libb
luray --enable-libvpx --enable-static --disable-shared --enable-runtime-cpudetec
t
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.103 / 54. 91.103
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 37.101 /  3. 37.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[dshow @ 003cee00]  looking at VIH, biSize=40, BITMAPINFOHEADER size=40
    Last message repeated 55 times
[dshow @ 003cee00] Estimating duration from bitrate, this may be inaccurate
Input #0, dshow, from 'video=Logitech HD Pro Webcam C920':
  Duration: N/A, start: 1554.026000, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p, 640x480 [SAR 1:1
DAR 4:3], 62.50 tbr, 10000k tbn, 60 tbc
[mpegts @ 051eaa80] muxrate VBR, pcr every 3 pkts, sdt every 200, pat/pmt every
40 pkts
Output #0, mpegts, to 'output.ts':
  Metadata:
    encoder         : Lavf54.63.100
    Stream #0:0: Video: h264, yuvj420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 90k t
bn, 30 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=-1.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead nan%
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters i
f used)

rogerdpack
Posts: 1877
Joined: Fri Aug 05, 2011 9:56 pm

Re: DirectShow Capture support

Post by rogerdpack » Wed Feb 20, 2013 7:12 pm

This one looks hard, I'll put out some feelers...

petervm
Posts: 6
Joined: Mon Aug 20, 2012 10:16 am

Re: DirectShow Capture support

Post by petervm » Thu Mar 28, 2013 2:13 pm

Hi,

we managed to get output from this cam using parameter "copyinkf"
"When doing stream copy, copy also non-key frames found at the beginning"


for example on linux:
ffmpeg -f video4linux2 -re -vcodec h264 -i /dev/video1 -copyinkf -c:v copy -flags +global_header -f flv test.flv

now we would like to find a way to influence bitrate, keyframes etc (we need this for live streaming)

rogerdpack
Posts: 1877
Joined: Fri Aug 05, 2011 9:56 pm

Re: DirectShow Capture support

Post by rogerdpack » Thu May 16, 2013 7:34 am

petervm wrote:Hi,

we managed to get output from this cam using parameter "copyinkf"
for which cam?

petervm
Posts: 6
Joined: Mon Aug 20, 2012 10:16 am

Re: DirectShow Capture support

Post by petervm » Thu May 16, 2013 8:07 am

this was for Logitech HD Pro Webcam C920

Post Reply
'