diff --git a/doc/ExportFileFormat.xml b/doc/ExportFileFormat.xml index 404738979..97e878617 100644 --- a/doc/ExportFileFormat.xml +++ b/doc/ExportFileFormat.xml @@ -251,7 +251,7 @@
Use case 2: Forensic analysis at court A court receives video clips from a grocery store, a street surveillance system and a metro operator. All three videos are shown in the court’s approved video player. - The judges want to see the suspect in all three video clips with exact time information. They also want to have information when the video clips have been exported and whether the video sequence is complete and authentic. + The judges want to see the suspect in all three video clips with exact time information. They also want to have information when the video clips have been exported and whether the video sequence is complete and authentic. Further, they preferably also want to validate the authenticity and provenance of videos using ONVIF Media Signing.
Use case 3: Playback at players not equipped according to the present specification @@ -260,6 +260,29 @@ Export Format +
+ Requirements to Preserve Media Signing + In order to maintain the integrity and authenticity of ONVIF streaming media signed in + accordance with the ONVIF Media Signing (OMS) specification when exporting to an MP4 + container, the following prerequisite steps shall be adhered to during the export process to + ensure signature verification remains intact and media evidence can be trusted as + tamper-proof. + Preserve NAL order and bytes + ONVIF signed media bitstream captured from the device shall not be filtered, rewritten + reencoded or normalized, as the raw format and order of NAL units is critical. + Keep OMS SEI NAL units + ONVIF signed media includes signature information in SEI (Supplemental Enhancement + Information) frames of type user data unregistered within the codec + format (H.264 and H.265) and they shall not be stripped. + As SEI frames do not affect the video frame decoding, ISO/IEC 14496-12 provides the + user an option to remove these when creating an MP4 file, but these are critical for ONVIF + signed media and hence Never strip these. + Add OMS Certificate SEI NAL unit if present + The device has an option to add a Certificate SEI at the beginning of a stream. This + SEI includes all necessary information to validate subsequent SEIs. If the stream from the + device had a Certificate SEI, that SEI shall be added to the first access unit of the + exported recording. +
Required Side Information @@ -798,7 +821,7 @@ class AdditionalUserInformationBox cert2 Certificate of the exporter mfra1 Optional movie fragment random access (must be last in file) tfra1 Track fragment random access - mfro1 Movie fragment random access offset + mfro1 Movie fragment random access offset The superscripts denotes the specification that defines the box: @@ -808,6 +831,47 @@ class AdditionalUserInformationBox 3 ETSI TS 126 244 + + Media Signing Recommendations + No re-encoding + ONVIF signed media stream captured from the device shall not be transcoded or + recompressed. Instead Use pure remuxing (-c copy in ffmpeg) to change + containers. + + Treat the video elementary stream as immutable + + + + Keep all SPS/PPS/VPS, access unit delimiter (AUD), prefix/suffix SEI and + slice NALs in their original order. + Do not change frame rate, timescale, timebase or GOP structure. Avoid + frame duplication, dropping, de‑interlacing or timestamp “cleanup”. + For SEI preservation: In H.264 the SEI NAL type is 6; in HEVC, SEI + prefix/suffix types are 39/40. These must stay attached to the same access units they + originally accompanied. Do not convert or regroup SEIs (e.g., never swap HEVC prefix and + suffix). + Avoid bitstream filters. Only use a filter when absolutely certain it will + not modify or remove SEIs. Never run “cleaning” filters that remove private SEIs. + + + + + Validate before and after File Export. Run OMS validation on the original source and again + on the exported MP4 to confirm integrity. + + + A simpler test is to only verify that the MP4 file has SEIs present after export. Below is + an ffmpeg command for that. + &1 | grep -i sei]]> + + + Cut at signature‑safe boundaries + + Trim at SEIs. There will always be a "dangling end" of the exported file, that is, + frames that cannot be validated since the associated SEI is not present in the exported + recording. To minimize the "dangling end", trim at frames with a signed SEI (inclusive), + that is, a SEI with a signature. + Revision History diff --git a/doc/MediaSigning.xml b/doc/MediaSigning.xml index 84feac7df..d53f7c8cd 100644 --- a/doc/MediaSigning.xml +++ b/doc/MediaSigning.xml @@ -1282,10 +1282,10 @@ Minimum requirements for client handling of a signed video stream Attached to an AU of a signed video stream may be a certificate SEI including all information that is only sent once; The certificate SEI bit is set. - This SEI should be stored for later use. Further, when exporting a video segment to file, - this certificate SEI shall be added to the first AU of that recording. - The client shall not remove any SEI-frames from the stream. It is possible to move - them to the AU including the I-frame of the following GOP the particular SEI did sign. + This SEI shall be stored for later use. Further, when exporting a video segment to + file, this certificate SEI shall be added to the first AU of that recording. + The client shall make sure that the SEIs are not removed when exporting to an + MP4 file. For a full list of requirements; See the ExportFileFormat specification.
Client side validation