Skip to content

Commit

Permalink
Substantially overhaul old "aligned media" format
Browse files Browse the repository at this point in the history
We'll probably rename the format entirely, but we need something that
looks fairly different to support a quality GUI.
  • Loading branch information
emk committed May 4, 2024
1 parent 3d7f883 commit f10160b
Show file tree
Hide file tree
Showing 6 changed files with 436 additions and 135 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions aligned_media/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ no_forwards_compatibility = []
[dependencies]
isolang = { version = "2.4.0", features = ["serde"] }
peg = "0.8.2"
relative-path = { version = "1.9.2", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0.58"
uuid = { version = "1.8.0", features = ["serde", "v4"] }
84 changes: 76 additions & 8 deletions aligned_media/fixtures/examples/book_example.aligned/metadata.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,86 @@
{
"creators": [
"Miguel de Cervantes Saavedra"
],
"title": "El ingenioso hidalgo don Quijote de la Mancha",
"year": 1605,
"tracks": {
"es": {
"type": "html",
"origin": "original",
"lang": "es"
},
"en": {
"type": "html",
"origin": "ai_generated",
"generated_by": "gpt-4",
"derived_from_track_id": "es",
"lang": "en"
},
"notes": {
"type": "notes"
}
},
"tags": [
"classic"
],
"base_track_id": "es",
"alignments": [
{
"tracks": [
"id": "2acdeaf4-7b0c-4f78-abf2-dc299ab362e9",
"heading": 1,
"tracks": {
"es": {
"html": "El ingenioso hidalgo don Quijote de la Mancha"
},
"en": {
"html": "The Ingenious Gentleman Don Quijote of La Mancha"
}
}
},
{
"id": "f4b3b3b4-4b3b-4b3b-4b3b-4b3b4b3b4b3b",
"heading": 2,
"tracks": {
"es": {
"html": "Capítulo I. Que trata de la condición y ejercicio del famoso hidalgo don Quijote de la Mancha"
},
"en": {
"html": "Chapter I. Which treats of the condition and exercise of the famous gentleman don Quijote of La Mancha"
}
}
},
{
"alignments": [
{
"type": "html",
"lang": "fr",
"html": "<i>Jean &amp; Luc:</i> On y va !"
"id": "f5fb686f-b0ab-486c-9e7d-40c4abd51bc7",
"tracks": {
"es": {
"html": "En un lugar de la Mancha, de cuyo nombre no quiero acordarme, no ha mucho tiempo que vivía un hidalgo de los de lanza en astillero, adarga antigua, rocín flaco y galgo corredor."
},
"en": {
"html": "In a place of La Mancha, whose name I do not wish to recall, not long ago there lived a gentleman of the type with a lance in the rack, an ancient shield, a skinny steed, and a racing greyhound."
},
"notes": {
"html": "<ul><li>\"acordarme\" is a reflexive verb that means \"to remember\"; the reflexive pronoun \"me\" is used to indicate that the action is being done to oneself.</li></ul>"
}
},
"tags": [
"star"
]
},
{
"type": "html",
"lang": "en",
"html": "<i>Jean &amp; Luc:</i> Let's go!"
"id": "f24a1744-45f9-4b00-98b1-c7a4c27a5a12",
"tracks": {
"es": {
"html": "Una olla de algo más vaca que carnero, salpicón las más noches, duelos y quebrantos los sábados, lantejas los viernes, algún palomino de añadidura los domingos, consumían las tres partes de su hacienda."
},
"en": {
"html": "A pot of stew more beef than mutton, minced meat most nights, grievous discomforts on Saturdays, lentils on Fridays, and an occasional pigeon as a treat on Sundays, consumed three parts of his estate."
}
}
}
]
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
{
"baseTrack": {
"type": "media",
"lang": "fr",
"file": "episode1.mp4"
"series": {
"series_title": "Les aventures de Jean & Luc",
"index_in_series": 1
},
"title": "Episode 01.01",
"tracks": {
"base.": {
"origin": "original",
"type": "media",
"lang": "fr",
"file": "files/episode1.mp4"
},
"subs.fr": {
"origin": "ai_generated",
"generated_by": "whisper-1",
"derived_from_track_id": "base",
"type": "html",
"lang": "fr"
},
"subs.en": {
"origin": "ai_generated",
"generated_by": "gpt-3.5-turbo",
"derived_from_track_id": "subs.fr",
"type": "html",
"lang": "en"
}
},
"base_track_id": "base",
"alignments": [
{
"id": "56523fb0-b4c5-40d4-bb08-4c59fb027dbb",
"timeSpan": [
10,
15.5
],
"tracks": [
{
"type": "html",
"lang": "fr",
"tracks": {
"subs.fr": {
"html": "<i>Jean &amp; Luc:</i> On y va !"
},
{
"type": "html",
"lang": "en",
"subs.en": {
"html": "<i>Jean &amp; Luc:</i> Let's go!"
}
]
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,36 +1,66 @@
{
"baseTrack": {
"type": "media",
"lang": "fr",
"file": "episode1.mp4"
"tracks": {
"base.": {
"origin": "original",
"type": "media",
"lang": "fr",
"file": "files/episode1.mp4"
},
"subs.fr": {
"origin": "ai_generated",
"generated_by": "whisper-1",
"derived_from_track_id": "base",
"type": "html",
"lang": "fr"
},
"subs.en": {
"origin": "ai_generated",
"generated_by": "gpt-3.5-turbo",
"derived_from_track_id": "subs.fr",
"type": "html",
"lang": "en"
},
"image": {
"origin": "extracted",
"derived_from_track_id": "base",
"type": "image"
},
"card_audio": {
"origin": "extracted",
"derived_from_track_id": "base",
"type": "media",
"lang": "fr"
}
},
"base_track_id": "base",
"alignments": [
{
"id": "b9cbc638-430b-4b71-9c92-3f9e3e651a5c",
"timeSpan": [
10,
15.5
],
"tracks": [
{
"tracks": {
"subs.fr": {
"type": "html",
"lang": "fr",
"html": "<i>Jean &amp; Luc:</i> On y va !"
},
{
"subs.en": {
"type": "html",
"lang": "en",
"html": "<i>Jean &amp; Luc:</i> Let's go!"
},
{
"image": {
"type": "image",
"file": "episode1_12_75.jpg"
"file": "files/episode1_12_75.jpg"
},
{
"card_audio": {
"type": "media",
"lang": "fr",
"file": "episode1_9_00_16_50.mp3"
"file": "files/episode1_9_00_16_50.mp3"
}
]
}
}
]
}
}
Loading

0 comments on commit f10160b

Please sign in to comment.