Hi,
We have configure H264 for IP camera and one camera attached to NVR (NVR has multiple camera).
Now we are trying to get raw data using “RawLiveSource”, we are able to get the raw data for both camera but we are only able to parse raw data for IP camera using ffmpeg.
Please find attached IP_Camera.raw for your reference.
ffmpeg.exe -f h264 -i IP_Camera.raw -c copy IP_Camera.asf
When we try to parse camera connected to NVR raw data with same command it is not parsing data.
ffmpeg.exe -f h264 -i NVR.raw -c copy NVR.asf
[h264 @ 00000155049e5000] non-existing PPS 0 referenced
[extract_extradata @ 00000155049c5800] Invalid NAL unit 0, skipping.
Last message repeated 1 times
[h264 @ 00000155049e5000] Invalid NAL unit 0, skipping.
Last message repeated 1 times
[h264 @ 00000155049e5000] non-existing PPS 0 referenced
[h264 @ 00000155049e5000] decode_slice_header error
[h264 @ 00000155049e5000] no frame!
[h264 @ 00000155049db600] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, h264, from 'NVR.raw':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264, none, 25 tbr, 1200k tbn
File 'IP_Camera.asf' already exists. Overwrite? [y/N] y
[asf @ 0000015504aa04c0] dimensions not set
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Last message repeated 1 times
we tried with different h264 options in ffmpeg but no success.
Please find attached IP camera ad Camera attached to NVR Milestone configuration.
Can you please suggest in which format raw data returns when camera is attached to NVR ?
Regards,
Gaurav
The raw data might be encapsulated using the GenericByteData format. https://doc.developer.milestonesys.com/html/index.html?base=mipgenericbytedata/main.html&tree=tree_3.html
Please see if that is the issue, if you find a GenericByteData header try to strip it away and see if you then have the expected format.
Hi @Bo Ellegård Andersen (Milestone Systems)
I tried to skip the Generic Header using “-skip_initial_bytes 32” flag of ffmpeg but no success.
Still same error.
Regards,
Gaurav
We got a bit confused trying to figure out what might be the issue in my team. Is what you name IP_Camera and NVR both cameras when it comes to XProtect? Do these cameras work when viewed in Management Client and Smart Client?
Please make a snapshot of each of the cameras when viewed in the Smart Client with diagnostic overlay enabled and let us see.
https://developer.milestonesys.com/s/article/how-to-use-the-XProtect-Smart-Client-video-diagnostic-overlay
There is one scenario where XProtect will transcode to JPEG and that is if there is a privacy masking setup for the camera. Please check if a privacy masking might be configured in the XProtect Management Client.
Hi @Bo Ellegård Andersen (Milestone Systems) ,
IP_Camera : Camera is directly registered to Milestone, Please find attached Snap.
NVR : Multiple cameras are connected to Hardware called NVR and we are registering NVR IP to Milestone.
We are able to see the Live steam into Milestone Smart Client and Management Client for IP camera and Camera under NVR. you can see into above snap and there is no privacy masking enable.
IP Camera : diagnostic overlay
Camera under NVR : diagnostic overlay
both camera shows H264 as codec but raw data parsing is not happening with H264 coded for camera attached to NVR.
Please let me know if any information required to debug the problem
Regards,
Gaurav
Hi @Bo Ellegård Andersen (Milestone Systems) ,
Is there any update on this?
Regards,
Gaurav
We are unable to say why the data does not fit.
One thought is that the frame maybe is split in multiple packets. You would then have to merge the packets before decoding.
I wonder if you can try to change some of the settings governing the video stream, if you reduce the resolution, bitrate or other parameters it might start working.
Hi @Bo Ellegård Andersen (Milestone Systems) ,
How we can identify frame is splited into multiple packet? If we need to merge packet, we need information of sequence of the packet and identifier of first packet.
Reducing the resolution will not solve problem because customer might have different resolution so we need to support for all resolution but I have tried to reduce the resolution and bit rate and validate but it has same problem.
Please suggest your feedback.
Regards,
Gaurav
We do not have the right expertise to analyse the h264 data in Milestone Support.
I had an idea that you should reduce the bitrate drastically and see if small frames was going through, I am not sure it is good advise and what you would conclude if that was what made the data work.
One thing, would you be able to use the data from the camera directly as you do with the data from RawLiveSource? I have a feeling that comparing the data from the camera and from RawLiveSource you should be able to see if it is just packaging or the Milestone introduces a corruption.