Sven Alisch skrev 2011-03-02 20:09:
Hello,
I have a question about using avcodec_encode_video. I want to do following. I
cut an h.264-file not at key frames. I make it between them. The GOP I cutted
in, I have to reencode. It is OK so far and works, if I encode the beginning or
the ending of that file. I mean if my first cut point is not a key frame, but
the second is a key frame, then it works. If both cut points arn't keys, then
the avcodec_encode_video-function hangs. I mean no crash or something, just
hanging.
So I made an avcodec_close(...) after every gop-encoding (and yes, I open the
avcodec if I want to encode again), and then it works, BUT, and this is not
good, the program works instable.
What do you mean by instable? Are you perhaps doing this in a
multi-threaded way?
So my question is, is there a good, clean and stable way to encode several
gops? I tried also an avcodec_flush_buffers, but it does not work -
avcodec_encode_video hangs :-(. Any help and ideas?
Where does it hang exactly? (use gdb to check that)
You might need to flush the encoder by sending NULL frames. Look at what
ffmpeg.c does when it cleans up.
/Tomas
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user