Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when send h265 1280x720 ffplay video will block broken #77

Open
fatalfeel opened this issue Jul 8, 2022 · 6 comments
Open

when send h265 1280x720 ffplay video will block broken #77

fatalfeel opened this issue Jul 8, 2022 · 6 comments

Comments

@fatalfeel
Copy link

fatalfeel commented Jul 8, 2022

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);

@connortechnology
Copy link

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.

@fatalfeel
Copy link
Author

fatalfeel commented Jul 8, 2022

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

@connortechnology
Copy link

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

@fatalfeel
Copy link
Author

i will try~~~~tks~

@hawuwu163
Copy link

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

@fatalfeel
Copy link
Author

thank you man ~ hawuwu163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants