@endhtmlonly"
+ALIASES += youtube{1}="@htmlonly[block]@endhtmlonly"
TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
diff --git a/doc/tutorials/calib3d/camera_calibration/camera_calibration.markdown b/doc/tutorials/calib3d/camera_calibration/camera_calibration.markdown
index 2c6973141e..a7a7dd727e 100644
--- a/doc/tutorials/calib3d/camera_calibration/camera_calibration.markdown
+++ b/doc/tutorials/calib3d/camera_calibration/camera_calibration.markdown
@@ -279,8 +279,4 @@ quality cameras.
You may observe a runtime instance of this on the [YouTube
here](https://www.youtube.com/watch?v=ViPN810E0SU).
-\htmlonly
-
-
-
-\endhtmlonly
+@youtube{ViPN810E0SU}
diff --git a/doc/tutorials/calib3d/real_time_pose/real_time_pose.markdown b/doc/tutorials/calib3d/real_time_pose/real_time_pose.markdown
index e88585b4d3..3667c96448 100644
--- a/doc/tutorials/calib3d/real_time_pose/real_time_pose.markdown
+++ b/doc/tutorials/calib3d/real_time_pose/real_time_pose.markdown
@@ -791,13 +791,5 @@ int minInliersKalman = 30; // Kalman threshold updating
You can watch the real time pose estimation on the [YouTube
here](http://www.youtube.com/user/opencvdev/videos).
-\htmlonly
-
-
-
-\endhtmlonly
-\htmlonly
-
-
-
-\endhtmlonly
+@youtube{XNATklaJlSQ}
+@youtube{YLS9bWek78k}
diff --git a/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.markdown b/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.markdown
index 10521338c0..d64b27427d 100644
--- a/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.markdown
+++ b/doc/tutorials/core/file_input_output_with_xml_yml/file_input_output_with_xml_yml.markdown
@@ -263,8 +263,4 @@ MyData:
You may observe a runtime instance of this on the [YouTube
here](https://www.youtube.com/watch?v=A4yqVnByMMM) .
-\htmlonly
-
-
-
-\endhtmlonly
+@youtube{A4yqVnByMMM}
diff --git a/doc/tutorials/core/how_to_scan_images/how_to_scan_images.markdown b/doc/tutorials/core/how_to_scan_images/how_to_scan_images.markdown
index bb9c648246..4d5881943e 100644
--- a/doc/tutorials/core/how_to_scan_images/how_to_scan_images.markdown
+++ b/doc/tutorials/core/how_to_scan_images/how_to_scan_images.markdown
@@ -214,8 +214,4 @@ the safety trait of iterators.
Finally, you may watch a sample run of the program on the [video posted](https://www.youtube.com/watch?v=fB3AN5fjgwc) on our YouTube channel.
-\htmlonly
-
-
-
-\endhtmlonly
+@youtube{fB3AN5fjgwc}
diff --git a/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.markdown b/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.markdown
index d28786a8b1..bb445179d0 100644
--- a/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.markdown
+++ b/doc/tutorials/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.markdown
@@ -137,8 +137,4 @@ or find it in the
`samples/cpp/tutorial_code/core/interoperability_with_OpenCV_1/interoperability_with_OpenCV_1.cpp`
of the OpenCV source code library.
-\htmlonly
-
-
-
-\endhtmlonly
+@youtube{qckm-zvo31w}
diff --git a/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown b/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown
index 637e4bc571..9e4bd8a223 100644
--- a/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown
+++ b/doc/tutorials/core/mat_the_basic_image_container/mat_the_basic_image_container.markdown
@@ -266,8 +266,4 @@ or in the core section of the cpp samples.
You can also find a quick video demonstration of this on
[YouTube](https://www.youtube.com/watch?v=1tibU7vGWpk).
-\htmlonly
-
-
-
-\endhtmlonly
+@youtube{1tibU7vGWpk}
diff --git a/doc/tutorials/gpu/gpu-basics-similarity/gpu_basics_similarity.markdown b/doc/tutorials/gpu/gpu-basics-similarity/gpu_basics_similarity.markdown
index 6dd8194f18..e7ba511750 100644
--- a/doc/tutorials/gpu/gpu-basics-similarity/gpu_basics_similarity.markdown
+++ b/doc/tutorials/gpu/gpu-basics-similarity/gpu_basics_similarity.markdown
@@ -203,8 +203,4 @@ In both cases we managed a performance increase of almost 100% compared to the C
It may be just the improvement needed for your application to work. You may observe a runtime
instance of this on the [YouTube here](https://www.youtube.com/watch?v=3_ESXmFlnvY).
-\htmlonly
-
-\endhtmlonly
+@youtube{1OJEqpuaGc4}
diff --git a/doc/tutorials/introduction/windows_install/windows_install.markdown b/doc/tutorials/introduction/windows_install/windows_install.markdown
index c24210bfee..d703311642 100644
--- a/doc/tutorials/introduction/windows_install/windows_install.markdown
+++ b/doc/tutorials/introduction/windows_install/windows_install.markdown
@@ -105,12 +105,8 @@ Installation by Making Your Own Libraries from the Source Files {#tutorial_windo
You may find the content of this tutorial also inside the following videos:
[Part 1](https://www.youtube.com/watch?v=NnovZ1cTlMs) and [Part 2](https://www.youtube.com/watch?v=qGNWMcfWwPU), hosted on YouTube.
-\htmlonly
-
-
-
-
-\endhtmlonly
+@youtube{NnovZ1cTlMs}
+@youtube{qGNWMcfWwPU}
**warning**
diff --git a/doc/tutorials/ios/image_manipulation/image_manipulation.markdown b/doc/tutorials/ios/image_manipulation/image_manipulation.markdown
index 8abf0375ab..42fefa5ae9 100644
--- a/doc/tutorials/ios/image_manipulation/image_manipulation.markdown
+++ b/doc/tutorials/ios/image_manipulation/image_manipulation.markdown
@@ -115,8 +115,4 @@ Output
Check out an instance of running code with more Image Effects on
[YouTube](http://www.youtube.com/watch?v=Ko3K_xdhJ1I) .
-\htmlonly
-
-
-
-\endhtmlonly
+@youtube{Ko3K_xdhJ1I}
diff --git a/doc/tutorials/ml/non_linear_svms/non_linear_svms.markdown b/doc/tutorials/ml/non_linear_svms/non_linear_svms.markdown
index 1a18870079..242ef6e7a8 100644
--- a/doc/tutorials/ml/non_linear_svms/non_linear_svms.markdown
+++ b/doc/tutorials/ml/non_linear_svms/non_linear_svms.markdown
@@ -184,8 +184,4 @@ Results
You may observe a runtime instance of this on the [YouTube here](https://www.youtube.com/watch?v=vFv2yPcSo-Q).
-\htmlonly
-
-
-
-\endhtmlonly
+@youtube{vFv2yPcSo-Q}
diff --git a/doc/tutorials/videoio/video-input-psnr-ssim/video_input_psnr_ssim.markdown b/doc/tutorials/videoio/video-input-psnr-ssim/video_input_psnr_ssim.markdown
index 24a0fc7e95..50f32aac6e 100644
--- a/doc/tutorials/videoio/video-input-psnr-ssim/video_input_psnr_ssim.markdown
+++ b/doc/tutorials/videoio/video-input-psnr-ssim/video_input_psnr_ssim.markdown
@@ -244,8 +244,4 @@ the console. Expect to see something like:
You may observe a runtime instance of this on the [YouTube here](https://www.youtube.com/watch?v=iOcNljutOgg).
-\htmlonly
-
-
-
-\endhtmlonly
+@youtube{iOcNljutOgg}
diff --git a/doc/tutorials/videoio/video-write/video_write.markdown b/doc/tutorials/videoio/video-write/video_write.markdown
index 38c9151248..9781a7075d 100644
--- a/doc/tutorials/videoio/video-write/video_write.markdown
+++ b/doc/tutorials/videoio/video-write/video_write.markdown
@@ -153,8 +153,4 @@ around the idea:
You may observe a runtime instance of this on the [YouTube
here](https://www.youtube.com/watch?v=jpBwHxsl1_0).
-\htmlonly
-