Skip to content

Conversation

eliteprox
Copy link
Collaborator

This pull request adds support for text frame processing and publishing throughout the PyTrickle pipeline. It introduces new TextFrame and TextOutput classes, enables text processing in the core client and stream processor, and ensures text data can be handled, processed, and published similarly to audio and video. The changes also include robust fallback and caching logic for frame processing, and update protocol and logging to handle the new text frame type.

Text frame and output support:

  • Added TextFrame and TextOutput classes to represent and handle text data (e.g., for transcription workflows) in frames.py. [1] [2]
  • Updated imports and type handling in client.py, protocol.py, and stream_processor.py to include TextFrame and TextOutput. [1] [2] [3]

Text processing pipeline integration:

  • Extended FrameProcessor and its async processing methods to support text frames, including a new process_text_with_fallback method for robust text handling. [1] [2]
  • Updated StreamProcessor to accept a text_processor function, validate at least one processor is provided, and process text frames in the internal processor. [1] [2] [3] [4] [5]

Client and protocol logic updates:

  • Modified the client ingress loop to process, send, and publish text frames, including fallback and logging logic for empty or failed frames. [1] [2] [3]
  • Updated protocol logic to handle text frames and outputs, including debug logging and ensuring text frames do not affect FPS metrics. [1] [2]

Frame caching and fallback improvements:

  • Added frame caching and fallback logic for video, audio, and text frames in FrameProcessor to improve robustness in case of processing failures.

These changes collectively enable robust, efficient, and extensible support for text data in the PyTrickle streaming and processing pipeline.

@eliteprox eliteprox changed the base branch from main to feat/last-processed-frame August 18, 2025 18:23
@eliteprox eliteprox changed the base branch from feat/last-processed-frame to main August 18, 2025 18:23
@JJassonn69 JJassonn69 requested a review from Copilot August 18, 2025 21:35
Copilot

This comment was marked as outdated.

@eliteprox eliteprox marked this pull request as draft August 19, 2025 17:23
@eliteprox eliteprox force-pushed the feat/text-processor branch 3 times, most recently from ea04dfa to 4241b16 Compare August 19, 2025 18:04
@eliteprox eliteprox marked this pull request as ready for review August 19, 2025 18:06
@eliteprox eliteprox requested a review from Copilot August 19, 2025 18:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds comprehensive text frame processing capabilities to the PyTrickle pipeline, enabling text data to be processed and published alongside audio and video streams. The changes implement text publishing functionality for processing workflows like transcription services.

  • Introduces text frame processing infrastructure with TextFrame and TextOutput classes
  • Adds text publishing capabilities to processing functions through a publish_text parameter
  • Implements robust frame caching and fallback mechanisms for improved reliability

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pytrickle/frames.py Adds import for time module (minor addition)
pytrickle/frame_processor.py Adds async text publishing method and timing reset hook
pytrickle/stream_processor.py Adds text publishing support and validation for processor functions
pytrickle/client.py Implements comprehensive frame caching and fallback logic with text publishing
examples/requirements.txt Adds scipy dependency for audio processing examples
examples/process_video_with_text.py New example demonstrating text publishing with passthrough processing
examples/process_audio_example.py New example showing advanced audio effects processing
.vscode/launch.json Adds debug configurations for new examples

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@eliteprox eliteprox force-pushed the feat/text-processor branch from 0aa44de to 3325d99 Compare August 19, 2025 18:32
@@ -0,0 +1,121 @@
#!/usr/bin/env python3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets rename this example to video_to_text or something similar

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example counts audio frames and publishes some basic stats to the data publisher to demonstrate text publishing. Should we name it text_output_example.py?

Args:
text: Text data to publish (usually JSONL format)
"""
pass # Default implementation does nothing
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

planning to implement in this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in version in favor of a shared text_queue for publishing outputs

@eliteprox eliteprox force-pushed the feat/text-processor branch 2 times, most recently from d0669dd to 54b7e8c Compare August 20, 2025 00:18
@eliteprox eliteprox force-pushed the feat/text-processor branch 2 times, most recently from 471179c to 29c042f Compare August 20, 2025 00:41
@eliteprox eliteprox force-pushed the feat/text-processor branch from ea8b41f to 5b24aee Compare August 20, 2025 00:49
@eliteprox eliteprox requested a review from pschroedl August 20, 2025 00:50
@eliteprox eliteprox force-pushed the feat/text-processor branch from fc8d4ff to 49f1736 Compare August 20, 2025 00:57
@eliteprox eliteprox closed this Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants