Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

HLS: Don't scale video beyond it's original resolution, it's a waste …

…of time and will only degrade quality. Since the end client can't know the original resolution of the video it can only request the ideal e.g. 1280x720. So for SD videos we don't alter the resolution and for Full HD we scale down. Ultimately we may scale the bitrate accordingly, but for now it remains unaffected.
  • Loading branch information...
commit 7c7d80005d21e046541975bb166269c6985eba06 1 parent 2f0f0b1
@stuartm stuartm authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 mythtv/programs/mythtranscode/transcode.cpp
View
18 mythtv/programs/mythtranscode/transcode.cpp
@@ -391,6 +391,24 @@ int Transcode::TranscodeFile(const QString &inputname,
newWidth = cmdWidth;
newHeight = cmdHeight;
+ // Absolutely no purpose is served by scaling video up beyond it's
+ // original resolution, quality is degraded, transcoding is
+ // slower and in future we may wish to scale bitrate according to
+ // resolution, so it would also waste bandwidth (when streaming)
+ //
+ // This change could be said to apply for all transcoding, but for now
+ // we're limiting it to HLS where it's uncontroversial
+ if (hlsMode)
+ {
+// if (newWidth > video_width)
+// newWidth = video_width;
+ if (newHeight > video_height)
+ {
+ newHeight = video_height;
+ newWidth = 0;
+ }
+ }
+
// TODO: is this necessary? It got commented out, but may still be
// needed.
// int actualHeight = (video_height == 1088 ? 1080 : video_height);
Please sign in to comment.
Something went wrong with that request. Please try again.