Changes between Version 2 and Version 3 of Capture/Blackmagic


Ignore:
Timestamp:
Mar 21, 2016, 8:48:37 PM (3 years ago)
Author:
llogan
Comment:

minor formatting

Legend:

Unmodified
Added
Removed
Modified
  • Capture/Blackmagic

    v2 v3  
    22= Windows = 
    33 
    4 Blackmagic is using the protocol dshow with  DirectLink, I have tested the commands in this page with a BlackMagic intensity Pro 4K PCI-E, you might have different settings. 
    5 You need to be specific on the parameters you define, otherwise ffmpeg is going to record a black video.   
     4Blackmagic is using the protocol protocol with !DirectLink, I have tested the commands in this page with a Blackmagic intensity Pro 4K PCI-E, you might have different settings. 
     5 
     6You need to be specific on the parameters you define, otherwise `ffmpeg` is going to record a black video.   
    67 
    78 
    89== List devices == 
    910 
    10 Check with FFMPEG if your blackmagic is installed correctly by running the following command: 
     11Check with `ffmpeg` if your Blackmagic device is installed correctly by running the following command: 
    1112 
    1213{{{ 
    1314ffmpeg -list_devices true -f dshow -i dummy 
    14  
    1515 
    1616[dshow @ 000000a9a5eaa880] DirectShow video devices (some may be both video and audio devices) 
     
    3232{{{ 
    3333ffmpeg -list_options true -f dshow -i video="Decklink Video Capture" 
    34  
    3534 
    3635[dshow @ 0000007201cda8a0] DirectShow video device options (from video devices) 
     
    8887[dshow @ 0000007201cda8a0]   vcodec=r210  min s=3840x2160 fps=29.97 max s=3840x2160 fps=29.97 
    8988[dshow @ 0000007201cda8a0]   vcodec=r210  min s=3840x2160 fps=30 max s=3840x2160 fps=30 
    90                                                                         
    91  
    9289}}} 
    9390 
     
    9895{{{ 
    9996ffmpeg -list_options true -f dshow -i audio="Decklink Audio Capture" 
    100  
    10197}}} 
    10298 
    10399== My solution to find out the correct parameters == 
    104 Open your Blackmagic Media Express and in the preferences check all combination until you can see the live capture, you can narrow it down by video format and framerate if you know what kind of output your device is giving. 
     100 
     101Open your Blackmagic Media Express and in the preferences check all combination until you can see the live capture. You can narrow it down by video format and framerate if you know what kind of output your device is giving. 
    105102 
    106103I was capturing from a Lumix GH4, so my settings were: 
    107 Resolution = 1920x1080 
    108 FPS = 59.94 
    109 Pixel format = uyvy422 
    110104 
    111 Most important Lumix say that it outputs at 60 FPS but FFMPEG needed to set to 59.94 rather than 60, and this was a difference from a black video and a real capture. 
     105* Resolution = 1920x1080 
     106* FPS = 59.94 
     107* Pixel format = uyvy422 
     108 
     109Most importantly, Lumix shows that it outputs at 60 FPS but `ffmpeg` needed to set to 59.94 rather than 60, and this was a difference from a black video and a real capture. 
    112110 
    113111 
     
    119117 
    120118 
    121 The line above is capturing a FULL HD video at 60 FPS and converting into h264 video without compressing, that means your file is going to be very big! In my case I was capturing few seconds so I didnt care much. 
    122 I add the parameter -an to remove audio capturing as I wasnt interested, but I suppose by removing it, it will capture the audio without adding extra parameters. 
     119The line above is capturing a full HD video at 60 FPS and converting into lossless H.264 video–that means your file is going to be very big! In my case I was capturing few seconds so I didn't care much. I added the parameter `-an` to remove audio capturing as I wasn't interested in audio, but I suppose by removing `-an` it will capture the audio without adding extra parameters. 
    123120 
    124 On my final command line I had to add "-vsync drop"  before "-f dshow" due to a strange issue where FFMPEG needed to be restarted 5 times before capturing at 60 FPS. 
     121On my final command line I had to add `-vsync drop`  before `-f dshow` due to a strange issue where `ffmpeg` needed to be restarted 5 times before capturing at 60 FPS. 
    125122 
    126123== Re-encoding == 
    127 In my case I was doing a re-encoding after the capture in h264 but with higher compression. 
    128124 
     125In my case I was doing a re-encoding after the capture in H.264 but with higher compression. 
    129126 
    130127{{{ 
    131128ffmpeg -y -i output.mp4 -pix_fmt yuv420p -c:v libx264 -crf 23 compressed.mp4 
    132  
    133129}}} 
    134130 
    135 Dont forget to add yuv420p otherwise some players would not able to play the file, only VLC. 
     131Don't forget to add `-pix_fmt yuv420p` otherwise some players would not able to play the file, only VLC. 
    136132 
    137133== Source == 
    138 Post on StackOverflow 
    139 [http://stackoverflow.com/questions/19212047/ffmpeg-command-line-for-capturing-and-recording-audio-and-video-in-720p-from-d] 
    140 Various forums  
     134 
     135* [http://stackoverflow.com/questions/19212047/ffmpeg-command-line-for-capturing-and-recording-audio-and-video-in-720p-from-d ffmpeg command line for capturing (and recording) audio and video in 720p from decklink card using Windows 7] 
     136