[FFmpeg-user] Comments about audio sync invited

Oliver Fromme oliver at fromme.com
Thu Jul 11 08:49:41 CEST 2013


James Linder wrote:
 > 
 > On 10/07/2013, at 10:19 PM, Nicolas George wrote:
 > 
 > > Le duodi 22 messidor, an CCXXI, James Linder a écrit :
 > > > [dvr] /home/dvr [132]% ./ffmpeg -f pulse -i default -f v4l2 -i /dev/video0 -vtag divx -s 384x288 -r pal -q:v 5 -f tee  -map 0:a -map 1:v Wed.avi | cat >Wed1.avi
 > > 
 > > The tee muxer in this command line does not make any sense. The cat is
 > > completely useless too. 
 > [...]
 > Why is my cat completely useless?

Because the following two commands produce the same result:

$ ffmpeg ... | cat > foo.avi
$ ffmpeg ... > foo.avi

The difference is that the first has an additional overhead
of one execve() (probably insignificant in this case) and
of one pipe and one process that have to handle the output
data.  The latter might be significant because it usually
involves at least two in-memory copy operations, depending
on the implementations of pipes and cat in your operating
system.

The above is a typical "useless use of cat".  It should be
avoided.

If everybody checked his/her shell scripts for useless uses
of cat and removed them, we could probably save a few
megawatts of electrical power per day that would otherwise
be wasted.  ;-)

Best regards
   Oliver


-- 
``We are all but compressed light'' (Albert Einstein)


More information about the ffmpeg-user mailing list