Closed dericed closed 3 years ago
frame/@abst
has 10 (consecutive) 2 2 values per frame, I suggest to provide the smallest one in the XML output, fine enough?
Then we could add info when values are not the expected ones in the same frame (not same/consecutive etc)
well officially $DIF_SEQUENCE_PER_FRAME_COUNT 2 2. Smallest is okay, if you dismiss values that are stored within nulled packs (example: the nulled subcode blocks in https://mediaarea.net/DVAnalyzer/dif-incoherency shouldn't result is @abst=0 if other subcodes contain valid abst.)
I am still uncertain if the incrementation of abst is consistent from dif sequence to dif sequence, but if consistent then you could use @abst - $number_of_dif_sequence_the_abst_was_found_in * $some_increment_multiplier
to approximate what the first abst of the frame should be.
@bf
would be the last bit of the 24 bit sequence. Default as zero and unstored, but include@bf=1
if present.
@bf
is at 99.999% always 1 ( = no discontinuity). I suggest default 1 and displayed if present and 0.
We could also inverse the logic (1 mean discontinuity) but may be misleading for people reading the spec.
Resolved in https://github.com/mipops/dvrescue/pull/242, excepting @bf
for later investigation.
add the following attributes:
frame/@abst
frame/@abst_r
frame/@abst_nc
frame/@bf
@abst
is parsed as described on page 181 of iec61834-1{ed1.0}b.pdf. It is a 23 bit value written in the ssyb packs of the subcode section. Currently mediainfolib (as does smpte 314m) refers to abtn as arbitrary bits:The 8 bit arbitrary bits of each triplet of sync blocks compose the 24 bits of the 23-bit abst value and the blank flag (bf). For quick reference the 24 bit value can be extracted (from a healthy frame) with
xxd -ps -c 80 single-frame.dv | grep ^3.0.00 | awk '{print substr($0,40,2) substr($0,24,2) substr($0,8,2)}'
. As with timecode, if the pack containing the value is all-null or all-ones then check for another occurrence. Each subcode dif block should contain two copies of the abst, so 40 copies all together.Each dif sequence of the frame will have its own abst value. I propose in the xml that the abst is the value of the first dif sequence. If the first dif sequence does not have a valid abst, then read from the first valid dif sequence abst. If the first value abst is in dif sequence n then store abst as a value of
n:abst - (dif_sequence_number * abst_increment)
to infer what the first abst value would have been if read correctly.As usual
@abst_r
would flag repeated values of abst and@abst_nc
would note when the abst does not follow the incrementation pattern. Invalid abst should be excused from triggering _r or _nc.@bf
would be the last bit of the 24 bit sequence. Default as zero and unstored, but include@bf=1
if present. The@abst
value should be stored in the xml as a decimal, converting the 23 bit value to decimal format.Notes on validating the 8-bit values of the abst. The four bits following each 8 bit value are the Subcode sync block number values which number the 12 subcode blocks from 0x0000 - 0x0011. So the Subcode sync block number could be verified to make sure they match their position in the subcode and if not then ignore the 8 bit component of the abst.
For example, here's the hex of the first 12 subcode blocks of a frame. The 2nd column (8 bit) shows the 24 bits of the abst+bf and the 3rd column (4 bit) shows the subcode sync block number. The subcode sync block number show a cycle of 0-b and thus all blocks validate the test and the 1st abst+bf is 001c22 and the second abst+bf is 001c3e.