2

My laptop runs Xubuntu 14.04 LTS. I'm composing a score for a silent film, and I'm trying to "Mickey Mouse" it (synchronize notes to the action). I can tweak the silent film's editing slightly to line up events with beats of the music. The tool for making the film renders to a lossless intermediate (AVI with Huffyuv) at about 1 GB per two minutes, which I can encode to a compressed format (WebM with VP8 or MPEG-4 with AVC).

If I've already encoded the video, I normally use this command line to combine the compressed video with the score, based on avconv replace audio:

avconv -y -i the_video.mp4 -i the_audio.wav -map 0:0 -map 1:0 -c:v copy -c:a libvo_aacenc -ac 1 -ab 48000 -t 120 result.mp4
avplay result.mp4

Because the lossless intermediate is gigabytes in size, I don't want to use -c:v copy to copy those gigabytes every time I want to check my changes. Nor do I want to encode every time because my laptop's CPU (Atom N450, 1 core 2 threads) is too slow to encode full-size video in real time. But when I try to use a similar command line to play instead of encoding:

avplay -i the_video.avi -i sound/sticks.wav -map 0:0 -map 1:0

I get the following error message:

avplay version 9.18-6:9.18-0ubuntu0.14.04.1, Copyright (c) 2003-2014 the Libav developers
  built on Mar 16 2015 13:20:58 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
Argument 'sound/sticks.wav' provided as input filename, but 'hyf_enc.mp4' was already specified.

Google "avplay" "was already specified" produced only source code results, not workarounds. I tried "ffplay" "was already specified" as well, but most pages with questions about that were related to overlaying a PNG, not muxing.

How should I play one file's audio and another file's video, with seeking linked between the two, without having to remux them to a file on the disk? Would a player in Ubuntu's repositories other than avplay work well for this? Or should I just shrink the lossless intermediate in order to make remuxing practical?

1 Answers1

0

My knowledge is based on the ffmpeg and ffplay tools which I understand to be replaced by avconv and avplay on Ubuntu which are supposed to be functionally equivalent (let's not debate on how far that functional equivalence goes).

I don't think the play tools accept multiple inputs. You can stream via a pipe from ffmpeg (er, avconv) into ffplay (avplay). Try this:

$ avconv -i the_video.avi -i sound/sticks.wav -map 0:0 -map 1:0 - | avplay -

The above is a guess based on your question but it's based on my own real example which I've pasted below just as a reference (yes I am using the ffmpeg and ffplay tools) :

ffmpeg -f alsa -i hw:0,2 -f v4l2 -i /dev/video0 -f avi pipe:1 | ffplay -
starfry
  • 491
  • 1
  • 4
  • 7