When I am extracting the subtitles from video files within a folder with ffmpeg, sometimes the path is cut and sometimes not and I don't know why. I'll be grateful if I can get some answers. Here is an example :  Here is my code : #!/bin/bash   DIR=&quot;/volume1/homes/Bruno/test&quot;  # Get all the MKV files in this dir and its subdirs  find &quot;$DIR&quot; -type f -name '*.mkv' | while read filename ; do  # Delete the &quot;.mkv&quot; newfile=&quot;$(echo ${filename} |sed -e 's/.mkv//')&quot; ;  ffmpeg -i &quot;$newfile.mkv&quot; &quot;$newfile.ass&quot;   done
I am looping through a text file, using 'while read'. I read three variables from each line - two filenames and a decimal number. I know that this works in a vanilla setup (loop, read line, echo line, extract variables, nothing else), because I have tested it on my input file.  I am getting an odd result, though, once I add in the meat of my routine - which is a call to ffmpeg to merge the audio and video streams represented by the filenames. Successive 'read' operations omit leading characters from the line. I read  that calls for 'read' input within a 'while read' loop can cause problems, and wonder if the ffmpeg call is doing something that confuses bash, but this seems unlikely and bizarre! NB: I don't really understand the ffmpeg call - I got it from an answer to another question.  Any help would be appreciated!  The first 'read' works as expected (and the ffmpeg command completes):  LINE  1 vidsNeedingSound/448£generic@06_10_16-09_30_47.mp4 soundToAdd/448£generic@06_10_16-12_11_54.wav 6.988354 V: vidsNeedingSound/448£generic@06_10_16-09_30_47.mp4   A: soundToAdd/448£generic@06_10_16-12_11_54.wav   D: 6.988354   The second 'read' loses 36 characters from the beginning of the line (and the ffmpeg command fails because the file represented by the variable V which takes the first item of the line doesn't point at a file):  LINE  2 6-09_30_47.mp4 soundToAdd/452£generic@06_10_16-12_11_54.wav 9.64663 V: 6-09_30_47.mp4   A: soundToAdd/452...   The third 'read' works as expected (and the ffmpeg command completes):  LINE  3 vidsNeedingSound/452£left@06_10_16-09_30_47.mp4 soundToAdd/452£left@06_10_16-12_11_54.wav 9.862118 V: vidsNeedingSound/452£left@06_10_16-09_30_47.mp4   A: soundToAdd/452...   The fourth 'read' loses 37 character (one more than the last fail) from the beginning of the line (and the ffmpeg command fails):  LINE  4 09_30_47.mp4 soundToAdd/452£right@06_10_16-12_11_54.wav 9.431392 V: 09_30_47.mp4   A: soundToAdd/452....   That's the pattern. When not preceded by a successful call to ffmpeg, the 'read' works as expected. After each successive successful ffmpeg call, characters are omitted from the beginning of the line: 36 characters to begin with, then 37, 38, 39...  The clincher is that when ffmpeg fails after a 'successful' read (due to another problem), the following 'read' works as expected.  CONCLUSION: a successful ffmpeg call results in a read fail on the next iteration through the loop.  Why does this happen, and how can I stop it?  Here's my code: ...  # Loop through lines in the merge file IT_COUNT=1 while read MERGE_LINE                do              echo "LINE " $IT_COUNT     ((IT_COUNT+=1))     echo $MERGE_LINE   # testing use     read VID_FILE AUD_FILE DURATION &lt;&lt;&lt; "$MERGE_LINE" # Get the data from each line     echo "V: $VID_FILE   A: $AUD_FILE   D: $DURATION"         # testing use ....     # add audio to video     ffmpeg -i $VID_FILE -i $AUD_FILE -filter_complex "aevalsrc=0:d=$AUD_SHIFT[s1];[s1][1:a]concat=n=2:v=0:a=1[aout]" -c:v copy -map 0:v -map [aout] $FILE_OUT -hide_banner  done &lt;$MERGE_FILE     Thanks for looking!
How can I get fireworks? What are the requirements for making fireworks appear at the end of a level in the original Super Mario Bros.? I am learning P&amp;S's Introduction of quantum field theory. My teacher said that if the mass of neutrino is exactly 0, then we should not observe any right-handed neutrinos and left-handed anti-neutrinos according to Weyl's theory. It is because $$ \left( i\gamma^\mu \partial_\mu - m \right) \psi = \left( \begin{array}{cc} -m &amp;  i\left(\partial_0 + \vec\sigma \cdot \vec\nabla\right) \\ i\left(\partial_0 - \vec\sigma \cdot \vec\nabla\right) &amp; -m \end{array} \right) \left( \begin{array}{c} \psi_L \\ \psi_R \end{array} \right) =0. $$  If we set m=0, then we will have:  \begin{align} i\left(\partial_0 - \vec\sigma \cdot \vec\nabla\right) \psi_L &amp;= 0; \\ i\left(\partial_0 + \vec\sigma \cdot \vec\nabla\right) \psi_R &amp;= 0. \end{align}  And if these formulas can describe neutrinos we must conclude that there are two types of neutrinos.  My confusions are:   It is known that the mass of neutrino is not 0, therefore there are chances (depending on the mass) to find right-handed neutrinos and left-handed anti-neutrinos. But we don't. If I accept that there are only these two types of neutrinos (right-handed anti-neutrinos and left-handed neutrinos), this property of neutrino causes the parity violation, so parity violation must relate to angular momentum and therefore spinor space. Am I write? Are there any reasons why neutrino is so weird that is has mass but still has helicity + Or - 1. This goes against with what I have learned that only when a particle  moves at the speed of light can its spin aligned with its momentum. Why does TeX prefer an overfull box to hyphenating here? DC Motor as a Generator Voltage and Current The three lengths \textwidth, \linewidth and \hsize seem to all hold the width of the current line. At least I never saw some real difference between \textwidth and \linewidth in my code. Both seem to be identical even when changed, e.g. by a minipage environment.  Could someone give me an elaborate explanation of the differences between these lengths? I like to understand them in detail. I know that the first two are from LaTeX and the latter one from plainTeX.  There is also \columnwidth which seems to be identical to \linewidth or \textwidth in one-column mode, right? Except when the line is reduced by a minipage or quote etc. environment. Missing Schengen entrance stamp Last night I took a night train from Romania to Hungary. I shared a compartment with another American backpacker (and others.) The border crossing on the Romanian side was normal -- all of our passports were stamped and the border officer recorded our data in his notepad. On the Hungarian side, some sort of commotion broke out further down the train car while we were being processed. The officer who was scanning and stamping our passports left and never came back. As a result, the other American backpacker never had her passport scanned or stamped.  What sort of difficulties might she run into since her passport has not been recorded as entering the schengen zone, nor does she have an extra stamp? What might get options be now, from within Schengen, to get her entrance recorded?  (When I say "scanned", the officers had hand-held devices that read the passport biometrics and I assume, recorded some sort of data somewhere.) Possible Duplicate:          I received two answers to a question I asked. One solution suggested I do things in a completely different manner than I have been. Another acknowledged that the first solution was correct but went on to explain how to do what I was asking.  Should I accept the first answer because it provides the better way of doing things or should I accept the second one because it answers the precise question that was asked? Why are POSIX Find Parameters Different from Other Program styles? Show that $F\subset Y$ is closed in $Y$ iff $F=Y\;\cap\;H$ where $H\subset X$ is closed in $X$. I have the following problem:      Let $(X,\tau)$ be a topological space and $(Y,\tau_y)$ be its    subspace, that is $Y\subset X$ and $\tau_y=\{\;A\;\cap\;Y\mid  A\in\tau\;\}$. Let also $F\subset Y$ and $H\subset X$, where $H$ is    closed in $X$. Show that $F=Y\;\cap\;H$ if and only if $F$ is closed   in $Y$.   I solved this problem by assuming that if $F$ is closed then $F=Y\;\cap\;H$, where $H$ is closed in $X$, but I got stuck proving this in the other direction, that is showing that if $F=Y\;\cap\;H$ then $F$ is closed in $Y$.  I tried to do something like this:   Assumption: $F=Y\;\cap\;H$, where $H$ is closed in $X$. If $H$ is closed in $X$ then $X\;\setminus\;H$ is open in $X$ and then $X\;\setminus\;H \in \tau$ which means that $B = (X\;\setminus\;H)\;\cap\;Y\in \tau_y$.  How should I proceed now? Should I investigate the set $B$ now more or what? Expanding a parent  to the height of its children I have a page structure similar to this:  &lt;body&gt;   &lt;div id="parent"&gt;     &lt;div id="childRightCol"&gt;       /*Content*/     &lt;/div&gt;     &lt;div id="childLeftCol"&gt;       /*Content*/     &lt;/div&gt;   &lt;/div&gt; &lt;/body&gt;   I would like for the parent div to expand in height when the inner div's height increases.  Edit: One problem is that if the width of the child content expands past the width of the browser window, my current CSS puts a horizontal scrollbar on the parent div.  I would like the scrollbar to be at the page level. Currently my parent div is set to overflow: auto;  Can you please help me with the CSS for this? Reason for the discreteness arising in quantum mechanics? What is the most essential reason that actually leads to the quantization. I am reading the book on quantum mechanics by Griffiths. The quanta in the infinite potential well for e.g. arise due to the boundary conditions, and the quanta in harmonic oscillator arise due to the commutation relations of the ladder operators, which give energy eigenvalues differing by a multiple of $\hbar$. But what actually is the reason for the discreteness in quantum theory? Which postulate is responsible for that. I tried going backwards, but for me it somehow seems to come magically out of the mathematics. How can I know when my computer running Windows 7 was last restarted?   I prefer a solution that doesn't involve searching the event log, but something like wmic or maybe cmd commands. Is accessing a variable in C# an atomic operation? I've been raised to believe that if multiple threads can access a variable, then all reads from and writes to that variable must be protected by synchronization code, such as a "lock" statement, because the processor might switch to another thread halfway through a write.  However, I was looking through System.Web.Security.Membership using Reflector and found code like this:  public static class Membership {     private static bool s_Initialized = false;     private static object s_lock = new object();     private static MembershipProvider s_Provider;      public static MembershipProvider Provider     {         get         {             Initialize();             return s_Provider;         }     }      private static void Initialize()     {         if (s_Initialized)             return;          lock(s_lock)         {             if (s_Initialized)                 return;              // Perform initialization...             s_Initialized = true;         }     } }   Why is the s_Initialized field read outside of the lock? Couldn't another thread be trying to write to it at the same time? Are reads and writes of variables atomic? When I search for similar questions that I am going to ask, I usually can't find anything through the search box on Stack Overflow. But when I enter my question on the &quot;Ask Question&quot; page, the questions suggested through the &quot;Questions with similar titles&quot; box are usually relevant. Do you experience the same thing? Stripped out bottom bracket Sometimes we read books rather quickly and don't give them much (or any) thought, so the action 'reading' does not necessarily imply that we have given enough thoughts to any book we read.   Is there a word that describes reading a book with great care; usually but necessarily slowly over a long period of time. Profile tab hyperlink should match name change How to tell if a set of vectors spans a space? I want to know if the set $\{(1, 1, 1), (3, 2, 1), (1, 1, 0), (1, 0, 0)\}$ spans $\mathbb{R}^3$. I know that if it spans $\mathbb{R}^3$, then for any $x, y, z, \in \mathbb{R}$, there exist $c_1, c_2, c_3, c_4$ such that $(x, y, z) = c_1(1, 1, 1) + c_2(3, 2, 1) + c_3(1, 1, 0) + c_4(1, 0, 0)$.  I've looked around the internet, but all the answers I found involve setting up a matrix and finding the determinant, and I can't do that here because my matrix isn't square. What am I missing here? What's the name of the move where the player swaps King and Rook/Castle in Chess? Why is this move important? I'm a chess beginner, and I was wondering: why was this movement introduced to chess, and why is it important to the game? Realtime audio processing using Dynamic