class AudioMediaFile extends MediaFile |
Package: | dji.sdk.media |
Inherits From: | MediaFile |
This class represents the information of an audio file in the aircraft. The audio file is not accessible if the aircraft is connected to a PC with the USB port. For M2E Speaker, it only supports audio files with the following conditions: The audio channel is mono. The audio sample rate is 44,100 Hz. The PCM (Pulse-code modulation) sample depth is 16 bit per sample. The AudioMediaFile
contains following properties:
- getFileName
- getDurationInSeconds
- getIndex
- getStorageLocation
SettingsDefinitions.AudioStorageLocation getAudioStorageLocation() |
Package: | dji.sdk.media |
The storage location to store the file in the aircraft.
SettingsDefinitions.AudioStorageLocation | An enum value of the AudioStorageLocation . |
enum AudioStorageLocation |
Package: | dji.common.accessory |
Storage types of audio files. The storage types will determine the strategy of the aircraft to keep the file.
TEMPORARY | The audio file is stored to a temporary space. Files with temporary storage location will be automatically deleted when the aircraft reboots. |
PERSISTENT | The audio file is stored to a persistent space. Files with persistent storage location should be deleted manually by calling delete . |
UNKNOWN | Unknown. |
String getFileName() |
Package: | dji.sdk.media |
Returns the name of the media file in the SD Card.
String | A String instance of the name of the media file. |
boolean isValid() |
Package: | dji.sdk.media |
true
if the media file is still valid. If a media file is from the file list of the media manager, the file will become invalid after the file list is reset.
boolean | A boolean value to check if the media file is still valid. |
int getIndex() |
Package: | dji.sdk.media |
Get the file index used in the camera.
int | An int value of the file index. |
MediaType getMediaType() |
Package: | dji.sdk.media |
Returns the type of media file.
MediaType | An enum value of MediaType . |
|
Package: | dji.sdk.media |
Returns the type of QuickShot video media file. It is valid when getVideoFileType
is QUICK_SHOT
.
QuickShotVideoType | An enum value of QuickShotVideoType . |
ShootPhotoMode getShootPhotoMode() |
Package: | dji.sdk.media |
Returns the ShootPhotoMode
of a photo. Returns null
if getMediaType
is
MOV
or MP4
.
ShootPhotoMode | An enum value of ShootPhotoMode . |
PhotoPanoramaMode getPanoramaMode() |
Package: | dji.sdk.media |
Returns the PhotoPanoramaMode
of a photo. It is valid when getShootPhotoMode
is PANORAMA
.
PhotoPanoramaMode | An enum value of PhotoPanoramaMode . |
long getDownloadedSize() |
Package: | dji.sdk.media |
Downloaded size in Bytes of the media file.
long | A long value of downloaded size. |
long getFileSize() |
Package: | dji.sdk.media |
Returns the size, in bytes, of the media file.
long | Size of media file. |
String getDateCreated() |
Package: | dji.sdk.media |
Returns the time when the media file was created as a string in the format "yyyy-MM-dd kk:mm:ss".
String | A String instance of the media file created date. |
long getTimeCreated() |
Package: | dji.sdk.media |
Returns the time when the media file was created as a long type.
long | A long value of the media file created date. |
float getDurationInSeconds() |
Package: | dji.sdk.media |
If the media file is a video, this property returns the duration of the video in seconds. Will be 0s if the media file is a photo.
float | Media duration. |
VideoFrameRate getFrameRate() |
Package: | dji.sdk.media |
Frame rate when the media file is a video.
VideoFrameRate | An int value. |
VideoResolution getResolution() |
Package: | dji.sdk.media |
Camera video resolution. Only supported by video.
VideoResolution | An enum value of VideoResolution . |
Orientation getVideoOrientation() |
Package: | dji.sdk.media |
The orientation of the camera when the video file was first recorded. If the camera orientation changes during a video capture, this will report the initial orientation. Will be LANDSCAPE
if the media file is a photo. Only Mavic Pro supports this property. Will be LANDSCAPE
for other products.
Orientation | An enum value of Orientation |
StorageLocation getStorageLocation() |
Package: | dji.sdk.media |
Storage location of the media file.
StorageLocation | An enum value of StorageLocation . |
|
Package: | dji.sdk.media |
Returns the type of video media file. This property is only valid when the getMediaType
is MOV
or MP4
. Returns null
for other media types.
VideoFileType | An enum value of VideoFileType . |
String getCustomInformation() |
Package: | dji.sdk.media |
Custom information can be stored in media file's XMP meta data using setMediaFileCustomInformation
This property contains the information that was written to this media file. If this property returns null
, use fetchCustomInformation
to populate it. Supported by Zenmuse P1, Zenmuse L1, Phantom 4 RTK, Phantom 4 Pro, Phantom 4 Advanced and Inspire 2 with firmware versions from after May 23 2017.
String | A string value. |
String getXMPFileData() |
Package: | dji.sdk.media |
This property contains the XMP data which was written to this media file. If this property returns null
, use fetchXMPFileData
to populate it. Only supported Phantom 4 RTK, Zenmuse P1, Zenmuse L1.
Bitmap getThumbnail() |
Package: | dji.sdk.media |
Returns the thumbnail for this media. If this property returns nil, call fetchThumbnail
.
Bitmap | A Bitmap object. |
Bitmap getPreview() |
Package: | dji.sdk.media |
Returns the preview image for this media. If this property returns null
, call fetchPreview
.
Bitmap | A Bitmap object. |
void resetThumbnail(@Nullable final CompletionCallback callback) |
Package: | dji.sdk.media |
Resets the cached thumbnail to null
to release the memory usage.
@Nullable final CompletionCallback callback | Completion callback with the returned execution result. |
void fetchPreview(@NonNull final CompletionCallback callback) |
Package: | dji.sdk.media |
Fetch media's preview image. The preview image is a lower resolution (960 x 540) version of a photo. The MediaType
of this media object should be JPEG
or TIFF
. The preview will be stored in getPreview
.
@NonNull final CompletionCallback callback | The completion callback with the returned execution result. |
void resetPreview(@Nullable final CompletionCallback callback) |
Package: | dji.sdk.media |
Resets the cached preview image to null
to release the memory usage.
@Nullable final CompletionCallback callback | The completion callback with the returned execution result. |
void fetchCustomInformation(@NonNull CompletionCallback callback) |
Package: | dji.sdk.media |
Custom information can be stored in media file's XMP meta data using setMediaFileCustomInformation
. The information will be stored in getCustomInformation
. Only supported by Phantom 4 Pro, Phantom 4 Advanced, Phantom 4 Pro V2.0, Zenmuse P1, Zenmuse L1, Zenmuse X4S, Zenmuse X5S, Zenmuse X7 and Mavic 2 Enterprise camera.
@NonNull CompletionCallback callback | The completion callback with the returned execution result. |
void fetchXMPFileData(@NonNull CompletionCallback callback) |
Package: | dji.sdk.media |
Fetch the XMP data stored in the media file. The data will be stored in getXMPFileData
. Only supported by Zenmuse P1, Zenmuse L1, Phantom 4 RTK.
@NonNull CompletionCallback callback | The completion callback with the returned execution result. |
void fetchFileByteData(long offset, @NonNull final DownloadListener<String> callback) |
Package: | dji.sdk.media |
Fetches this media file's full resolution data from camera by byte. You can get the media file data with onRealtimeDataUpdate
. The difference between fetching the media data and fetching the thumbnail is that fetching the thumbnail will return a low-resolution image of the actual picture, while fetching the media data will return all data for a video or image. If last download action is aborted, it will continue to download the data from where the file download has been aborted.
long offset | The byte offset strarting to download media file. |
@NonNull final DownloadListener<String> callback | Completion callback that receives the execution result. |
void fetchFileData(@NonNull final File destDir, |
Package: | dji.sdk.media |
Fetches this media file's full resolution data from camera. The difference between fetching the media data and fetching the thumbnail is that fetching the thumbnail will return a low-resolution image of the actual picture, while fetching the media data will return all data for a video or image. If last download action is aborted, it will continue to download the data from where the file download has been aborted.
@NonNull final File destDir | File instance of location to save the files, which can not be null. |
@Nullable String fileNameWithoutExtension | The fileName to store in mobile devices, without the file extension.<br> If it is null, the file name in the camera's SDCard will be used. |
@NonNull final DownloadListener<String> callback | Completion callback that receives the execution result. |
void stopFetchingFileData(@Nullable CompletionCallback callback) |
Package: | dji.sdk.media |
Stops a currently executing call of fetchFileData
.
@Nullable CompletionCallback callback | The completion callback with the returned execution result. |
void fetchSubFileDataList(@NonNull final CompletionCallbackWith<List<MediaFile>> callback) |
Package: | dji.sdk.media |
Fetches the file data of the sub media files. It is available only when getMediaType
is PANORAMA
or SHALLOW_FOCUS
.
@NonNull final CompletionCallbackWith<List<MediaFile>> callback | Completion callback that receives the execution result. |
void fetchSuperResJSON(@Nullable final CompletionCallback callback) |
Package: | dji.sdk.media |
Super Resolution JSON file was used to save super resolution photo coordinate info.
@Nullable final CompletionCallback callback | Completion callback that receives the execution result. |