lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
555 stars 26 forks source link

Transcode results in wrong aspect ratio #189

Open briangoodman opened 1 year ago

briangoodman commented 1 year ago

My "Jazz on a Summer's Day" MakeMKV output file displays perfectly as an MKV, but an other_video_transcoding MP4 transcode (my preferred transcode target) displays in a wierd aspect ratio.

Is suspect it may be because the first part of the file is in a different aspect ratio that the rest of the file.

If I'm correct, is there a way to force other_video_transcoding to sample the aspect ratio at a later point in the video?

Both the MKV and the log file are attached.

Thanks for any help you can provide.

Regards,

Brian

P.S. Is there a way to send you the MKV so you can see the effect, or does the log file tell you everything you need to know?

Jazz on a Summer's Day (_ffmpeg_24062_61553.mp4.log).log

lisamelton commented 1 year ago

@briangoodman OK, now that is a unique issue. :)

No, there's no way to force other-transcode to sample the aspect ratio later. And I suspect you'll have the same problem with other tools because to say that's a non-standard input is an understatement.

You either need to remux your input or simply use a custom ffmpeg command line based on the output from --dry-run. Sorry about that.

briangoodman commented 1 year ago

Don,

Happy to use a custom ffmpeg command as this has happened on only two files out of 1500 transcodes - a pretty good track record for other-transcode. So apology not required - thank for all your hard work making the script work so well.

I'm not sure how to assess what the aspect ratio is at different points in the file to enable me to build that custom command. Any advice on that?

Thanks,

Brian

lisamelton commented 1 year ago

@briangoodman No idea. I suppose you could split the file at the point where the aspect ratio changes, pass the second part to other-transcode to see what it does and then use that as input for the entire file?

briangoodman commented 1 year ago

Will try the split and update this thread with result.

loshlee commented 1 year ago

Hope this is relevant. A long time ago, I was able to successfully repair unwanted aspect ratio playback for MP4 using the "par" option for mp4box.

Aside from that, I incorporated an AppleScript construct that would allow me to sample aspect ratio at different intervals of the source video using the "cropdetect" option for ffmpeg, then present them in a dialog box that allows me to select the preferred one for inclusion in the transcode command. It operates for ffmpeg rather than Other-Video-Transcoding, of course, but substituting the rest of the commands provided by Other-Video-Transcoding for ffmpeg is fairly trivial (altogether trivial for most Other-Video-Transcoding users, probably.) If something like that might be of interest, I can certainly provide it as a gist.