]> git.sesse.net Git - nageru-docs/blobdiff - video.rst
Document unsynchronized HDMI/SDI output.
[nageru-docs] / video.rst
index ed565f8d746b6ff82bbf17527e391d39073c56ba..40dfd5ad102e6f63cffbd00c1cb965bb1a040eab 100644 (file)
--- a/video.rst
+++ b/video.rst
@@ -8,8 +8,7 @@ they also carry video). The most obvious example would be a video file on disk
 flexible and can be used also for other things.
 
 Before reading trying to use video inputs, you should read and understand how
-themes work in general (see :doc:`theme`). Video inputs are available from
-Nageru 1.6.0 onwards, and from Nageru 1.7.2, you can get audio from video inputs
+themes work in general (see :doc:`theme`). You can get audio from video inputs
 like any other input. (Be advised, though, that making a general video player
 that can maintain A/V sync on all kinds of video files is a hard problem,
 so there may still be bugs in this support.)
@@ -26,7 +25,9 @@ Adding video to an existing chain happens in two phases; first, the video
 must be *loaded*, giving it an identifier, and then that video can be used
 as inputs in a chain, much like :ref:`images <images>` or regular live inputs.
 Anything FFmpeg accepts, including network streams, can be used (probably even
-V4L input cards, although this is untested).
+V4L input cards, although this is untested). Video hardware acceleration is used
+if available, although the decoded data currently takes a round trip through
+the GPU.
 
 When loading a video, you need to decide what format to use; Y'CbCr or BGRA.
 (Whatever you choose, if you get a mismatch with what the video actually is in,
@@ -44,18 +45,11 @@ or, for a network stream, perhaps::
 
   local video = VideoInput.new("http://localhost/file.nut", Nageru.VIDEO_FORMAT_BGRA)
 
-It can then be added to any chain like this::
+It can then be display on an input like usual::
 
-  local input = chain:add_video_input(video, false)
+  input:display(video)
 
-The second parameter specifies no deinterlacing. Note that interlaced video
-is currently not supported, not even with deinterlacing, so this parameter
-must always be false.
-
-You can use the same video object to create many different video inputs::
-  
-  local input1 = chain1:add_video_input(video, false)
-  local input2 = chain2:add_video_input(video, false)
+Note that interlaced video is currently not supported, not even with deinterlacing.
 
 Videos run in the correct frame rate and on their own timer (generally the
 system clock in the computer), and loop when they get to the end or whenever an
@@ -99,7 +93,7 @@ make the audio behave unpredictably; there are no attempts to do time
 stretching or change the pitch accordingly.
 
 Finally, if you want to forcibly abort the playing of a video,
-even one that is blocking on I/O, you can use (since Nageru 1.7.2)::
+even one that is blocking on I/O, you can use::
 
   video:disconnect()
 
@@ -107,9 +101,18 @@ This is particularly useful when dealing with network streams, as FFmpeg does no
 always properly detect if the connection has been lost. See :ref:`menus`
 for a way to expose such functionality to the operator.
 
+.. _subtitle-ingest:
+
+Ingesting subtitles
+-------------------
 
-Integration with CasparCG
--------------------------
+Video streams can contain separate subtitle tracks. This is particularly useful when using Nageru
+and Futatabi together (see :ref:`talkback`).
 
-This section has been removed, as since 1.7.0, Nageru has :doc:`native support for HTML5 inputs <html>`,
-obsoleting CasparCG integration.
+To get the last subtitle given before the current video frame, call
+“signals:get_last_subtitle(n)” from get_chain, where n is the signal number
+of your video signal. It will either contain nil, if there hasn't been
+a subtitle, or else the raw subtitle. Note that if the video frame and
+the subtitle occur on the exact same timestamp, and the video frame
+is muxed before the subtitle packet, the subtitle will not make it in time.
+(Futatabi puts the subtitle slightly ahead of the video frame to avoid this.)