version 1.0.0
New method for Graphs.
New feature included, graph scale and start of frame checker.
New Documents in documents/Usb Video Class Frame Detector.pdf
The UVC Frame Detector (UVCFD) analyzes USB video frames by capturing data, validating headers, and detecting errors in payloads and frames. It supports live camera streams and pre-recorded pcapng files.
- Real-time analysis of USB video data.
- Validation and error detection for payloads and frames.
- Comprehensive error statistics.
This programme uses pipeline with tshark gets parsed data, recombine urb into payloads and frames.
Detects invalid datas and payload headers, frames.
Shows error data, stats. _t stands for tui, _g stands for gui.
Can use live stream using camera application
Or can use pcapng file
in window using camera application
.\run_uvcfd.ps1
in window using pcapng
.\run_uvcfdp.ps1
in linux
./run_uvcfd.bash
This programme uses usbmon* in linux to get raw data, recombine urb into payloads and frames.
Uses same validation with oldmanandsea, however controlconfig data is not yet programmed.
This programme uses usbmon* in linux to get raw data live, recombine urb into payloads and frames.
Uses same validation with oldmanandsea & Moncapler, however controlconfig data is not yet programmed.
Uses captured raw log data to test whether validation for payload and frame is well made.
Google test is used to test each unit, and linux urb is used as an example (but can run in window).
Gets txt file from wireshark, File>Export Packet Dissections>As Plain Text>Details: All expanded
Use tests/change_shark/shkwhl_b for bulk shkwhl_i for iso
And modify the log_test code to find designate txt file, run. _t stands for tui, _g stands for gui
Auto controlconfig is not programmed.
Can build and run in linux only, tests moncapler whether it has combined urb blocks into valid frames.
(only cmd works, not ps1, open in dev mode if possible)
in ps1, put "cmd /c" at the start of command
To run this code in window, must install wireshark in computer with USBPcap
If USBPcap is not installed with Wireshark, reinstall wireshark and check USBPcap install
After install, reboot
C:\Program Files\Wireshark
Find Wireshark.exe > go to Help(H) > Wireshark info(A) > Folder
Check if Extcap Path is set extcap/wireshark
If so go to C:\Program Files\Wireshark\extcap and move USBPcapCMD.exe to wireshark directory
- mkdir images
- mkdir build
- cd build
- Configure the build system using CMake:
- For Debug build:
cmake -DCMAKE_BUILD_TYPE=Debug .. - For Release build:
cmake -DCMAKE_BUILD_TYPE=Release ..
- Configure the build system using CMake:
- For Debug build:
cmake --build . --config Debug - For Release build:
cmake --build . --config Release
- cd Debug/Release
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.19045.
-- The CXX compiler identification is MSVC 19.41.34120.0
-- The C compiler identification is MSVC 19.41.34120.0
Use the shellscript given.
0. .\run_uvcfd.ps1
Use the shellscript given. Make sure the library packages are installed.
The Wireshark program needs to be installed at the Program Files directory with USBPcapCMD.
If not, change the shellscript path. But DO NOT Edit the Fields Data or its Sequence.
Make sure the uvcfd.exe correctly path, or edit the shellscript.
If want to force the format then type down below...
Can find maximum frame size and maximum payload size in
for Window > download usb device tree viewer and check video streaming format type descriptor: dwMaxVideoFrameBufferSize
for linux type lsusb -v and find dwMaxVideoFrameBufferSize
if leave blank for -fw -fh -fps -ff -mf -mp, everything will be set automatically
each indicate frame_width frame_height frame_per_sec frame_format max_frame_size max_payload_size
-e usb.transfer_type -e frame.time_epoch -e frame.len -e usb.iso.data // Must be in correct order
if you are in build directory, can change C:\-----PROJECT_DIRECTORY_PATH-----\build into .\Debug\oldmanandsea.exe
- ./example
To test validation algorithm, can test with colour bar screen of jpeg
Build with cmake above
- ./valid_test
Build with cmake above
And then it filters the data by looking at urb header and find specific device's urb.
When it is found, devide them into in out, control bulk iso.
And recombine urb block with each algorithms to have complete transfer data, starting with payload header.
Then another thread validate the transferred data by looking at the headers.
When validation is finished, transfers are combined into a frame.
When it is done, fps are calculated and shows whether frame has errors.
Error statistics will be given.
Overall, the upper three windows display the image, graph, and control panel.
The middle section shows error log frame information and summarizes the error types.
The bottom section displays the latest streaming data information with updating statistics.
Coral coloured graph shows the actual received time of the URB block in the computer system.
Mint coloured graph shows the PTS time that the camera gave. Yellow dots represent the start of every frame. White dots represent the time scale of every designated millisecond.
When the same value is received in the programme, it draws right next to the previous plot, which means the most left plot of the block represents actual interpreted time.
By comparing SOF yellow dot and PTS block’s left edge, shows the delay of receiving streaming data.
PTS data is calculated in a different way due to the overflow actions.
To change the graph scale, change the #define value in window_manager.hpp
For the detailed information, please checkout the usb video clas frame detector.pdf in the documents directory
When the UVCPHeaderChecker class receives payload data, it parses the header and validates it sequentially.
Red: These symbols are responsible for verifying the validity of the payload.
Ensuring that the payload data conforms to expected standards and specifications before further processing.
If an invalid payload is detected during frame processing, except for eof error and fid error, the erroneous payload data is discarded to prevent corruption or further issues in the overall data flow.
Blue: These symbols focus on validating the integrity of the entire frame, identifying any anomalies or inconsistencies.
Pink: These symbols are used to identify and handle suspicious data, but only when the suspicious flag is activated. Aggregating all suspicious data found within the frames, allowing for detailed analysis and corrective action as needed.


