RtspServer icon indicating copy to clipboard operation
RtspServer copied to clipboard

when send h265 1280x720 ffplay video will block broken

Open fatalfeel opened this issue 3 years ago • 6 comments

reason because memcpy(tmp_pkt.data.get(), pkt.data.get(), pkt.size); -> need time and make slow sendto better be no copy, just copy data pointer

//in MediaSession::AddSource tmp_pkt.data = pkt.data; memcpy(tmp_pkt.data.get(), pkt.data.get(), pkt.size); tmp_pkt.size = pkt.size; tmp_pkt.last = pkt.last; tmp_pkt.timestamp = pkt.timestamp; tmp_pkt.type = pkt.type; packets.emplace(id, tmp_pkt);

fatalfeel avatar Jul 08 '22 07:07 fatalfeel

Are you suggesting replacing this block with just packets.emplace(id,pkt); ? I agree this code is bad... as soon as we go out of scope, tmp_pkt gets freed... packets.emplace has to either copy or take ownership. Seems like maybe a shared_ptr approach would be good.

connortechnology avatar Jul 08 '22 18:07 connortechnology

fixed i put my patch here http://fatalfeel.blogspot.com/2013/12/rtsp-server-for-h264-h265-aac.html

I fix a lot of it i compare it with live555-latest.tar.gz all raw bytes sendto now they are the same full code is stable also can play video and audio at the same time I sent to ur email ,done here is my demo: https://drive.google.com/file/d/1ZlD7SWmovdHL2XCxAmtjuEziGfH8YdJv/view

ps: Technology brings happiness to mankind Albert Einstein: The release of atom power has changed everything except our way of thinking... the solution to this problem lies in the heart of mankind. If only I had known, I should have become a watchmaker. https://atomictrauma.wordpress.com/the-scientists/albert-einstein

fatalfeel avatar Jul 08 '22 18:07 fatalfeel

Please learn about Pull Requests. (PR)s. It saves a lot of time and effort for everyone.

connortechnology avatar Jul 09 '22 01:07 connortechnology

i will try~~~~tks~

fatalfeel avatar Jul 09 '22 07:07 fatalfeel

we found this problem, then saw this issue by today nice job!

hawuwu163 avatar Jul 28 '22 04:07 hawuwu163

thank you man ~ hawuwu163

fatalfeel avatar Jul 28 '22 09:07 fatalfeel