Compressed frames don't work on testcameras
AnsweredHello,
I'm able to decode compressed frames when I'm using a real camera but testcameras don't work.
What I do and how you can test it: In the plugin, I save all chunks of compressed frames from the camera to a single file. After that I open that file with vlc, mpv or ffplay (all of them work). When I use a real camera I'm able to play this file with mpv, vlc and ffplay. However, if I create the file in the same way but with a testcamera (not a regular camera), I can't play it, none of the players are capable of opening it.
I've tried to launch testcamera with and without secondary streams, nothing changes. My system is Ubuntu, x64, digitalwatchdog 4.1.
FIle which I make of compressed frames from the real camera:
ffprobe -i camera.h264
...
Input #0, h264, from 'camera.h264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 2592x1944 [SAR 1:1 DAR 4:3], 29.58 fps, 30 tbr, 1200k tbn, 60 tbc
File from of compressed frames from a testcamera:
ffprobe -i test.h264
...
[h264 @ 0x562203f5d080] Format h264 detected only with low score of 1, misdetection possible!
[h264 @ 0x562203f5e8a0] missing picture in access unit with size 4104807
[AVBSFContext @ 0x562203f5dcc0] No start code is found.
test.h264: Invalid data found when processing input
Even if I use h264parse direcrly it doesn't work on testcameras files:
gst-launch-1.0 filesrc location=test.h264 ! h264parse ! avdec_h264 ! xvimagesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: No valid frames found before end of stream
Additional debug info:
gstbaseparse.c(3603): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
File that I use to create testcameras (it's uploaded here https://file.io/os4ZxR4h4shs )
ffprobe -i sample_1080p_h264.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample_1080p_h264.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:00:48.10, start: 0.000000, bitrate: 5813 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 5675 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
File that I've combined from produced testcamera's compressed frames: https://file.io/2DQPaI66zoai
-
Hello Hendrick,
However, if I create the file in the same way but with a testcamera (not a regular camera), I can't play it, none of the players are capable of opening it.
What is the purpose of this activity?
Could you please tell more about your final objective? What is the solution are developing, which needs frames to be saved to a file from a camera, and from the testcamera in particular?JIRA-VMS-22991
0 -
Hello Andrey,
I'm trying to test the plugin I'm developing. I want to see how many cameras I can handle and I simply can't connect 50-60 real cameras to my server as I don't have them, that's why I want to use testcameras for load testing.
I've created a file only for demonstrational purposes, so it would be easier to verify that a stream is corrupted. To check that, you just need to create a file and you will see that it's corrupted. In other case there must be some process which receives chunks of the stream from Nx via some protocol and then paseses it to some processing pipeline. Instead, you can simply write the stream to a file and check it with vlc or mpv. Of course I'm processing the stream differently in the real system but it doesn't change the fact that streams from testcameras are corrupted.
I'm sending compressed frames from my plugin for further processing and I'm able to process compressed frames only on usual cameras because I'm receiving garbage from testcameras. All examples of data are attached.0 -
Hendrick,
Could please share your code and once again videofiles you are using for testcamera?
0 -
Andrey,
Ok, I will do it on Monday or Tuesday.
I also can provide you with individual chunks of compressed frames and their concatenation for both real camera and testcamera.0 -
Andrey, https://filebin.net/ieevpde121zl9rdm
There is a patch file. You can go to a directory which contains 'metadata_sdk' folder (from nxwitness-metadata_sdk-4.1.0.31398-universal.zip ) and apply it via
patch -p0 < patch.txt
'FHD_testcamera' and 'FHD_real' contains individual chunks of compressed frames and a concatenated stream file.
' sample_1080p_h264.mp4' is a file that I'm using for testcamera.0 -
Thank you, Hendrick.
I've got your materials.
0 -
Hendrick,
I have reproduced the issue and got confirmation that testcamera passes frames to the Server in a specific way.
We are going to fix it.
Will update here later on.0 -
Hi everyone!
I have the similar problem and want to know how is going on?
0 -
Hello,
The issue has been fixed.
MetaVMS 5.0.0.33871 R4 already includes the fix.
0
Please sign in to leave a comment.
Comments
9 comments