-
Notifications
You must be signed in to change notification settings - Fork 3
Subtitles track experiment #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {FC} from 'react'; | ||
|
||
import {Sequence} from 'remotion'; | ||
import {SubtitleTrackRenderDescription} from '../utils/renderDescriptionSchema'; | ||
|
||
export const SubtitlesTrack: FC<SubtitleTrackRenderDescription> = (track) => { | ||
return ( | ||
<Sequence name={track.id}> | ||
{track.assets.map((asset) => { | ||
console.log(asset); | ||
return null; // TODO: Implement this | ||
})} | ||
</Sequence> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,11 +59,17 @@ const AudioTrackSchema = z.object({ | |
assets: z.array(AudioAssetSchema), | ||
}); | ||
|
||
const SubtitlesTrackSchema = z.object({ | ||
id: z.string(), | ||
index: z.number(), | ||
assets: z.array(z.object({})), | ||
}); | ||
Comment on lines
59
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How would you change that? Make a change proposal There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alfonsograziano, I propose the following changes to define a +const SubtitleAssetSchema = z.object({
+ id: z.string(),
+ startTime: z.number(),
+ endTime: z.number(),
+ text: z.string(),
+});
const SubtitlesTrackSchema = z.object({
id: z.string(),
index: z.number(),
- assets: z.array(z.object({})),
+ assets: z.array(SubtitleAssetSchema),
}); In this proposal, each subtitle asset has an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you implement that and do a commit to the repo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alfonsograziano, I'm an AI developed by OpenAI and currently, I don't have the capability to directly commit changes to a repository. However, you can use the proposed changes in your local environment and commit them yourself. Here's how you can do it:
const SubtitleAssetSchema = z.object({
id: z.string(),
startTime: z.number(),
endTime: z.number(),
text: z.string(),
});
const SubtitlesTrackSchema = z.object({
id: z.string(),
index: z.number(),
assets: z.array(SubtitleAssetSchema),
});
I hope this helps! If you have any other questions or need further clarification, feel free to ask. |
||
|
||
const TimelineSchema = z.object({ | ||
tracks: z.object({ | ||
video: z.array(VideoTrackSchema), | ||
audio: z.array(AudioTrackSchema), | ||
subtitles: z.array(z.object({}).nonstrict()), | ||
subtitles: z.array(SubtitlesTrackSchema), | ||
}), | ||
}); | ||
|
||
|
@@ -81,6 +87,9 @@ export type RenderDescription = z.infer<typeof MainSchema>; | |
|
||
export type AudioTrackRenderDescription = z.infer<typeof AudioTrackSchema>; | ||
export type VideoTrackRenderDescription = z.infer<typeof VideoTrackSchema>; | ||
export type SubtitleTrackRenderDescription = z.infer< | ||
typeof SubtitlesTrackSchema | ||
>; | ||
|
||
export type TextAssetSchemaRenderDescription = z.infer<typeof TextAssetSchema>; | ||
export type AssetSchemaRenderDescription = z.infer<typeof AssetSchema>; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
assets
property inSubtitlesTrackSchema
is defined as an array of empty objects. If this is intentional and you plan to allow any properties on these objects, consider usingz.object({}).nonstrict()
instead ofz.object({})
to explicitly allow additional properties.