-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from AllenNeuralDynamics/refactor-update-ffmp…
…eg-default Update ffmpeg string and improve documentation
- Loading branch information
Showing
11 changed files
with
130 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
rig | ||
------------------------- | ||
|
||
.. automodule:: aind_behavior_services.rig | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
session | ||
-------------------------- | ||
|
||
.. image:: _static/AindBehaviorSessionModel.svg | ||
:target: _static/AindBehaviorSessionModel.svg | ||
|
||
.. automodule:: aind_behavior_services.session | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
task_logic | ||
-------------------------------- | ||
|
||
.. automodule:: aind_behavior_services.task_logic | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import unittest | ||
|
||
from aind_behavior_services.rig import ( | ||
FFMPEG_INPUT, | ||
FFMPEG_OUTPUT_8BIT, | ||
FFMPEG_OUTPUT_16BIT, | ||
VideoWriterFfmpeg, | ||
VideoWriterFfmpegFactory, | ||
) | ||
|
||
|
||
class TestVideoWriterFfmpegFactory(unittest.TestCase): | ||
def test_initialization(self): | ||
factory = VideoWriterFfmpegFactory(bit_depth=8) | ||
self.assertEqual(factory._bit_depth, 8) | ||
self.assertEqual(factory.video_writer_ffmpeg_kwargs, {}) | ||
|
||
factory = VideoWriterFfmpegFactory(bit_depth=16, video_writer_ffmpeg_kwargs={"frame_rate": 60}) | ||
self.assertEqual(factory._bit_depth, 16) | ||
self.assertEqual(factory.video_writer_ffmpeg_kwargs, {"frame_rate": 60}) | ||
|
||
def test_solve_strings_8bit(self): | ||
factory = VideoWriterFfmpegFactory(bit_depth=8) | ||
self.assertEqual(factory._output_arguments, FFMPEG_OUTPUT_8BIT) | ||
self.assertEqual(factory._input_arguments, FFMPEG_INPUT) | ||
|
||
def test_solve_strings_16bit(self): | ||
factory = VideoWriterFfmpegFactory(bit_depth=16) | ||
self.assertEqual(factory._output_arguments, FFMPEG_OUTPUT_16BIT) | ||
self.assertEqual(factory._input_arguments, FFMPEG_INPUT) | ||
|
||
def test_construct_video_writer_ffmpeg(self): | ||
factory = VideoWriterFfmpegFactory(bit_depth=8) | ||
video_writer = factory.construct_video_writer_ffmpeg() | ||
self.assertIsInstance(video_writer, VideoWriterFfmpeg) | ||
self.assertEqual(video_writer.output_arguments, factory._output_arguments) | ||
self.assertEqual(video_writer.input_arguments, factory._input_arguments) | ||
|
||
def test_update_video_writer_ffmpeg_kwargs(self): | ||
factory = VideoWriterFfmpegFactory(bit_depth=8) | ||
video_writer = factory.construct_video_writer_ffmpeg() | ||
updated_video_writer = factory.update_video_writer_ffmpeg_kwargs(video_writer) | ||
self.assertEqual(updated_video_writer.output_arguments, factory._output_arguments) | ||
self.assertEqual(updated_video_writer.input_arguments, factory._input_arguments) | ||
|
||
def test_video_writer_ffmpeg_obj_equality(self): | ||
factory = VideoWriterFfmpegFactory(bit_depth=8) | ||
video_writer = VideoWriterFfmpeg(output_arguments=FFMPEG_OUTPUT_8BIT, input_arguments=FFMPEG_INPUT) | ||
video_writer_from_factory = factory.construct_video_writer_ffmpeg() | ||
self.assertEqual(video_writer, video_writer_from_factory) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |