Swift in Flutter Project - POC
Budget: $30 – $250 USD
BUDGET = $100:
I have a POC project that has simple flutter UI. Inside that we have native IOS code using swift. The current code works but i want someone to implement the attached code and then test for any issues.
But i want you to report back to me what errors you are getting so i can be part of troubleshooting.
This is what code should be doing:
- capture video at H.265
- create a buffer just in case of network issues
- write to file every 1 second
- create sidecar file on every video that tells me the local timestamp / frame
- upload to s3 the local sidecar file and video every 1 second
- have error handling and buffers to deal with network issues
- save locally one sidecar file that has local timestamp /frame for entire length of video
- save locally one video file of entire event
Things to consider for the attached code:
1. **H.265 Encoding**: Ensure that the video settings are correctly configured for H.265 (HEVC) encoding. The `AVVideoCodecType.hevc` key is used, which is correct for H.265. However, ensure that the device supports HEVC encoding.
2. **Asset Writer Initialization**: The `setupLocalAssetWriter` method initializes the `AVAssetWriter` and its input. Ensure that the video settings are correctly derived from the format description. You might need to handle cases where the format description is unavailable.
3. **Sample Buffer Handling**: The `captureOutput` method appends frames to `frameBatch`. Ensure that the `frameCountThreshold` is set appropriately to handle 1-second video chunks based on the frame rate.
4. **Error Handling**: Ensure robust error handling, especially in areas like asset writer initialization, file operations, and AWS S3 uploads. Consider using `do-catch` blocks and logging errors for easier debugging.
5. **AWS S3 Uploads**: The `UploadOperation` class handles uploads. Ensure that the AWS SDK is correctly configured with credentials and the bucket name. The `uploadFile` method should handle retries and move files to persistent storage if uploads fail.
6. **Background Task Management**: The `setupBackgroundTask` method registers a background task for uploads. Ensure that the app's Info.plist is configured to allow background processing.
7. **File Management**: Ensure that temporary files are correctly managed, deleted after use, or moved to persistent storage if needed. This helps prevent excessive storage usage.
8. **Concurrency**: The use of `DispatchQueue` and `OperationQueue` should be carefully managed to avoid race conditions, especially when accessing shared resources like `frameBatch`.
I have a POC project that has simple flutter UI. Inside that we have native IOS code using swift. The current code works but i want someone to implement the attached code and then test for any issues.
But i want you to report back to me what errors you are getting so i can be part of troubleshooting.
This is what code should be doing:
- capture video at H.265
- create a buffer just in case of network issues
- write to file every 1 second
- create sidecar file on every video that tells me the local timestamp / frame
- upload to s3 the local sidecar file and video every 1 second
- have error handling and buffers to deal with network issues
- save locally one sidecar file that has local timestamp /frame for entire length of video
- save locally one video file of entire event
Things to consider for the attached code:
1. **H.265 Encoding**: Ensure that the video settings are correctly configured for H.265 (HEVC) encoding. The `AVVideoCodecType.hevc` key is used, which is correct for H.265. However, ensure that the device supports HEVC encoding.
2. **Asset Writer Initialization**: The `setupLocalAssetWriter` method initializes the `AVAssetWriter` and its input. Ensure that the video settings are correctly derived from the format description. You might need to handle cases where the format description is unavailable.
3. **Sample Buffer Handling**: The `captureOutput` method appends frames to `frameBatch`. Ensure that the `frameCountThreshold` is set appropriately to handle 1-second video chunks based on the frame rate.
4. **Error Handling**: Ensure robust error handling, especially in areas like asset writer initialization, file operations, and AWS S3 uploads. Consider using `do-catch` blocks and logging errors for easier debugging.
5. **AWS S3 Uploads**: The `UploadOperation` class handles uploads. Ensure that the AWS SDK is correctly configured with credentials and the bucket name. The `uploadFile` method should handle retries and move files to persistent storage if uploads fail.
6. **Background Task Management**: The `setupBackgroundTask` method registers a background task for uploads. Ensure that the app's Info.plist is configured to allow background processing.
7. **File Management**: Ensure that temporary files are correctly managed, deleted after use, or moved to persistent storage if needed. This helps prevent excessive storage usage.
8. **Concurrency**: The use of `DispatchQueue` and `OperationQueue` should be carefully managed to avoid race conditions, especially when accessing shared resources like `frameBatch`.