Compare commits

..

1 commit

Author SHA1 Message Date
Victor Arvidsson
1a8b831ebf
Merge e4cfe4ea0d into 1a9b09682a 2024-10-24 15:54:53 +13:00
2 changed files with 4 additions and 41 deletions

View file

@ -1816,52 +1816,15 @@ 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 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
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
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

View file

@ -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 = 0;
size_t start_pos = std::string::npos;
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'