Comments (2)
Thank you for reaching out, this is very helpful,
I have done lot of changes on my project and after that
foreach (byte[] nal_unit in nal_units)
{
if (nal_unit.Length>2)
{
fs_v.Write(new byte[] { 0x00, 0x00, 0x00, 0x01 }, 0, 4); // Write Start Code
fs_v.Write(nal_unit, 0, nal_unit.Length); // Write NAL
}
}
this is working for me.
Thank you.
from sharprtsp.
Check if the h264 nals contains the intial 0x00 0x00 0x00 0x01 header.
I have found a similar problem for some cameras at works, and resolved checking for it and add when needed...
or you could try to debug the h264 and check if there are any errors in the parsing for the flir camera streaming...
This is the only thing I can think about, I don't know this kind of cameras, sorry
This is the code I use for this purpose
`bool frame_i = nal_units.Any(n => ((n.Span[0] >> 0) & 0x1F) == 5);
if (frame_i)
{
if (!ArrayUtils.StartsWith(_sps, 0, 4, [0x00, 0x00, 0x00, 0x01])) { bufferMemoryStream.Write([0x00, 0x00, 0x00, 0x01], 0, 4); }
bufferMemoryStream.Write(_sps, 0, _sps.Length);
if (!ArrayUtils.StartsWith(_pps, 0, 4, [0x00, 0x00, 0x00, 0x01])) { bufferMemoryStream.Write([0x00, 0x00, 0x00, 0x01], 0, 4); }
bufferMemoryStream.Write(_pps, 0, _pps.Length);
}`
You need to do the same later for the nal units when saving the frame info.
bufferMemoryStream is a MemoryStream that holds the required informations.
Remember, if you receive an I frame, you must save also the sps and pps information (as in code), not all the software can render h264 right if this info is missing.
from sharprtsp.
Related Issues (20)
- The function AuthenticationBasic make a little mistake. HOT 1
- Bug with library Meziantou.Polyfill HOT 3
- Adding a video display for CameraExample
- Bug In rtp packet extension reading HOT 1
- Freeze captured HOT 1
- Please check the Channels property of RtpTcpTransport. HOT 1
- feed aac raw data to rtspserver HOT 1
- Android camera server HOT 8
- Could not write header for output file #0 (incorrect codec parameters ?): Server returned 400 Bad Request HOT 6
- TestCard MJPG example HOT 1
- AAC RTP packets with multiple AU units per packet HOT 4
- h265payload question HOT 3
- RtspCameraExample issue when client is Hikvision NVR HOT 1
- Artifacts in H.264 video stream HOT 7
- README File: Spelling Mistakes Correction HOT 2
- repo is behind NuGet package HOT 2
- Update NuGet package please? HOT 2
- netstandard2.1 only? HOT 1
- Rtsp over Http tunneling HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharprtsp.