BogdanovKirill / RtspClientSharp

Pure C# RTSP client for .NET Standard without external dependencies and with true async nature. I welcome contributions.
MIT License
706 stars 284 forks source link

Transform Raw264Frame to Jpeg byte[] #60

Closed ramonmpa closed 4 years ago

ramonmpa commented 4 years ago

I'm trying to transform a Raw264Frame to Jpeg format byte array, but don't know which class should I use for this. In my case I have to take a picture of the camera stream and save as jpeg file.

Do you know how to transform a Raw264Frame to a Jpeg byte[]?

Thanks in advance!

For testing purpose I'm using this public rtsp url: rtsp://freja.hiof.no:1935/rtplive/definst/hessdalen03.stream

RandDruid commented 4 years ago

The easiest way is to take SimpleRtspPlayer example, go to VideoView.xaml.cs, function Invalidate. It writes every new frame to WriteableBitmap. You can save it to disk as described in https://stackoverflow.com/questions/17140774/how-to-save-a-writeablebitmap-as-a-file

ramonmpa commented 4 years ago

Thank you so much RandDruid!