Commit graph

3803 commits

Author SHA1 Message Date
Mathieu Duponchelle
71121a2380 aws: reimplement two separate wrappers for translate and transcribe
The original awstranscribe element has grown too complex when
integrating translations for reasons that in retrospect were wrong:

As awstranscribe outputs words one by one, I decided we wanted to
perform translations there with larger sentences if available, but an
alternative design where a separate translation element is composed
downstream is also possible, as long as that element accumulates words
and enough latency is set on the transcriber.

An important difference is that the new elements do not expose unsynced
pads, this use case is instead now served by simple messages on the bus.

The elements should otherwise be at feature parity with the original
element.

A higher-level bin is also provided for convenience (and usage within
transcriberbin): translationbin.

A transcriber element can be provided to this bin, which exposes an
always audio sink pad, and an always text sink pad (for the
transcripts).

Additional source pads can be requested for translations, for now the
bin always uses `awstranslate` as the translator, but this can be made
configurable.

This element is usable as a transcriber in `transcriberbin`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2055>
2025-02-10 11:16:44 +00:00
Mathieu Duponchelle
7d26990d4a tttocea608: insert carriage returns on speaker changes
This improves readability with speaker-detection capable elements
upstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2055>
2025-02-10 11:16:44 +00:00
Mathieu Duponchelle
2d0effd781 speechmaticstranscriber: add properties for speaker detection
diarization=speaker can be set to enable speaker detection, and
max-speakers can be set to control the maximum number of detected
speakers.

An event is then forwarded downstream upon speaker changes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2055>
2025-02-10 11:16:44 +00:00
Mathieu Duponchelle
9da6dff1a9 speechmaticstranscriber: post messages with raw results
This deprecates the buffers pushed on the unsynced pads, which should
be removed prior to release.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2055>
2025-02-10 11:16:44 +00:00
Mathieu Duponchelle
484275b350 speechmaticstranscriber: output items as early as possible
There is no reason to delay the output of items until the deadline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2055>
2025-02-10 11:16:44 +00:00
Mathieu Duponchelle
0ed3f833ac speechmaticstranscriber: add new max-delay property
This allows controlling the requested delay independently from the
latency of the element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2055>
2025-02-10 11:16:44 +00:00
Guillaume Desmottes
d3686ce06e togglerecord: drop locks before sending queries
Sending a serialized query may potentially block so best to release
locks before doing so.

Hopefully fix a dead lock I analyzed from a post mortem report.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2060>
2025-02-07 14:55:22 +01:00
Carlos Bentzen
7e2a4cf61c cdg: fix typefind error with specific file sizes
Currently, the typefind logic for cdg can cause errors on files
with all conditions below:
- size multiple of NB_WINDOWS * CDG_PACKET_SIZE (8 * 24) = 192
- size less than TYPEFIND_SEARCH_WINDOW (28800)
- extension different than .cdg

With those conditions, the cdg typefind function may be the last one to
execute and cause gsttypefindhelper.c::helper_find_peek to return
GST_FLOW_EOS, and if it's the final call will then be turned to
GST_FLOW_ERROR in typefind.

That is because cdg's typefind will perform a last call to
typefind.peek(len, CDG_PACKET_SIZE) which is outside the range of typefind
(from 0 to len - 1).

Reproducer with file from cdg tests:
```
head -n 28608 BrotherJohn.cdg > BrotherJohn_short.bit
gst-play-1.0 BrotherJohn_short.bit
```

Fix this by correcting the loop bounds in the cdg typefind
logic. Perhaps the typefind helper logic should be rewritten to avoid
such cases too.

Then the example above works and unrelated files aren't affected by this
in typefind anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2056>
2025-02-03 06:32:43 +00:00
Sanchayan Maity
ef4fd6059d net/hlsmultivariantsink: Add test for MPEG-TS with H265
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2054>
2025-01-31 15:24:16 +05:30
Sanchayan Maity
6911e865c9 net/hlsmultivariantsink: Drop cros-codecs as a dependency
This copies over the required bits of code from cros-codecs
and drops the dependency on cros-codecs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2054>
2025-01-31 15:24:16 +05:30
Sanchayan Maity
e3049e272c net/hlsmultivariantsink: Update cros_codecs to v0.0.5
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2054>
2025-01-30 18:43:48 +05:30
Matthew Waters
5c7ab9b491 closedcaption: fix roll up mode not always using the correct base row
The row used in roll up mode was inconsistently referenced (row vs base_row)
and could result in incorrect output being produced.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2051>
2025-01-28 22:22:49 +00:00
Matthew Waters
12811f9bc3 closedcaption/608overlay: add some debug loggin when resets occur
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2051>
2025-01-28 22:22:49 +00:00
Matthew Waters
4f4f84a615 cea608overlay: ensure tha the list of lines remains sorted by line number
Otherwise, when iterating over the lines, they may be written out of order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2051>
2025-01-28 22:22:49 +00:00
Sanchayan Maity
5639a0640e net/hlsmultivariantsink: Add since marker to fix doc build failure
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1515>
2025-01-28 16:37:35 +05:30
Sanchayan Maity
05b5aa939f hlsmultivariantsink: Add hlssink3 and cmafmux as dev dependencies
This is required for the hlsmultivariantsink tests to work. Also
register the plugins before running the test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1515>
2025-01-28 16:37:35 +05:30
Sanchayan Maity
362898cd54 hlsmultivariantsink: Enable MPEG-TS codec string support only for Linux
For the MPEG-TS case, we depend on cros-codecs for parsing SPS to get
the relevant information for building codec strings. Do not compile it
for non-linux platforms. Users needing MPEG-TS on non-linux platform
need to set codec string manually as a workaround.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1515>
2025-01-28 16:37:35 +05:30
Sanchayan Maity
104d9110b7 Fix CI failure for typos with hlsmultivariantsink
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1515>
2025-01-28 16:37:35 +05:30
Sanchayan Maity
4218e88fce Add HLS sink with multi-variant playlist support
`hlsmultivariantsink` adds support for the following as per RFC 8216

- Multivariant/master playlist
- Alternate Renditions
- Variant Streams

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1515>
2025-01-28 16:37:35 +05:30
Yaakov Selkowitz
f7ba4c40a7 Add missing copies of license files
This should fix the crates that are missing license files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2050>
2025-01-27 19:26:53 -05:00
Sebastian Dröge
aa06572e42 mpegtslivesrc: Handle zero-byte adaption fields
Simply skip over them instead of handling them as parse error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2047>
2025-01-21 14:22:54 +02:00
Brad Hards
251819a57d mux/mp4: support ISO/IEC 23001-17 uncompressed encoding
This adds support for direct encoding of common formats into ISO base media file
format.

There are unit tests for formats that are not completely supported, to
check that those functions work correctly, and to ease future extension.

End-to-end testing currently requires use of gpac to validate files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1990>
2025-01-21 09:20:13 +00:00
Tim-Philipp Müller
74760e1b42 rtp: ac3: validate depayloaded AC-3 data in unit tests
Check for valid frame header.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2044>
2025-01-20 18:32:50 +00:00
Tim-Philipp Müller
f6d21810ff rtp: tests: add run_test_pipeline variants with data validation
So we can actually check the content of depayloaded buffers too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2044>
2025-01-20 18:32:50 +00:00
Tim-Philipp Müller
5ccef7a453 rtpac3depay2: fix handling of non-fragmented payloads
The frames of a non-fragmented payload would contain
an extra two bytes before the frame sync and then
missing two bytes at the end which which would cause
decoding errors on the last block and/or frame crc
check failures.

This happened because we didn't take into account
the 2-byte packet payload header when creating output
sub-buffers, as the offsets we were using were in
relation to the payload data after the headers.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/645

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2044>
2025-01-20 18:32:50 +00:00
Mathieu Duponchelle
cf40739da9 transcriberbin: forward sticky events on unsynced source pads
This way an application can tell the language code right away at
pad-added time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2029>
2025-01-20 14:27:05 +00:00
Mathieu Duponchelle
c51a65d973 awstranscriber, speechmatics: store language tags on translation source pads
In order to do so we need to activate the pad as soon as it is added,
which means we can no longer start the task at this point, instead wait
for stream-start to do so now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2029>
2025-01-20 14:27:05 +00:00
Sebastian Dröge
2ec5747ec7 deny: Update
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2045>
2025-01-20 13:58:28 +02:00
Sebastian Dröge
261211886f ffv1: Update to a newer git revision of the codec implementation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2045>
2025-01-20 13:58:06 +02:00
Diego Nieto
d4e76dfdc8 tutorial: update tutorial markdowns to update to LazyLock
Update both tutorial-1.md and tutorial-2.md to match the changes
done in the tutorials implementation regarding Lazy to LazyLock

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2041>
2025-01-16 07:16:19 +00:00
Sebastian Dröge
8e62e54cc9 rtp: basepay: Only forward buffers if we have a segment
If there are pending buffers without a segment then they must come from
the caps only and should be forwarded at a later time, if any.

Also reject any incoming buffers if no segment was received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2037>
2025-01-15 09:43:12 +00:00
Sebastian Dröge
536f4db5c1 rtp: basedepay: Only forward buffers if we have a segment
If there are pending buffers without a segment then they must come from
the caps only and should be forwarded at a later time, if any.

Also reject any incoming buffers if no segment was received.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2037>
2025-01-15 09:43:12 +00:00
Piotr Brzeziński
5b41d11f0c fallbacksrc: Add multi-stream support with the stream API
Brings support for multiple streams of each kind to fallbacksrc.

Usage past 1video/1audio stream now requires using the stream selection
API.
fallbacksrc will expose its own collection of streams, which will be
mapped to streams from the main and fallback source automatically.
This mapping can be changed via the map-streams signal.
The amount of streams being exposed by fallbacksrc is dictated by the
main source.

CustomSource has been updated to also support multi-stream scenarios,
both for stream-aware elements and for simple bins without such
functionality.

Co-authored-by: Sebastian Dröge <sebastian@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1832>
2025-01-14 13:04:25 +00:00
Sebastian Dröge
3a03310dbc mccparse: Switch away from deprecated winnow API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2040>
2025-01-14 10:43:40 +02:00
Sebastian Dröge
3501912547 outdated: Ignore outdated etherparse dependency
It requires Rust 1.81 or newer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2040>
2025-01-14 10:05:24 +02:00
Sebastian Dröge
8b11363bdc deny: Update
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2040>
2025-01-14 10:04:35 +02:00
Sebastian Dröge
aa85a1d8a9 Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2040>
2025-01-14 10:04:35 +02:00
Sebastian Dröge
ba70293d2b fmp4: Update to dash-mpd 0.18
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2040>
2025-01-14 10:04:35 +02:00
Sebastian Dröge
9056c733c5 tracers: Update to dirs 6
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2040>
2025-01-14 10:04:27 +02:00
Thibault Saunier
aafebc6a97 pcap_writer: Move to using USE_STRUCTURE_PARAMS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2031>
2025-01-10 08:17:30 -03:00
Jochen Henneberg
0d42ed9a57 fmp4mux: Only set TKHD transformation, precedence for stream scope
Instead of trying to figure out which global tag is meant to go into
the MVHD or such the solution now is to set the MVHD matrix to
identity and only set the TKHD matrix to either stream scope matrix if
available or global matrix (which is always available, maybe as
identity).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1975>
2025-01-10 09:04:41 +00:00
Jochen Henneberg
58ee9e2b9f fmp4mux: Fixed logging for unsupported orientation tags
Fmp4mux State and Stream structs now store matrix references instead
of orientation enum.

The TransformMatrix is wrapped into a struct for Default trait which
is needed by struct State.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1975>
2025-01-10 09:04:41 +00:00
Jochen Henneberg
aeb37c5ab1 fmp4mux: Added mut_ prefix for stream_from_pad()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1975>
2025-01-10 09:04:41 +00:00
Jochen Henneberg
57f24efc62 fmp4mux: Log on unsupported orientation enums
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1975>
2025-01-10 09:04:41 +00:00
Jochen Henneberg
7dea11f626 fmp4mux: Language and orientation are stream tags
The language tag is purely a stream specific tag and the orientation
tag can be both, stream or global scope at the same time.

Language tags in global scope are considered to be stream scope and
orientation tags set either the mvhd box transformation matrix if
global scope or tkhd if stream scope.

And switched to GStreamer API for image orientation tag storage and
handling and added the flip transformations.

Fixes #631

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1975>
2025-01-10 09:04:41 +00:00
Sebastian Dröge
7b4665c793 Fix some new clippy 1.84 warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2032>
2025-01-10 10:08:38 +02:00
Mathieu Duponchelle
69f927cc24 transcriberbin: expose subtitle-languages property
Similar to synthesis-languages, except that transcriberbin will not
place a textwrap element before the synthesizer, instead letting the
application do that itself if needed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2015>
2025-01-08 12:26:22 +00:00
Guillaume Desmottes
1b761f27ef uriplaylistbin: add caching
Add optional caching feature preventing to re-download playlist items
for each iteration.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2028>
2025-01-07 20:29:38 +00:00
Mathieu Duponchelle
70ed528c7a transcriberbin: fix casing of translation languages
The language should only be lowercased in order to compare it to cc1 /
cc3, but should be passed as is to the transcriber.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2027>
2025-01-06 16:59:11 +01:00
Robert Mader
cb88843a5a meson: Set gtk_v4_16 feature
So builds using Meson use GtkGraphicsOffload::black-background as well.

Fixes: 38044858 ("gtk4: Enable GtkGraphicsOffload::black-background property when building with GTK 4.16")
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2021>
2025-01-03 20:55:27 +01:00