Skip to content

Commit

Permalink
Init gst_transform_resize scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
baconYao committed Sep 27, 2024
1 parent 19a809a commit 4b00b73
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def _build_command(self) -> str:
codec.
"""
pipeline = (
"{} filesrc location={} ! decodebin ! v4l2convert !"
"{} filesrc location={} ! decodebin ! v4l2convert ! "
"video/x-raw,width={},height={} ! {} ! {} ! mp4mux ! filesink"
" location={}"
).format(
Expand All @@ -363,10 +363,8 @@ def main() -> None:
logging.info("\nStep 3: Comparing PSNR...")
p.compare_psnr()
# Release the disk space if no error be observed
# p.delete_file()
p.delete_file()


if __name__ == "__main__":
main()

# gst-launch-1.0 -v filesrc location=./big_bug_bunny_3840x2160_60fps_h264.mp4 ! decodebin ! v4l2convert ! video/x-raw,width=720,height=480 ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=./output_to_720x480.mp4
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,16 @@
"resolutions": [
{ "width_from": 3840, "height_from": 2160, "fps": 60, "width_to": 2560, "height_to": 1440 },
{ "width_from": 3840, "height_from": 2160, "fps": 60, "width_to": 1920, "height_to": 1080 },
{ "width_from": 3840, "height_from": 2160, "fps": 30, "width_to": 1920, "height_to": 1080 },
{ "width_from": 3840, "height_from": 2160, "fps": 60, "width_to": 1280, "height_to": 720 },
{ "width_from": 3840, "height_from": 2160, "fps": 30, "width_to": 1280, "height_to": 720 },
{ "width_from": 2560, "height_from": 1440, "fps": 60, "width_to": 3840, "height_to": 2160 },
{ "width_from": 2560, "height_from": 1440, "fps": 60, "width_to": 1920, "height_to": 1080 },
{ "width_from": 2560, "height_from": 1440, "fps": 60, "width_to": 1280, "height_to": 720 },
{ "width_from": 1920, "height_from": 1080, "fps": 60, "width_to": 3840, "height_to": 2160 },
{ "width_from": 1920, "height_from": 1080, "fps": 30, "width_to": 3840, "height_to": 2160 },
{ "width_from": 1920, "height_from": 1080, "fps": 60, "width_to": 2560, "height_to": 1440 },
{ "width_from": 1920, "height_from": 1080, "fps": 60, "width_to": 1280, "height_to": 720 },
{ "width_from": 1920, "height_from": 1080, "fps": 30, "width_to": 1280, "height_to": 720 },
{ "width_from": 1280, "height_from": 720, "fps": 60, "width_to": 3840, "height_to": 2160 },
{ "width_from": 1280, "height_from": 720, "fps": 30, "width_to": 3840, "height_to": 2160 },
{ "width_from": 1280, "height_from": 720, "fps": 60, "width_to": 2560, "height_to": 1440 },
{ "width_from": 1280, "height_from": 720, "fps": 60, "width_to": 1920, "height_to": 1080 },
{ "width_from": 1280, "height_from": 720, "fps": 30, "width_to": 1920, "height_to": 1080 }
{ "width_from": 1280, "height_from": 720, "fps": 60, "width_to": 1920, "height_to": 1080 }
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@
"minimum_fps": 60,
"enable_performance_mode": true
}
],
"gst_transform_resize": [
{
"encoder_plugin": "v4l2h264enc",
"resolutions": [
{ "width_from": 1920, "height_from": 1080, "fps": 60, "width_to": 1280, "height_to": 720 },
{ "width_from": 1280, "height_from": 720, "fps": 60, "width_to": 1920, "height_to": 1080 }
]
}
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,24 @@
"minimum_fps": 60,
"enable_performance_mode": true
}
],
"gst_transform_resize": [
{
"encoder_plugin": "v4l2h264enc",
"resolutions": [
{ "width_from": 3840, "height_from": 2160, "fps": 30, "width_to": 2560, "height_to": 1440 },
{ "width_from": 3840, "height_from": 2160, "fps": 30, "width_to": 1920, "height_to": 1080 },
{ "width_from": 3840, "height_from": 2160, "fps": 30, "width_to": 1280, "height_to": 720 },
{ "width_from": 2560, "height_from": 1440, "fps": 60, "width_to": 1920, "height_to": 1080 },
{ "width_from": 2560, "height_from": 1440, "fps": 60, "width_to": 1280, "height_to": 720 },
{ "width_from": 1920, "height_from": 1080, "fps": 30, "width_to": 3840, "height_to": 2160 },
{ "width_from": 1920, "height_from": 1080, "fps": 60, "width_to": 2560, "height_to": 1440 },
{ "width_from": 1920, "height_from": 1080, "fps": 60, "width_to": 1280, "height_to": 720 },
{ "width_from": 1280, "height_from": 720, "fps": 30, "width_to": 3840, "height_to": 2160 },
{ "width_from": 1280, "height_from": 720, "fps": 60, "width_to": 2560, "height_to": 1440 },
{ "width_from": 1280, "height_from": 720, "fps": 60, "width_to": 1920, "height_to": 1080 }
]
}
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,24 @@
"minimum_fps": 75,
"enable_performance_mode": true
}
],
"gst_transform_resize": [
{
"encoder_plugin": "v4l2h264enc",
"resolutions": [
{ "width_from": 3840, "height_from": 2160, "fps": 30, "width_to": 2560, "height_to": 1440 },
{ "width_from": 3840, "height_from": 2160, "fps": 30, "width_to": 1920, "height_to": 1080 },
{ "width_from": 3840, "height_from": 2160, "fps": 30, "width_to": 1280, "height_to": 720 },
{ "width_from": 2560, "height_from": 1440, "fps": 60, "width_to": 1920, "height_to": 1080 },
{ "width_from": 2560, "height_from": 1440, "fps": 60, "width_to": 1280, "height_to": 720 },
{ "width_from": 1920, "height_from": 1080, "fps": 30, "width_to": 3840, "height_to": 2160 },
{ "width_from": 1920, "height_from": 1080, "fps": 60, "width_to": 2560, "height_to": 1440 },
{ "width_from": 1920, "height_from": 1080, "fps": 60, "width_to": 1280, "height_to": 720 },
{ "width_from": 1280, "height_from": 720, "fps": 30, "width_to": 3840, "height_to": 2160 },
{ "width_from": 1280, "height_from": 720, "fps": 60, "width_to": 2560, "height_to": 1440 },
{ "width_from": 1280, "height_from": 720, "fps": 60, "width_to": 1920, "height_to": 1080 }
]
}
]
}

0 comments on commit 4b00b73

Please sign in to comment.