Skip to content

Commit

Permalink
add CaptureFromIPCamera
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoudbuzing committed Jun 5, 2018
1 parent b5f3559 commit 4b7d957
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Prototypes/Image.wl
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@ CreateGIFAnimation[
SetPermissions[object, "Public"];
object
];


CaptureFromIPCamera[ffmpeg_String, rtsp_String] :=
Module[{tmp, result},
tmp = CreateFile[CreateUUID[] <> ".jpg"];
RunProcess[{ffmpeg, "-y", "-i", rtsp, "-vframes", "1", tmp}];
result = Import[tmp];
DeleteFile[tmp];
result
]
5 changes: 3 additions & 2 deletions Prototypes/PacletInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description -> "A paclet for prototype functions",
Creator -> "Arnoud Buzing",
Publisher -> "Wolfram Research",
Version -> "0.2.8",
Version -> "0.2.9",
MathematicaVersion -> "11.2+",
Loading -> Automatic,
Thumbnail -> "icons/icon.png",
Expand Down Expand Up @@ -55,7 +55,8 @@
"Prototypes`$LocalResourceObjects",
"Prototypes`$RoamingAppDataDirectory",
"Prototypes`$UUIDStringPattern", "Prototypes`LayeredGeoGraphics",
"Prototypes`RenderOnlineNotebook","Prototypes`CreateNotebookRenderAPI"},
"Prototypes`RenderOnlineNotebook","Prototypes`CreateNotebookRenderAPI",
"Prototypes`CaptureFromIPCamera"},
Context -> {"Prototypes`"} }
}
]
1 change: 1 addition & 0 deletions Prototypes/Usage.wl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ ImageSquareQ::usage = "ImageStrictlyPortraitQ[image] returns True if the image w
Image3DCubeQ::usage = "Image3DCubeQ[image] returns True if the image width, height, and depth are all equal";
ImageCropResize::usage = "ImageCropResize[image, dims] crops and resize an image to the specified dimensions";
AlphaChannelQ::usage = "AlphaChannelQ[image] returns True if the image has an alpha channel";
CaptureFromIPCamera::usage = "CaptureFromIPCamera[ffmpeg,rtsp] captures a single image from 'rtsp' stream, using external 'ffmpeg' tool";
(* typesetting *)
Uniconize::usage = "Uniconize[icon] turns IconizedObject icon and returns the associated expression";
BoxSyntaxQ::usage = "BoxSyntaxQ[boxes] returns True if the gives boxes can be transformed into an expression without errors, and False otherwise";
Expand Down

0 comments on commit 4b7d957

Please sign in to comment.