Skip to content

Commit

Permalink
Merge pull request #115 from AllenNeuralDynamics/refactor-remove-ffmp…
Browse files Browse the repository at this point in the history
…eg-defaults

Remove ffmpeg defaults
  • Loading branch information
bruno-f-cruz authored Nov 20, 2024
2 parents 2af041f + 78fa960 commit 21ed683
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/workflows/SaveSpinnakerCamera.bonsai
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
<Modality>BehaviorVideos</Modality>
<LogName>RandomCamera</LogName>
<VideoExtension>mp4</VideoExtension>
<OutputArguments>-vf "scale=out_color_matrix=bt709:out_range=full" -c:v h264_nvenc -pix_fmt nv12 -color_range full -colorspace bt709 -color_trc linear -tune hq -preset p4 -rc vbr -cq 12 -b:v 0M -maxrate 700M -bufsize 350M</OutputArguments>
<InputArguments>-colorspace rgb -color_primaries bt709 -color_trc linear</InputArguments>
<OutputArguments />
<InputArguments />
<Verbosity>Verbose</Verbosity>
<FrameRate>120</FrameRate>
</Expression>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageTags>Bonsai Rx Core AllenNeuralDynamics</PackageTags>
<TargetFramework>net472</TargetFramework>
<Features>strict</Features>
<Version>0.2.9</Version>
<Version>0.3.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/AllenNeuralDynamics.Core/FfmpegVideoWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public class FfmpegVideoWriter : Sink<IplImage>

[Editor(DesignTypes.MultilineStringEditor, DesignTypes.UITypeEditor)]
[Description("The optional set of command-line arguments to use for configuring the video codec.")]
public string OutputArguments { get; set; } = @"-vf ""scale=out_color_matrix=bt709:out_range=full:sws_dither=none,format=yuv420p10le,colorspace=ispace=bt709:all=bt709:dither=none,scale=out_range=tv:sws_dither=none,format=yuv420p"" -c:v libx264 -preset veryslow -crf 18 -pix_fmt yuv420p -metadata author=""Allen Institute for Neural Dynamics"" -movflags +faststart+write_colr";
public string OutputArguments { get; set; }

[Editor(DesignTypes.MultilineStringEditor, DesignTypes.UITypeEditor)]
[Description("The optional set of command-line arguments to use for configuring the input video stream.")]
public string InputArguments { get; set; } = "-colorspace bt709 -color_primaries bt709 -color_range full -color_trc linear";
public string InputArguments { get; set; }

public override IObservable<IplImage> Process(IObservable<IplImage> source)
{
Expand Down
2 changes: 2 additions & 0 deletions src/AllenNeuralDynamics.Core/LogSpinnakerFfmpeg.bonsai
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Value.Image as Image)
<p1:InputArguments>-colorspace rgb -color_primaries bt709 -color_trc linear</p1:InputArguments>
</Combinator>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
Expand All @@ -94,6 +95,7 @@ Value.Image as Image)
<Edge From="10" To="11" Label="Source1" />
<Edge From="11" To="13" Label="Source2" />
<Edge From="12" To="13" Label="Source3" />
<Edge From="13" To="14" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
2 changes: 2 additions & 0 deletions src/AllenNeuralDynamics.Core/LogSpinnakerOpenCv.bonsai
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Value.Image as Image)
<cv:ResizeInterpolation>NearestNeighbor</cv:ResizeInterpolation>
</Combinator>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
Expand All @@ -97,6 +98,7 @@ Value.Image as Image)
<Edge From="10" To="11" Label="Source1" />
<Edge From="11" To="13" Label="Source2" />
<Edge From="12" To="13" Label="Source3" />
<Edge From="13" To="14" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>

0 comments on commit 21ed683

Please sign in to comment.