Skip to content

Commit

Permalink
video tools
Browse files Browse the repository at this point in the history
  • Loading branch information
sronilsson committed Jun 1, 2024
1 parent e4b2649 commit 994ee25
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Binary file added docs/_static/img/convert_to_avi.webp
Binary file not shown.
Binary file added docs/_static/img/convert_to_webm.webp
Binary file not shown.
3 changes: 2 additions & 1 deletion simba/mixins/statistics_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ def independent_samples_t(
The t-statistic for independent samples t-test is calculated using the following formula:
.. math::
t = \frac{\bar{x}_1 - \bar{x}_2}{s_p \sqrt{\frac{1}{n_1} + \frac{1}{n_2}}}
where:
- \\(\\bar{x}_1\\) and \\(\\bar{x}_2\\) are the means of sample_1 and sample_2 respectively,
- \\(\bar{x}_1\\) and \\(\bar{x}_2\\) are the means of sample_1 and sample_2 respectively,
- \\(s_p\\) is the pooled standard deviation,
- \\(n_1\\) and \\(n_2\\) are the sample sizes of sample_1 and sample_2 respectively.
Expand Down
2 changes: 1 addition & 1 deletion simba/ui/pop_ups/video_processing_pop_up.py
Original file line number Diff line number Diff line change
Expand Up @@ -2374,7 +2374,7 @@ def __init__(self):
self.quality_dropdown = DropDownMenu(settings_frm, "OUTPUT VIDEO QUALITY:", self.cpu_codec_qualities, labelwidth=25)
self.quality_dropdown.setChoices(60)
self.codec_dropdown = DropDownMenu(settings_frm, "COMPRESSION CODEC:", list(self.MP4_CODEC_LK.keys()), labelwidth=25, com=self.update_quality_dropdown)
self.codec_dropdown.setChoices('HEVC (H.265)')
self.codec_dropdown.setChoices('H.264 (AVC)')
settings_frm.grid(row=0, column=0, sticky=NW)
self.quality_dropdown.grid(row=0, column=0, sticky=NW)
self.codec_dropdown.grid(row=1, column=0, sticky=NW)
Expand Down
14 changes: 8 additions & 6 deletions simba/video_processors/video_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2758,17 +2758,17 @@ def convert_to_mp4(path: Union[str, os.PathLike],
Convert a directory containing videos, or a single video, to MP4 format using passed quality and codec.
.. image:: _static/img/convert_to_mp4_1.webp
:width: 700
:width: 800
:align: center
.. image:: _static/img/convert_to_mp4_2.webp
:width: 700
:width: 800
:align: center
:param Union[str, os.PathLike] path: Path to directory or file.
:param Literal['libx265', 'libx264', 'vp9', 'powerpoint'] codec:
:param Optional[Optional[Union[str, os.PathLike]]] save_dir: Directory where to save the converted videos. If None, then creates a directory in the same directory as the input.
:param Optional[int] quality: Integer representing the quality: 10, 20, 30.. 100.
:param Optional[int] quality: If CPU codec, then integer representing the quality: 10, 20, 30.. 100. If GPU codec, then string: 'Low', 'Medium', 'High'
:return: None.
:example:
Expand Down Expand Up @@ -2831,8 +2831,8 @@ def convert_to_avi(path: Union[str, os.PathLike],
"""
Convert a directory containing videos, or a single video, to AVI format using passed quality and codec.
.. image:: _static/img/convert_to_avi.webm
:width: 700
.. image:: _static/img/convert_to_avi.webp
:width: 800
:align: center
:param Union[str, os.PathLike] path: Path to directory or file.
Expand Down Expand Up @@ -2885,6 +2885,7 @@ def convert_to_avi(path: Union[str, os.PathLike],
timer.stop_timer()
stdout_success(msg=f"{len(file_paths)} video(s) converted to AVI and saved in {save_dir} directory.", elapsed_time=timer.elapsed_time_str, source=convert_to_avi.__name__,)


def convert_to_webm(path: Union[str, os.PathLike],
codec: Literal['vp8', 'vp9'] = 'vp9',
save_dir: Optional[Union[str, os.PathLike]] = None,
Expand All @@ -2894,7 +2895,7 @@ def convert_to_webm(path: Union[str, os.PathLike],
Convert a directory containing videos, or a single video, to WEBM format using passed quality and codec.
.. image:: _static/img/convert_to_webm.webm
:width: 700
:width: 800
:align: center
:param Union[str, os.PathLike] path: Path to directory or file.
Expand Down Expand Up @@ -2944,6 +2945,7 @@ def convert_to_webm(path: Union[str, os.PathLike],
timer.stop_timer()
stdout_success(msg=f"{len(file_paths)} video(s) converted to WEBM and saved in {save_dir} directory.", elapsed_time=timer.elapsed_time_str, source=convert_to_webm.__name__,)

#convert_to_webm(path='/Users/simon/Desktop/video_test/Screen Recording 2024-05-06 at 5.34.34 PM_converted.mp4', quality=100, codec='vp8')


def convert_to_mov(path: Union[str, os.PathLike],
Expand Down

0 comments on commit 994ee25

Please sign in to comment.