omion
25th April 2006, 11:06
I'm making a distributed-encoder program for x264, and I've gotten pretty far with the first pass. However, I ran into a small problem/strangeness when encoding chunks out of a movie.
Basically, If I did two encodings: one from the first I frame and one from the second I-frame (using the --seek option) there were differences between the encodings.
Even though the QP for all the overlapping frames would be the same, some other things would be different. An example:
Starting from 0 | --seek 67
frame= 64 QP=23 Slice:B size=11425 |
frame= 65 QP=21 Slice:P size=15985 |
frame= 66 QP=21 Slice:P size=17080 |
frame= 67 QP=18 Slice:I size=54697 | frame= 0 QP=18 Slice:I size=54696
frame= 68 QP=21 Slice:P size=36015 | frame= 1 QP=21 Slice:P size=36078
frame= 69 QP=23 Slice:B size=22360 | frame= 2 QP=23 Slice:B size=22566
frame= 70 QP=21 Slice:P size=37255 | frame= 3 QP=21 Slice:P size=37262
frame= 71 QP=21 Slice:P size=37799 | frame= 4 QP=21 Slice:P size=37769
frame= 72 QP=21 Slice:P size=34447 | frame= 5 QP=21 Slice:P size=34417
frame= 73 QP=23 Slice:B size=31303 | frame= 6 QP=23 Slice:B size=31207
frame= 74 QP=21 Slice:P size=31827 | frame= 7 QP=21 Slice:P size=31915
frame= 75 QP=21 Slice:P size=44472 | frame= 8 QP=21 Slice:P size=44569
frame= 76 QP=23 Slice:B size=30729 | frame= 9 QP=23 Slice:B size=30748
frame= 77 QP=21 Slice:P size=41246 | frame= 10 QP=21 Slice:P size=41280
frame= 78 QP=23 Slice:B size=30227 | frame= 11 QP=23 Slice:B size=30243
frame= 79 QP=21 Slice:P size=37784 | frame= 12 QP=21 Slice:P size=37893
frame= 80 QP=21 Slice:P size=36100 | frame= 13 QP=21 Slice:P size=36041
In all of my encodes the first frame of the file is always 1 byte smaller than the same frame in the other file. The differences last until the next I-frame, and everything else seems to be the same.
I was under the impression that the rate control only changed the QP and nothing else. But the same I-frame with the same QP has a different result, making the whole scene different. Is there any way to make them the same?
This is fairly important, as my program needs to encode a lot of one-scene pieces in order to stitch the other pieces together properly. If the result of the small encodes is not the same as one large encode, then it's not very useful...
Since it seems that everything after that one scene is OK, I suppose I could encode two scenes and throw out the first one, but that would be quite a waste.
Any help?
Basically, If I did two encodings: one from the first I frame and one from the second I-frame (using the --seek option) there were differences between the encodings.
Even though the QP for all the overlapping frames would be the same, some other things would be different. An example:
Starting from 0 | --seek 67
frame= 64 QP=23 Slice:B size=11425 |
frame= 65 QP=21 Slice:P size=15985 |
frame= 66 QP=21 Slice:P size=17080 |
frame= 67 QP=18 Slice:I size=54697 | frame= 0 QP=18 Slice:I size=54696
frame= 68 QP=21 Slice:P size=36015 | frame= 1 QP=21 Slice:P size=36078
frame= 69 QP=23 Slice:B size=22360 | frame= 2 QP=23 Slice:B size=22566
frame= 70 QP=21 Slice:P size=37255 | frame= 3 QP=21 Slice:P size=37262
frame= 71 QP=21 Slice:P size=37799 | frame= 4 QP=21 Slice:P size=37769
frame= 72 QP=21 Slice:P size=34447 | frame= 5 QP=21 Slice:P size=34417
frame= 73 QP=23 Slice:B size=31303 | frame= 6 QP=23 Slice:B size=31207
frame= 74 QP=21 Slice:P size=31827 | frame= 7 QP=21 Slice:P size=31915
frame= 75 QP=21 Slice:P size=44472 | frame= 8 QP=21 Slice:P size=44569
frame= 76 QP=23 Slice:B size=30729 | frame= 9 QP=23 Slice:B size=30748
frame= 77 QP=21 Slice:P size=41246 | frame= 10 QP=21 Slice:P size=41280
frame= 78 QP=23 Slice:B size=30227 | frame= 11 QP=23 Slice:B size=30243
frame= 79 QP=21 Slice:P size=37784 | frame= 12 QP=21 Slice:P size=37893
frame= 80 QP=21 Slice:P size=36100 | frame= 13 QP=21 Slice:P size=36041
In all of my encodes the first frame of the file is always 1 byte smaller than the same frame in the other file. The differences last until the next I-frame, and everything else seems to be the same.
I was under the impression that the rate control only changed the QP and nothing else. But the same I-frame with the same QP has a different result, making the whole scene different. Is there any way to make them the same?
This is fairly important, as my program needs to encode a lot of one-scene pieces in order to stitch the other pieces together properly. If the result of the small encodes is not the same as one large encode, then it's not very useful...
Since it seems that everything after that one scene is OK, I suppose I could encode two scenes and throw out the first one, but that would be quite a waste.
Any help?