From fad0b364945590728de14fea58b8b5f8a664000b Mon Sep 17 00:00:00 2001 From: Good Guy Date: Wed, 20 Dec 2023 11:48:16 -0700 Subject: [PATCH] add ScreenCapture notes on slow computers as provided by Andrew --- parts/Real-World.tex | 32 ++++++++++++++++++++++++++++++++ parts/Recording.tex | 21 ++++++++++++--------- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/parts/Real-World.tex b/parts/Real-World.tex index cb58ade..9183bc1 100644 --- a/parts/Real-World.tex +++ b/parts/Real-World.tex @@ -296,3 +296,35 @@ If you want to move the PiP to another position you have to go back to \textit{C Finally, you can animate the position of the PiP as well as the thickness and color of the frame throughout the video using the keyframes (see \nameref{cha:keyframes}). +\section{Using Screen Capture on slower CPUs}% +\label{sec:using_screencapture} + +Some results with different settings when working on slower CPUs follow: +\begin{itemize} +\item You can enable "loopback mode" in alsamixer, set xmms (with ALSA output) to play +(any alsa-enabled app should work), and then you can record both video and audio. If +your motherboard has no loopback switch for its integrated audio, you can use a +specialized .asoundrc file set up as an alsa loopback instead -- reference +{\small \url{https://bbs.archlinux.org/viewtopic.php?id=147852}} for usage. +\item If you leave recording settings to their default value of input frequency = 48000, you +may get strange one-core cpu overload in kernel space. This will show up in the color +orange if using the system monitor software, gkrellm (GNU Krell Monitors). So you most +likley will want to set the input frequency to 44100 and then everything should work +smoothly. +\item Attempting to record 1440*900*24bit*30fps with cpu (AMD FX 430) set to its lowest +frequency of 1.4Ghz, usually results in video being shorter than audio, so try slowing +video down to different values, such as 0.68 or so via speed curve, and then just clip +the few last silent frames. +\item If you set the CPU up for performance and if you can rev it up to 4Ghz, then audio and +video tend to be much more aligned in terms of their length. In one particular case with +generally good results, the codec was mjpeg444 / s16le into a mov container on tmpfs. +\item Specifically for screencapture on slow CPU, running short pre-session capture will be +useful to see if you can get same length tracks with given resolution/fps/codec. And if +not, either drop down recording fps or try to speed up encoder settings. +\item In trying other positioning methods, apart from software timings, such as check/uncheck +add/drop frames checkboxes and setting different number of audio samples ... , there seems +to be no algorithm/code to intellectually duplicate frames that are too late in their +encoding. And setting buffered frames in the device to absurdly high value like 50, was +also not working for screencapture driver and short recordings like 20-25 seconds long. +In conclusion, no amount of buffering will save you if you are chronically late. +\end{itemize} diff --git a/parts/Recording.tex b/parts/Recording.tex index f8dac13..8a67cc8 100644 --- a/parts/Recording.tex +++ b/parts/Recording.tex @@ -39,7 +39,7 @@ The media file will be written using the format and codec specified in the \text \label{sec:record_web_media_rt} \index{recording!web media in real time} -Below describes the necessary steps for recording freely available media from the internet for your own personal use. You have to be on a system using pulseaudio, such as ubuntu, fedora, centos. +Below describes the necessary steps for recording freely available media from the internet for your own personal use. You have to be on a system using pulseaudio, such as ubuntu, fedora, or centos. \begin{enumerate} \item Start \CGG{} and select \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Recording} From a terminal (with a wide text window) run: \texttt{pactl list}. You will see all of the audio sources and sinks on your system. Identify the source associated with the normal output your system uses. Example: \textit{Source $\#1$}. Locate the source which monitors your normal audio output. For example: \textit{front stereo}. @@ -129,10 +129,10 @@ The algorithm for determining how many frames to drop is as follows: \paragraph{Transport controls} these control buttons mimic the functions of tape recorders from the old days. \begin{itemize} - \item \textit{Reverse button/left arrow} --remnant from the past; does the same as the Start button really. - \item \textit{Red round button} --this is the Start button to start recording. - \item \textit{White square} --this is the Stop button to stop recording. - \item \textit{Red round button with white line} --start recording in single frame mode. The way this works is to just \textit{take a picture now, take a picture now\dots} The reason to use this mode is to get a still shot like you would with a camera. Sometimes input is continuous, for example looking at stars with a telescope -- surveillance goes on for hours, but you just want to take a picture now when something of significance interest comes up + \item \textit{Reverse button/left arrow} -- remnant from the past; does the same as the Start button really. + \item \textit{Red round button} -- this is the Start button to start recording. + \item \textit{White square} -- this is the Stop button to stop recording. + \item \textit{Red round button with white line} -- start recording in single frame mode. The way this works is to just \textit{take a picture now, take a picture now\dots} The reason to use this mode is to get a still shot like you would with a camera. Sometimes input is continuous, for example looking at stars with a telescope -- surveillance goes on for hours, but you just want to take a picture now when something of significance interest comes up \end{itemize} \paragraph{Cron} The batch recording watcher, cron, is either \textit{Idle} or \textit{Active}. When you start or stop batch recording at specific times, there is a cron thread watching timers to perform the timed action. Idle/Active indicates whether the timers are running. \paragraph{Position} this is a timebase which tracks frames/samples when obeying frame/sample rate. When a recording starts, it resets to 0. Timing is against audio (when available). Audio time and video time are based on position. @@ -143,10 +143,10 @@ You can select synchronization time source \textit{Positioning} in: \noindent Possible choices for time base are: \begin{itemize} - \item \textit{Presentation Timestamps} --use time code which is in both the audio and video media input stream. Uses these timestamps to sync the 2 streams. - \item \textit{Device Position} --this is the device hardware position of where you are. It is usually only on the audio side. - \item \textit{Sample Position} --Sample $\#$ or frame $\#$ divided by frame rate tells you where you are. - \item \textit{Software Timing} --usually used for things like YouTube; it just will \textit{take a picture now} \dots \textit{take a picture now} \dots over and over again until you tell it to stop. + \item \textit{Presentation Timestamps} -- use time code which is in both the audio and video media input stream. Uses these timestamps to sync the 2 streams. + \item \textit{Device Position} -- this is the device hardware position of where you are. It is usually only on the audio side. + \item \textit{Sample Position} -- Sample $\#$ or frame $\#$ divided by frame rate tells you where you are. + \item \textit{Software Timing} -- usually used for things like YouTube; it just will \textit{take a picture now} \dots \textit{take a picture now} \dots over and over again until you tell it to stop. \end{itemize} Positioning \& Timing needs more detailed explanation for complete understanding and application. The overall goal is to maintain media stream timeline synchronization. The reason for providing different \textit{Positioning} options is that different input media may have different timebase standards. Additionally, the input may be damaged. Damaged data can skew the timeline during presentation. The timebase standards make it possible to correctly resynchronize the media presentation to the original time position. For example, the transport layer may have timestamps provided in it. These timestamps record \textit{audio time} and \textit{video time} and are called \textit{presentation timestamps}. @@ -179,6 +179,9 @@ One other noted new feature is a new choice for recording - \texttt{V4L2 MPEG}. \label{fig:recording02} \end{figure} +Some notes for usage on slower CPUs are outlined at appendix \nameref{sec:using_screencapture} +as discovered in actual usage. + \section{Digital Video Broadcasting (DVB)}% \label{sec:digital_video_broadcasting} \index{capture!digital broadcasting} -- 2.26.2