dickontoo / omxtx

OpenMAX transcoder for the Raspberry Pi
GNU General Public License v2.0
116 stars 36 forks source link

Setting interlaced flag on output #13

Closed jbrnd closed 10 years ago

jbrnd commented 10 years ago

Thank you for your work on omxtx! It works beautifully transcoding HD mpeg2 videos to H264, except for one remaining small issue:

Even when the input MPEG2 file is interlaced, mediainfo indicates that the output H264 video has "Scan type: progressive" which prevents media players from automatically deinterlacing the video. Would it be possible to set an interlaced flag if the input file is interlaced? I tried adding

ctx.flags |= CODEC_FLAG_INTERLACED_DCT; ctx.flags |= CODEC_FLAG_INTERLACED_ME;

to makeoutputcontext(), but that did not appear to have any effect.

As an alternative solution, I tried adding "-d" to the omxtx options. This did deinterlace the video but also cut the frame rate in half for some reason.

A sample interlaced input file is at http://nullinfinity.org/test.mpg (40 Mb file).

dickontoo commented 10 years ago

I'd love to. Unfortunately, the Pi's GPU encoder firmware doesn't support deinterlaced input in that way, which is why you're seeing what you're seeing. In theory, you should find that the output is actually at double the input framerate with '-d', but I may have got the code wrong.

You need to open a bug against the Pi's firmware before I can fix omxtx, I'm afraid. Please do, and let me know the outcome.

jbrnd commented 10 years ago

Thank you for your quick response. I am not completely sure that I understand your explanation, but rather than continuing the discussion here, maybe it's better to continue in the omxtx thread at http://www.raspberrypi.org/phpBB3/viewtopic.php?f=70&t=25022 . I will post something there today or tomorrow.