• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

1stplugins

FileMaker plug-ins and Reverse Engineering

  • Plugins
    • MediaManager
  • Services
    • Reverse Engineering
    • FileMaker Plug-Ins
  • About
    • About Us
    • Contact Us
    • Terms of Use of the Website and Privacy Policy
  • Store
    • Terms and Conditions
    • Warranty Claim Guidelines
    • Contract Withdrawal Form
    • Warranty Claim Report

Media_PeekStream

Media_PeekStream( container { ; streamId } )

Lists either container stream content or dumps a particular stream as text.

Parameters

Parameter Description
container A container to peek the stream.
streamId Optional. A stream identifier when you want to extract a particular stream instead of the entire container.

Discusion

The function is useful to examine a container’s content for debugging purposes and can be used in one of the two modes either to list streams or to extract a particular stream.

Listing streams. Media_PeekStream returns a number of streams in the container field along with each stream’s identifier, size, and the first 16 bytes of the data. The stream identifier comprises of 4 alphanumeric letters such as PNGf, JPEG, or SIZE.

Extracting a particular stream requires the second parameter – a stream identifier. Once you do, the function returns the entire stream content as Base64 encoded text.

Examples

To list streams in the container:

Set Field [

MyTable::ContainerList ;
Media_PeekStream( MyTable::container ) ]

Might produce a list of streams like this:

$$$Count: 3
Streams
  JPEG    8242 bytes [......JFIF.....,]
  PNGf   70019 bytes [.PNG........IHDR]
  SIZE       4 bytes [....]

To extract a particular stream data, add the second argument. As you can see from the previous example, there are 3 streams in this container. Two of them are JPEG and PNGf image streams. As per FileMaker’s plug-in documentation, each image container should have a preview in either PNG or JPEG corresponding to the PNGf and JPEG streams above. Suppose we want to extract the JPEG stream:

Set Field [

MyTable::JPEGBase64 ; Media_PeekStream( MyTable::container; "JPEG" ) ]

The result is a Base64 encoded binary data of the JPEG stream.

On Mac, you can obtain the raw data in Terminal.app:

echo 'PASTE_BASE64_HERE' | base64 -d > ~/Desktop/file.jpg

On Windows, you can do the same in PowerShell:

[System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String('PASTE_BASE64_HERE') > %USERPROFILE%\Desktop\file.jpg

Primary Sidebar

Document Functions

Media_CopyItem
Media_CreateAlias
Media_CreateFolder
Media_DeleteItem
Media_ExportField
Media_ExtractInfo
Media_GetDefaultFolder
Media_GetItemInfo
Media_GetName
Media_GetPath
Media_InsertFile
Media_ListDisks
Media_ListFolder
Media_MoveItem
Media_OpenItem
Media_RenameItem
Media_Search
Media_SetDefaultFolder

General and Registration Functions

Media_Get
Media_GetLastError
Media_GetMouseUp
Media_JSONPath
Media_PeekStream
Media_Register
Media_RegisterLicensedEncoder
Media_Set
Media_Version

Image Functions

Media_ConvertImage
Media_CreateQRCode
Media_EffectApply
Media_EffectDialog
Media_GetImageInfo
Media_GetMetadata
Media_InsertImage
Media_ListImageOutputTypes
Media_SetImageDefaults Media_TApply
Media_TClear
Media_TCrop
Media_TQuad
Media_TResize
Media_TRotate
Media_TScale
Media_TSkew

Script Steps

Copy Item
Create Alias
Create Folder
Delete Item
Export Field
Get Default Folder
Get Item Property
Move Item
Open Item
Rename Item
Set Default Folder

Sound Functions

Media_Amplify
Media_AppendSound
Media_ConvertSound
Media_CreateSound
Media_DrawWaveform
Media_ExtractSound
Media_FadeSound
Media_GetMetadata
Media_GetSoundInfo
Media_InsertQuickTime
Media_ListSoundOutputFormats
Media_MixSounds
Media_Normalize
Media_PlayPause
Media_PlaySound
Media_RecordSoundFormatDialog
Media_RecordSoundStart
Media_RecordSoundPause
Media_RecordSoundStop
Media_SetMetadata
Media_SoundFormatDialog
Media_StopSound

Video Functions

Media_GetVideoInfo

Footer

Let’s get started on your project.

Get in touch

  • Plugins
  • Services
  • About
  • Store

Copyright ©2006-2020 by 1stplugins, s.r.o. All rights reserved.