Broadway icon indicating copy to clipboard operation
Broadway copied to clipboard

How to get actual size of frame after decoded

Open chjcken opened this issue 7 years ago • 3 comments

Hi @soliton4

As I know, H264 compression algorithms require all video widths and heights to be multiples of 16. So that if I have a 360x640 image, it has to be placed in a larger frame (368x640) for compression (see attachment)

I use broadway decoder to decode the frame (in attachment), width and height that I get from "onPictureDecoded" are 368x640

My question is how can I get actual frame size? I found that I should look in sps/pps data for cropping information but I can't find them in broadway decoder.

h264frame.zip

chjcken avatar May 31 '17 03:05 chjcken

that is actually a good question. i thought the value was provided already but it turns out i allways know the size of my video stream. i should propagate the true width in the onpicdecoded function.

the height is allways the true height

soliton4 avatar May 31 '17 17:05 soliton4

Both mp4 and webm carry the actual video source dimensions in their preambles.

OllieJones avatar Jul 20 '18 21:07 OllieJones

@OllieJones thanks for trying to help. the data in the source stream is not a mystery to us. we just would need to change the decoder to carry that data up until the output function is called. would you care to implement that change?

soliton4 avatar Jul 20 '18 21:07 soliton4