mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-27 20:58:47 +00:00
Compare commits
2 commits
e4cfe4ea0d
...
c36e6ffa41
Author | SHA1 | Date | |
---|---|---|---|
|
c36e6ffa41 | ||
|
51cf9e9d1c |
2 changed files with 41 additions and 4 deletions
|
@ -1816,15 +1816,52 @@ from the _Media_ tab as well as the dive profile.
|
|||
|
||||
By right-clicking on a video and selecting the "Save dive data as subtitles" option, a subtitles
|
||||
file with the same name as the video but with an ".ass" extension is created that contains
|
||||
time dependent dive data (runtime, depth, temperature, NDL, TTS, surface GF) to be overlayed
|
||||
with the video. The VLC video player automatically finds this file upon playing the video
|
||||
and overlays the dive data. Alternatively, the ffmpeg video encoder can be used to create a
|
||||
time dependent dive data to be overlayed with the video. The format of the subtitle is specified
|
||||
in the _Media preferences_ (_File->Preferences->Media_). The tags used in the format string are
|
||||
replaced with the actual values, if present, or removed if not present in the data.
|
||||
The VLC video player automatically finds this file upon playing
|
||||
the video and overlays the dive data. Alternatively, the ffmpeg video encoder can be used to create a
|
||||
new video file with the dive data encoded in the video stream. To do so run
|
||||
|
||||
ffmpeg -v video.mp4 -vf "ass=video.ass" video_with_data.mp4
|
||||
|
||||
from the command line. You need to have the libass library installed.
|
||||
|
||||
Available tags are:
|
||||
* Dive time: [time]
|
||||
* Depth: [depth]
|
||||
* Temperature: [temperature]
|
||||
* Ceiling: [ceiling]
|
||||
* NDL: [ndl]
|
||||
* TTS: [tts]
|
||||
* RBT: [rbt]
|
||||
* Stop time: [stoptime]
|
||||
* Stop depth: [stopdepth]
|
||||
* CNS: [cns]
|
||||
* SAC: [sac]
|
||||
* pO₂: [p_o2]
|
||||
* pN₂: [p_n2]
|
||||
* pHe: [p_he]
|
||||
* O₂ pressure (rebreather): [o2_pressure]
|
||||
* O₂ setpoint: [o2_setpoint]
|
||||
* SCR ΔpO₂: [scr_oc_po2]
|
||||
* MOD: [mod]
|
||||
* EAD: [ead]
|
||||
* END: [end]
|
||||
* EADD: [eadd]
|
||||
* Vertical speed: [speed]
|
||||
* In deco (calculated): [in_deco]
|
||||
* NDL (calculated): [ndl_calc]
|
||||
* TTS (calculated): [tts_calc]
|
||||
* Stop time (calculated): [stoptime_calc]
|
||||
* Stop depth (calculated): [stopdepth_calc]
|
||||
* Heartrate: [heartrate]
|
||||
* Bearing: [bearing]
|
||||
* Surface GF: [surface_gf]
|
||||
* Current GF: [current_gf]
|
||||
* Density: [density]
|
||||
* ICD Warning: [icd_warning]
|
||||
|
||||
==== Media on an external hard disk
|
||||
Most underwater photographers store media on an external drive. If such a drive can be mapped by the operating system
|
||||
(almost always the case) the media can be directly accessed by _Subsurface_. This eases the interaction
|
||||
|
|
|
@ -50,7 +50,7 @@ static std::string video_time(int secs)
|
|||
void replace_all(std::string& str, const std::string& old_value, const std::string& new_value) {
|
||||
if (old_value.empty())
|
||||
return;
|
||||
size_t start_pos = std::string::npos;
|
||||
size_t start_pos = 0;
|
||||
while ((start_pos = str.find(old_value, start_pos)) != std::string::npos) {
|
||||
str.replace(start_pos, old_value.length(), new_value);
|
||||
start_pos += new_value.length(); // In case 'new_value' contains 'old_value', like replacing 'x' with 'yx'
|
||||
|
|
Loading…
Reference in a new issue