If you data is hosted on a private cloud, Encord requires ‘write’ permissions to your cloud to re-encode videos.
task_id
can be used to monitor the progress of the task.
Ensure that the list contains videos from the same Dataset that was used to initialize the
EncordClient
. Any videos that do not belong to the Dataset used for initialization are ignored.Check the status of a re-encoding task
Use the dataset.re_encode_data_status() method to get the status of an existing re-encoding task. Replacetask_id
in the sample below with the task ID of the re-encoding task you’d like to check the status of.
Sample Code
Example output
- “SUBMITTED”: the task is currently in progress and the status should be checked back again later.
- “DONE”: the task has been completed successfully and the field ‘result’ would contain metadata about the re-encoded video.
- “ERROR”: the task has failed and could not complete the re-encoding.
Re-encode locally
Some cases, such as corrupted metadata, might require you to re-encode your data locally before uploading them to the Encord platform. Use the followingffmpeg
command, replacing video.mp4
with the name of the file you want to re-encode, and re-encoded-video.mp4
with the name you want the re-encoded file to have:
Since browsers require a constant frame rate, we apply the -r 30 flag (30 fps). Verify your video’s frame rate and adjust the value accordingly.
We recommend using the average frame rate of your video to set the constant rate (rounded to the nearest whole number).You can figure out the average frame rate of your video with this command:You may need to install
ffprobe
& bc
Here is a summary of the various flags:
-err_detect aggressive
: Improves error detection during decoding.-fflags discardcorrupt
: Discards corrupted packets to maintain integrity.-r 30
: This sets the frame rate to a constant 30 frames per second (FPS). Feel free to adjust30
to your desired frame rate.-c:v libx264
: Specifies theH.264
codec for video re-encoding.-movflags faststart
: Optimizes for web playback by moving moov metadata to the beginning of the file.- -an: This ensures the audio is removed from the re-encoded video.
-tune zerolatency
: Configures for low-latency encoding scenarios.