mipops / dvrescue

Archivist-made software that supports data migration from DV tapes into digital files suitable for long-term preservation. Snapshot daily builds are at https://mediaarea.net/download/snapshots/binary/dvrescue/.
BSD 3-Clause "New" or "Revised" License
83 stars 19 forks source link

XML output for DeckLink capture #823

Closed g-maxime closed 4 months ago

g-maxime commented 4 months ago

Fixes #802

dericed commented 4 months ago

:D

dericed commented 4 months ago

with snapshot:

$ dvrescue device://84:3c0a102a:00000000 --control "/dev/tty.RS422 Deck Control" -x test.dvrescue.xml -m test.mkv --csv --verbosity 9
Capture frame 1, press ctrl+c to stop.Segmentation fault: 11

at time of crash the xml is empty and mkv is 946176 bytes. test.mkv.zip

g-maxime commented 4 months ago

Snapshot

dericed commented 4 months ago

On my M1 laptop:

$ dvrescue device://84:160a010c:00000000 --control "/dev/tty.RS422 Deck Control" --capture -x test81.xml -m test81.mkv
2024-02-27 11:55:01.009 dvrescue[3808:38443] WARNING: AVCaptureDeviceTypeExternal is deprecated for Continuity Cameras. Please use AVCaptureDeviceTypeContinuityCamera and add NSCameraUseContinuityCameraDeviceType to your Info.plist.
Capture frame 1, press c
trl+c to stop.Segmentation fault: 11

xml is empty and the mkv is attached test81.mkv.zip

I tested the deck via /opt/homebrew/opt/ffmpegdecklink/bin/ffmpeg-dl -f decklink -i "UltraStudio HD Mini" -c copy -t 1 out.mkv and that worked fine.

g-maxime commented 4 months ago

Snapshot: https://mediaarea.net/download/snapshots/binary/dvrescue/20240227/dvrescue_CLI_22.12.20240227_Mac.dmg

dericed commented 4 months ago

Ok, retesting.

$ dvrescue device://84:160a010c:00000000 --control "/dev/tty.RS422 Deck Control" --capture -x test85.xml -m test85.mkv
2024-02-27 15:01:17.564 dvrescue[18700:168048] WARNING: AVCaptureDeviceTypeExternal is deprecated for Continuity Cameras. Please use AVCaptureDeviceTypeContinuityCamera and add NSCameraUseContinuityCameraDeviceType to your Info.plist.
Capture frame 14, press ctrl+c to stop.drice:dvrescue drice$ 

basically stops on its own right away and gives 3 files test85.zip

I get a little xml though

<?xml version="1.0" encoding="UTF-8"?>
<dvrescue xmlns="https://mediaarea.net/dvrescue" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://mediaarea.net/dvrescue https://mediaarea.net/dvrescue/dvrescue.xsd" version="1.2.1">
    <creator>
        <program>dvrescue</program>
        <version>22.12.20240227</version>
        <library version="24.01">MediaInfoLib</library>
    </creator>
    <media ref="test85.mkv" fromCapture="device://84:160a010c:00000000" format="Matroska" size="13244214">
        <source video="sdi" audio="embedded" timecode="vitc">
        <frames count="14" pts="00:00:00.000000" end_pts="00:00:00.467133" size="720x486" video_rate="30000/1001" audio_rate="48000" channels="2">
            <frame n="0" pts="00:00:00.000000"/>
            <frame n="1" pts="00:00:00.033366"/>
            <frame n="2" pts="00:00:00.066733"/>
            <frame n="3" pts="00:00:00.100100"/>
            <frame n="4" pts="00:00:00.133466"/>
            <frame n="5" pts="00:00:00.166833"/>
            <frame n="6" pts="00:00:00.200200"/>
            <frame n="7" pts="00:00:00.233566"/>
            <frame n="8" pts="00:00:00.266933"/>
            <frame n="9" pts="00:00:00.300300"/>
            <frame n="10" pts="00:00:00.333666"/>
            <frame n="11" pts="00:00:00.367033"/>
            <frame n="12" pts="00:00:00.400400"/>
            <frame n="13" pts="00:00:00.433766"/>
        </frames>
    </media>
</dvrescue>

I then reran things when the deck was already playing and that time the capture kept running.

$ dvrescue device://84:160a010c:00000000 --control "/dev/tty.RS422 Deck Control" --capture -x test86.xml -m test86.mkv
2024-02-27 15:03:16.238 dvrescue[19136:172158] WARNING: AVCaptureDeviceTypeExternal is deprecated for Continuity Cameras. Please use AVCaptureDeviceTypeContinuityCamera and add NSCameraUseContinuityCameraDeviceType to your Info.plist.
Capture frame 167, press ctrl+c to stop.^Cdrice:dvrescue drice$ 

3 files out again test86.zip

<?xml version="1.0" encoding="UTF-8"?>
<dvrescue xmlns="https://mediaarea.net/dvrescue" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://mediaarea.net/dvrescue https://mediaarea.net/dvrescue/dvrescue.xsd" version="1.2.1">
    <creator>
        <program>dvrescue</program>
        <version>22.12.20240227</version>
        <library version="24.01">MediaInfoLib</library>
    </creator>
    <media ref="test86.mkv" fromCapture="device://84:160a010c:00000000" format="Matroska" size="157985064">
        <stop method='user' extra='SIGINT'/>
        <source video="sdi" audio="embedded" timecode="vitc">
        <frames count="167" pts="00:00:00.000000" end_pts="00:00:05.572233" size="720x486" video_rate="30000/1001" audio_rate="48000" channels="2">
            <frame n="0" pts="00:00:00.000000" tc="00:03:32;08"/>
            <frame n="1" pts="00:00:00.033366" tc="00:03:32;09"/>
            <frame n="2" pts="00:00:00.066733" tc="00:03:32;10"/>

<!-- removed -->

            <frame n="165" pts="00:00:05.505500" tc="00:03:37;25"/>
            <frame n="166" pts="00:00:05.538866" tc="00:03:37;25"/>
        </frames>
    </media>
</dvrescue>
dericed commented 4 months ago

ah, some xml errors:

the <source> tag opens but never closes

<source video="sdi" audio="embedded" timecode="vitc">

If I change that element to <source video="sdi" audio="embedded" timecode="vitc"/> then it's valid xml but not valid to schema:

$ xmllint --noout --schema tools/dvrescue.xsd test86.xml
test86.xml:10: element source: Schemas validity error : Element '{https://mediaarea.net/dvrescue}source': This element is not expected. Expected is ( {https://mediaarea.net/dvrescue}frames ).
test86.xml fails to validate
dericed commented 4 months ago

@g-maxime can you also add the pts attribute?