lu-zero / bmdtools

Basic capture and play programs for Blackmagic Design Decklink
Boost Software License 1.0
198 stars 74 forks source link

Decklink mini recorder and bmdcapture modes list #18

Open c0ntact0 opened 11 years ago

c0ntact0 commented 11 years ago

Hi!

The Decklink mini recorder don't have outputs and because of that the modes list fail to load with the IID_IDeckLinkOutput interface. Must be used the IID_IDeckLinkInput interface to this card work.

Something like this fix the code:

// Query the DeckLink for its configuration interface

// Test input modes
result = deckLink->QueryInterface(IID_IDeckLinkInput,
                                  (void **)&deckLinkOutput);
  if (result != S_OK) {
   fprintf(stderr,"Could not obtain the IDeckLinkInput interface - result = %08x\n",result);

   // Input modes test failed lets try the output modes test
   result = deckLink->QueryInterface(IID_IDeckLinkOutput,
                                  (void **)&deckLinkOutput);

   if (result != S_OK) {
    fprintf(stderr,"Could not obtain the IDeckLinkOutput interface - result = %08x\n",
        result);
goto bail;
  } else {
fprintf(stderr,"This card have video output(s) but not have video input(s). You can not use this card with the bmdcapture software.\n");
    goto bail;
  }
}

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/942859-decklink-mini-recorder-and-bmdcapture-modes-list?utm_campaign=plugin&utm_content=tracker%2F256764&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F256764&utm_medium=issues&utm_source=github).
lu-zero commented 11 years ago

If you could provide a patch I'd merge it, otherwise please remind me to check the issue within the summer.

c0ntact0 commented 11 years ago

OK Lu, I send you the patch asap.

lu-zero commented 11 years ago

Thank you!

On Mon, Jul 22, 2013 at 3:28 PM, c0ntact0 notifications@github.com wrote:

OK Lu, I send you the patch asap.

— Reply to this email directly or view it on GitHubhttps://github.com/lu-zero/bmdtools/issues/18#issuecomment-21343590 .

c0ntact0 commented 11 years ago

Hi Luca.

The patch follows in attach. This patch it's made for the mac branch (sorry for that, I don't test it linux, just in MacOS Lion) and add the missing inputs (optical and S-Video) for the mac branch, add the print_capabilities function to list the supported video input connections and add the query to the IDeckLinkInput interface. The code query the output first, if fails query the input.

Date: Mon, 22 Jul 2013 06:31:40 -0700 From: notifications@github.com To: bmdtools@noreply.github.com CC: loureiro.rui@netcabo.pt Subject: Re: [bmdtools] Decklink mini recorder and bmdcapture modes list (#18)

Thank you!

On Mon, Jul 22, 2013 at 3:28 PM, c0ntact0 notifications@github.com wrote:

OK Lu, I send you the patch asap.

Reply to this email directly or view it on GitHubhttps://github.com/lu-zero/bmdtools/issues/18#issuecomment-21343590

.

— Reply to this email directly or view it on GitHub.

madhawa commented 11 years ago

Hi c0ntact0, I've successfully applied your patch, but I can't capture 1080P video signal via SDI input. Here is my setup [Video Source] -----SDI---->[Decklink mini recorder]----->[BMDCapture]--->[AVCONV].

bmdcapture -h Usage: bmdcapture -m [OPTIONS]

-m <mode id>:

-> DeckLink Mini Recorder (-C 0 )

Supported video output display modes and pixel formats: 0: NTSC 720 x 486 29.97 FPS 1: NTSC 23.98 720 x 486 23.976 FPS 2: PAL 720 x 576 25 FPS 3: NTSC Progressive 720 x 486 59.9401 FPS 4: PAL Progressive 720 x 576 50 FPS 5: HD 1080p 23.98 1920 x 1080 23.976 FPS 6: HD 1080p 24 1920 x 1080 24 FPS 7: HD 1080p 25 1920 x 1080 25 FPS 8: HD 1080p 29.97 1920 x 1080 29.97 FPS 9: HD 1080p 30 1920 x 1080 30 FPS 10: HD 1080i 50 1920 x 1080 25 FPS 11: HD 1080i 59.94 1920 x 1080 29.97 FPS 12: HD 1080i 60 1920 x 1080 30 FPS 13: HD 720p 50 1280 x 720 50 FPS 14: HD 720p 59.94 1280 x 720 59.9401 FPS 15: HD 720p 60 1280 x 720 60 FPS

-v                   Be verbose (report each 25 frames)
-f <filename>        Filename raw video will be written to
-F <format>          Define the file format to be used
-c <channels>        Audio Channels (2, 8 or 16 - default is 2)
-s <depth>           Audio Sample Depth (16 or 32 - default is 16)
-p <pixel>           PixelFormat Depth (8 or 10 - default is 8)
-n <frames>          Number of frames to capture (default is unlimited)
-M <memlimit>        Maximum queue size in GB (default is 1 GB)
-C <num>             number of card to be used
-A <audio-in>        Audio input:
                     1: Analog (RCA or XLR)
                     2: Embedded Audio (HDMI/SDI)
                     3: Digital Audio (AES/EBU)
-V <video-in>        Video input:
                     1: Composite
                     2: Component
                     3: HDMI
                     4: SDI
                     5: Optical SDI
                     6: S-Video

Capture video and audio to a file. Raw video and audio can be sent to a pipe to avconv or vlc e.g.:

bmdcapture -m 2 -A 1 -V 1 -F nut -f pipe:1

bmdcapture -C 0 -m 5 -A 2 -V 4 -F nut -f pipe:1 | /usr/local/bin/avconv -re -i - avconv version v9-1673-g6fd221e, Copyright (c) 2000-2013 the Libav developers built on Jul 24 2013 11:29:42 with gcc 4.7 (Debian 4.7.2-5) Frame received (#1) - No input signal detected - Frames dropped 1 - Total dropped 1 [nut @ 0x1b24f40] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, nut, from 'pipe:': Metadata: encoder : Lavf55.1.0 Duration: N/A, start: 0.000000, bitrate: N/A Stream #0.0: Video: rawvideo, uyvy422, 1920x1080, 23.98 tbn Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s At least one output file must be specified

Thanks.

c0ntact0 commented 11 years ago

"At least one output file must be specified"

You must specify a output to avconv (a file or other, i.e. a pipe to avplay). And you may want to convert to some output codec i.e.:

bmdcapture -C 0 -m 5 -A 2 -V 4 -F nut -f pipe:1 | avconv -i - -vcodec mpeg2video -vb 50M -acodec copy output_file.mov

Run "man avconv" in the terminal for mode details.

If you want to capture the raw video from the Decklink to test bmdcapture alone, you can do:

bmdcapture -C 0 -m 5 -A 2 -V 4 -F raw -f output_file.raw

madhawa commented 11 years ago

Hi c0ntact0, I think you didn't see this "Frame received (#1) - No input signal detected - Frames dropped 1 - Total dropped 1" Do you have any idea? Thanks.

madhawa commented 11 years ago

Hi c0ntact0, I've replace the card (Decklink mini recorder) with a new mini recorder card; everything works fine :) Thanks.

PatNarciso commented 11 years ago

madhawa: just to clarify, do you believe the issues you were having were related to the "Decklink Mini Recorder" Card?

madhawa commented 11 years ago

HI, No. It was a defective Decklink Mini card. I've replace the card & everything works fine.

On Thu, Aug 22, 2013 at 9:48 PM, PatNarciso notifications@github.comwrote:

madhawa: just to clarify, do you believe the issues you were having were related to the "Decklink Mini Recorder" Card?

— Reply to this email directly or view it on GitHubhttps://github.com/lu-zero/bmdtools/issues/18#issuecomment-23095793 .

Best regards, Madhawa Jayanath

Software Engineering Manager 101 Global Co.,Ltd. Unit 407, 72 CAT Telecom Tower, Charoenkrung Rd, Bangrak, Bangkok 10500 Thailand

Tel. +66.832551230 / +6626734234 FAX. +66.26480995

emptygalaxy commented 9 years ago

Is bmdcapture working with the UltraStudio Mini Recorder? I can't get any further than: Could not obtain the IDeckLinkConfiguration interface - result = 80000004