fabled / bmd-tools

Tools to connect and manage Blackmagic Design video equipment with built-in H.264 encoder
MIT License
37 stars 14 forks source link

choose input signal definition and avoid poling #7

Closed martialgallorini closed 10 years ago

martialgallorini commented 10 years ago

don't know if it is technically possible, but it would be nice to be able to specify the input signal definition for H264 recorder. For now it seems to detect automatically the input signal. If signal breaks it starts poling for other input but never detect signal when it is back.

(sorry for my english)

fabled commented 10 years ago

Are you sure it is automatically changing inputs? IIRC, the input selection happens programmatically - and automatic input selection is not supported currently

Are you perhaps running the code on device with the blackmagic drivers installed?

Adding command line switch to select input is fairly straight forward. Currently the code reconfigures to use HDMI if no input is selected earlier. You'll get SDI only if you used the official drivers to select SDI first.

martialgallorini commented 10 years ago

my bad maybe it doesn't happen when signal breaks. i will check that when i can. When i launch bmd-streamer sometimes it doesn't detect signal, i have a message like "no signal detected, switching to HDMI"

Yes i am using the device with blackmagic drivers installed ! shouldn't i ?

fabled commented 10 years ago

I have never tried using with BMD drivers, as they are not available for Linux.

I think in H264 encoder case the bmd drivers are doing the automatic channel rotation for you. You might get issues if both my code and the driver try to start streaming. In windows the component doing this is BMDStreamingServer.exe - it tries to use the USB connection. You could try killing the corresponding process to see if it helps.

Generally I'd recommend not having the BMD USB drivers. Technically using the IP-based "ATEM Software Control" would be OK as it is not using the USB port in any direct way.

martialgallorini commented 10 years ago

There are drivers for Linux. But it seems like it is a generic driver (Desktop Video) common to all devices... or maybe this is not a driver at all !?

I am using H.264 Pro Recorder.

By the way i didn't understand drivers were not necessary to use your code.

So you are suggesting removing the driver ? but BMDStreamingServer is still necessary isn't it ?

fabled commented 10 years ago

BMDStreamServer is not necessary with my code. You need it only if you are recording the stream using the official software.

As stated, I reverse engineered the USB protocol, and reimplemented it. There is no official USB capture drivers for Linux to my knowledge - they only work with the Decklink stuff. In any case, I wanted to use the stuff from embedded system, I decided re-engineer the drivers.

In short, you don't need to official drivers. And it is harmful to run BMDStreamingServer if using bmd-streamer to capture the stream.

martialgallorini commented 10 years ago

Ok seems more stable and reliable without BMD Device drivers and without using BMDStreamingServer.exe

but i have

bmd-atemstudio.bin: failed to load firmware to memory bmd-h264prorecorder.bin: failed to load firmware to memory

that's why i thought these binaries were necessary. But it seems to work without.

fabled commented 10 years ago

You can extract those bin files from BMDStreamingServer.exe using bmd-extractfw tool. IIRC, H264 pro recorder might not need the firmware. Perhaps it has flash that contains it. ATEM TV Studio needs the firmware to be loaded (once after cold boot). The firmware load is done automatically by BMDStreamingServer.exe too, once it has loaded the firmware no reload is necessary either.