As a follow-up, it turns out that this was not a video decoding or  
sws_scale issue. I had been relying on the video streams  
sample_aspect_ratio to determine where to put the video output texture  
points. Well, the avi file had the correct ratio because I encoded it  
with mencoder using "--force-avi-aspect 1.3333333". When I switched to  
the straight output from the capture card or after transcoding to  
another mpg where --force-avi-aspect was meaningless, the  
sample_aspect_ratio field was invalid and equal to 0. This actually  
forced the points to reverse their order relative, which is important  
in opengl. Due to backface culling, the triangles I was rendering  
textures onto were all facing away from me and thus the textures were  
not rendered onto them.

For testing, I have set the aspect ratio manually to 4:3, but I'm  
wondering how I can determine the correct aspect ratio in the future.  
The reason I was using force-avi-aspect on the avi files was due to  
the fact that I want my video frames to be 256x256. Thus, I can create  
textures (which must have dimensions of sizes 2^n) and render to them  
without having to actually rescale this image. If you haven't figured  
this out yet, I'm working on a processing power limited platform. So,  
I want to have everything encoded at 256x256, but I want the video  
player to know how to scale it back in opengl to the correct aspect  
ratio.

So, how can I encode an mpeg stream at a pixel resolution of 256x256,  
yet still have the real aspect ratio available in the stream itself?  
Is this possible using libav* functionality? What about ffmpeg or  
perhaps mencoder?

Thanks
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to