Hey folks,
I’m testing Shotstack to assess if we can use it with a project and was playing a bit with the EDIT API.
I found that my videos are not cut off at exactly the time I provided. I’m trying to figure out if it’s a fundamental limitation of the API or if I’m missing something. And if it is a limitation, can it be adressed soon?
Original
https://polishedvideo.s3.us-west-2.amazonaws.com/videoplayback.mp4
First clip
first clip should be trimmed at 33.45 instead it cuts off at 33:04
second clip should start at 34.55 instead it starts off at 34:08
Does the API not support fractions of a second?
Edit
{ “timeline”:
{ “tracks”: [
{ “clips”: [ { “asset”: {“type”: “video”,“src”: “%s”,“trim”: %d},“start”: 0,“length”: %d}]
}
]
},
“output”: {“format”: “mp4”,“resolution”: “sd”}}‘’’ % (src,trim,duration)
Hi,
I checked the source footage using our probe endpoint and can see it has a framerate of 30/fps: https://api.shotstack.io/v1/probe/https%3A%2F%2Fpolishedvideo.s3.us-west-2.amazonaws.com%2Fvideoplayback.mp4
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
By default our API renders at 25fps so frames are dropped/lost to reduce the frame rate. If you match the output frame rate to the source then you will get frame accurate rendering.
Here is some JSON to generate the exact length you are looking to create and the audio is not cut off too early:
{
"output": {
"format": "mp4",
"resolution": "sd",
"fps": 30
},
"timeline": {
"tracks": [
{
"clips": [
{
"asset": {
"src": "https://polishedvideo.s3.us-west-2.amazonaws.com/videoplayback.mp4",
"trim": 0,
"type": "video"
},
"length": 33.45,
"start": 0
}
]
}
]
}
}
Notice that the output fps setting is set to 30 to match the source.
thank you! it makes sense