Skip to content

Commit

Permalink
Hereby is a usable version 0.1:
Browse files Browse the repository at this point in the history
* Added Marker function to assist track alignment.
* Added tips in UI and README.
  • Loading branch information
ian-droid committed Sep 22, 2023
1 parent cd21ea0 commit 2ff3dba
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@

A simple multi-tracks video player with minimal function set to play video files like in video editors.

It's written in PyQt5, and has only been tested under Debian Bookworm. For Windows users, you may need additional codec to make Qt Media Player working.

It saves track(s) info in YAML, so the playing sequence can be easily edited with text editors (before the GUI is fully Functional).
Written in Python with PyQt5, it's just working: barely no exception handling. And it's only been tested under Debian Bookworm. For Windows users, you may need additional codec to make Qt Media Player working or you will have a empty player window.

## Requirements
- Python3 (3.7+)
- PyQt5
- YAML
- MediaInfo

## Usage Tips
- Drag & drop (video) file(s) into a track for playing.
- Drop .tracks file to the main window to load saved track(s). The track(s) info are saved in YAML file, so the playing sequence can be edited with text editors (before the GUI is fully Functional).
- Click on the cilp (yes, they are presented as buttons for now), you can set advance or delay the start position of the clip in the timeline. However, for now, the change is cascaded on the following clips if there's any.
- Clip alignment can also be adjusted with a marker: In player window, use Ctrl + mouse click to mark the current position as target position, then you can use Shift + mouse click in (other) player window at the moment you want to align with the previous marked target position. And Alt + mouse click in any player window to clear the marker (set to 0:00:00).
- Up/Down arrow keys can adjust the sound volume of the focused player window (track); Left/Right arrow keys can seek the current playing clip (in a step of 1 second), while this also changes the position of the clip in the timeline, and this function is unreliable.


## To Do
- Frameless player window.
- Draggable clips.
- Improve the UI, especially for Windows, as it's not displayed as proper as in Debian with scaled 4K desktop.
- Better window management: main window start position, and (auto) arrangement of opened player window(s).
- Draggable clips.
6 changes: 3 additions & 3 deletions tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def __init__(self, clip):
self.layout.addWidget(QtWidgets.QLabel(f'{clip.name} current starats at {clip.durMsStr(clip.sPos)}({clip.sPos/1000})'))

self.direction = QtWidgets.QComboBox(self)
self.direction.addItem('+')
self.direction.addItem('-')
self.direction.addItem('Delay')
self.direction.addItem('Advance')

# seconds = floor(clip.sPos / 1000)
# minutes = floor(seconds/60)
Expand Down Expand Up @@ -54,7 +54,7 @@ def __init__(self, clip):

def getMS(self) -> int:
direction = 1
if self.direction.currentText() == '-': direction = -1
if self.direction.currentText() == 'Advance': direction = -1
return ((self.mins.value() * 60 + self.secs.value())*1000 + self.ms.value()) * direction

@staticmethod
Expand Down
5 changes: 5 additions & 0 deletions tracksplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,25 @@ def createUI(self):
self.addTrackBtn = QtWidgets.QPushButton("+", self)
self.addTrackBtn.setCheckable(False)
self.addTrackBtn.setFixedSize(50, 30)
self.addTrackBtn.setToolTip("Add a new blank track.")


self.saveTracksBtn = QtWidgets.QPushButton("💾︎", self)
self.saveTracksBtn.setCheckable(False)
self.saveTracksBtn.setFixedSize(50, 30)
self.saveTracksBtn.setToolTip("Save the track(s) to a file.")

self.newTracksBtn = QtWidgets.QPushButton("🗋", self)
self.newTracksBtn.setCheckable(False)
self.newTracksBtn.setFixedSize(50, 30)
self.newTracksBtn.setToolTip("Clear all tracks.")

self.speedDial = QtWidgets.QDial(self)
self.speedDial.setMinimum(0)
self.speedDial.setMaximum(2)
self.speedDial.setValue(self.tracks.pbSpeedF)
self.speedDial.setDisabled(True)
self.speedDial.setToolTip("Playback speed dial (unimplemented.).")

self.sttBar= QtWidgets.QStatusBar(self)
# self.sttBar.addPermanentWidget(self.progressClock)
Expand Down

0 comments on commit 2ff3dba

Please sign in to comment.