Skip to content
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

add osd/srt support #53

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

add osd/srt support #53

wants to merge 5 commits into from

Conversation

henkwiedig
Copy link
Collaborator

This PR will add osd/srt file writeing support.
See Readme.

Works on ground and air mode but in air mode majestic needs to be configured to not write to a subdirectory: /mnt/mmcblk0p1/%F/..

Fixes: #35

@lida2003 please test as well

@lida2003
Copy link
Contributor

@henkwiedig Glad to have this feature. It's good to render OSD with https://github.com/avsaase/walksnail-osd-tool

It wroks fine: latest msposd(2607aa1) + msposd: support osd/srt files for raw video/osd speration

Works on ground and air mode but in air mode majestic needs to be configured to not write to a subdirectory: /mnt/mmcblk0p1/%F/..

Is it possible for msposd to recognize the flag or recording_dir == NULL to disable the inotify event, which will not trigger the srt/osd file logging?

Then we can simply configure the msposd to record or NOT.

What do you think?

BTW, currently, I use main branch msposd which don't have this patch. The patch file is on ground station.

@henkwiedig
Copy link
Collaborator Author

I didn't quite get your point.
Currently, when not useing --subtitle <path> we currently skip the file recodring, no inotify will be setup in in this case.
So either use --subtitle -> inotify -> file recodring or ommit --subtitle-> no inotify -> no file recodring.

On Air side:
When --subtile /mnt/mmcblk0p1/ is used and recording path is set to use subdirectories the file recdoring isn't started as it only takes actions for .mp4 files.
Is air side recording a thing anyhow ? Either we use msposd an air side to render osd, then osd is already in the recoding.
Or we use msposd to forward to ground side, then ground records osd.
Is there a use case to have air side osd recoding and no ground side osd recodring ?

@tipoman9
I'm currently working on recoding the MSPOSD.msg to the srt file. Will add this to this MR.
So please wait with the merge until this is added.

@henkwiedig
Copy link
Collaborator Author

@lida2003 srt file recording including the MSPOSD.msg should work now

@lida2003
Copy link
Contributor

I didn't quite get your point.
Currently, when not useing --subtitle <path> we currently skip the file recodring, no inotify will be setup in in this case.
So either use --subtitle -> inotify -> file recodring or ommit --subtitle-> no inotify -> no file recodring.

It should be OK “When not using --subtitle , we currently skip the file recording”, as no video no osd is acceptable.

Is air side recording a thing anyhow ? Either we use msposd an air side to render osd, then osd is already in the recoding.

I don't think osd will be recorded on airunit, as mp4 is recorded by majestic, which don't have osd input.
So if we turn on the recording on airunit then it's raw video without osd.

Or we use msposd to forward to ground side, then ground records osd.

Yes, that's exactly what we are talking about. And we need some backup method to ensure the video footage secure and safely recorded for cases: crash/sd damage/gs failure etc.

Well, the above concers really depends on how user will use the application.

Here is my user case:

  • 1080P@60FPS
  • gs desktop video record(1080P@30FPS, osd + video analysis)
  • gs raw viedo record (1080P@60FPS) + osd(.srt/.osd)
  • air unit raw video (1080P@60FPS) + osd(.srt/.osd), in case of interference or ...

It should be airunit(raw video + .osd/.srt) + gs(raw video + .osd/.srt). Regarding the timing synchronization mechanism, there are two sets of .mp4/.osd/.srt.

And currently, I use the above configuration + disable air unit raw video recording most of time.

Is there a use case to have air side osd recoding and no ground side osd recodring ?

No, I don't think there is such a need, but impress me with the requirement with detailed description.

@lida2003
Copy link
Contributor

lida2003 commented Feb 20, 2025

2025-02-20_09-22-24.zip

.srt file is empty.
I have echo " &L64 &F42 CPU:&C &B Temp:&T" > /tmp/MSPOSD.msg and saw thoese custom message on gs.

EDIT: BTW, walksnail-osd-tool 0.3.0 will exit when loading .srt/.osd, especially .srt is empty. It will exit when mp4 sometime. @henkwiedig Have you met this issue? Or how to solve?

@henkwiedig
Copy link
Collaborator Author

walksnail-osd-tool crash:
with empty srt file happens to me as well. that's up to Alexander to fix.

empty srt file:
Your recoding isn't very long. Did you stop the recoding ?
The file is not immediately flashed to disk.
Buffer is flushed to disk after stopping or when system's write buffer feels like it.

@lida2003
Copy link
Contributor

lida2003 commented Feb 20, 2025

walksnail-osd-tool crash:
with empty srt file happens to me as well. that's up to Alexander to fix.

Yes, I have created an issue. Not only empty srt file. . osd/.mp4 will exit also, some time.

empty srt file:
Your recoding isn't very long. Did you stop the recoding ?
The file is not immediately flashed to disk.
Buffer is flushed to disk after stopping or when system's write buffer feels like it.

I have recorded for about 1:49, which has only one message.
And CPU percetange/bitrate are changing by seconds.

1
00:00:01,095 --> 00:00:02,095
<font color="cyan">    CPU:14% 4.1Mb FPS:30 Temp:43 </font>

@henkwiedig
Copy link
Collaborator Author

As it's writeing "something" i still think this is a buffer issue. Added fflush() after each frame. Should also prevent data loss in case of sudden powerloss.
Does this solve the issue ?

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.

[Request] OSD info save as sperate files, not in DVR
2 participants