[3.8] Fix #1598 #1599 : Fix support for portrait videos.