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

Heavy artifacts, but only in live stream #7

Open
heidtn opened this issue Feb 21, 2017 · 2 comments
Open

Heavy artifacts, but only in live stream #7

heidtn opened this issue Feb 21, 2017 · 2 comments

Comments

@heidtn
Copy link

heidtn commented Feb 21, 2017

I'm currently reading a TCP stream from a data source that is sending h264 frames. If I take the raw data and write to a file then later read frame by frame from the same file and pass it through h264decode, it works fine. All of the frames are clear and have minimal artifacting. However, if I instead pass the data directly into an h264decode.Decoder from the live stream, there's horrible streaking and artifacting. Any ideas what could cause this?

@tzwenn
Copy link
Owner

tzwenn commented Feb 23, 2017

Can you elaborate on what artifact you see and maybe provide a sample?
Also have you tried to buffer/serialize your frames in between in some other dataformat?
Do you might have some timing issues, or do the frames not arrive completely?

I've been only processing frames from a TCP stream so far and have not experienced your described behaviour.

@heidtn
Copy link
Author

heidtn commented Feb 24, 2017

I've uploaded an example of the issues here:
badquad

I've tried to buffer the frames as I receive them, but it doesn't seem to fix things at all. I assume the frames arrive completely as saving them to a file first then reading seems to work. Maybe it does have something to do with timing? How could I check?

Here's how I'm extracting frames:

while True:
            count +=1
            try:
                if self.decoder is not None:
                    #data is a full startframe, the first bytes are '\x0\x0\x0\x1'
                    data = pipe.recv_bytes() 
                    yuv = self.decoder.decodeFrame(data)
                    if yuv is not None:
                        #things are done with the frame here
                        #...
                        #...
                else: #this is our first frame with the avcc data
                    self.avcc = pipe.recv_bytes()
                    self.decoder = h264decode.Decoder(self.avcc)    
                    print("initialized decorder")
            except socket.timeout:
                print("error!") 

Any thoughts?

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

2 participants