You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading a Samsung Galaxy phone, all my newer videos made in portrait mode have the wrong aspect ratio after transcoding (any target format), e.g.:
I have a fix that works for my videos now:
I've forked the Gem and removed the default resolution (640x360) and preserve_aspect_ratio attributes (:width), as those interfer with the solution
When transcoding a video, I've moved the resolution parameters together with the solution in the custom block, as otherwise streamio-ffmpeg will add a nasty aspect-param that distorts the image again
# old video->jpg# process encode_video: [:jpg, resolution: '500x500', preserve_aspect_ratio: :width]processencode_video: [:jpg,custom: '-vf scale=w=500:h=500:force_original_aspect_ratio=decrease']# old video->mp4# process encode_video: [:mp4, resolution: '640x360', preserve_aspect_ratio: :width, audio_codec: 'aac']processencode_video: [:mp4,custom: '-s 640x360 -vf scale=w=640:h=360:force_original_aspect_ratio=decrease',audio_codec: 'aac']
I am aware, that Carrierwave Video can't do to much but just change the default resolution/preserve_aspect_ratio params to allow override. There seem to be a problem in combination with the streamio-ffmpeg Gem. Just leaving this here to help other people with the same problem!
Difference between Samsung's meta data:
I've compared a "new" and a "old" video. Most params are similar, but one stood out.
It seems, that the old format didn't specify the aspect ratio, but the new one specify it:
// NEW format (output from ffprobe){///..."sample_aspect_ratio": "1:1","display_aspect_ratio": "16:9",}// OLD format (output from ffprobe){///..."sample_aspect_ratio": "0:1","display_aspect_ratio": "0:1",}
The text was updated successfully, but these errors were encountered:
zealot128
changed the title
Aspect ratio ignored with newer Samsung Galaxy videos
Aspect ratio distorted with newer Samsung Galaxy videos
May 31, 2017
After upgrading a Samsung Galaxy phone, all my newer videos made in portrait mode have the wrong aspect ratio after transcoding (any target format), e.g.:
I have a fix that works for my videos now:
I am aware, that Carrierwave Video can't do to much but just change the default resolution/preserve_aspect_ratio params to allow override. There seem to be a problem in combination with the streamio-ffmpeg Gem. Just leaving this here to help other people with the same problem!
Difference between Samsung's meta data:
I've compared a "new" and a "old" video. Most params are similar, but one stood out.It seems, that the old format didn't specify the aspect ratio, but the new one specify it:
The text was updated successfully, but these errors were encountered: