[FFmpeg-user] USB Camera ffplay real-time and save to file

Moritz Barsnick barsnick at gmx.net
Fri Sep 11 16:13:55 EEST 2020


On Fri, Sep 11, 2020 at 05:43:09 -0600, Simon Roberts wrote:
> On Fri, Sep 11, 2020 at 1:18 AM Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> > > Am 09.09.2020 um 23:07 schrieb Hans Carlson <forbyta at gmx.com>:
> > > I have a cheap USB pipe inspection camera and I want to see the output
> > (via ffplay) real-time, but also record (via ffmpeg)
> >
> > Use ffmpeg instead of ffplay to show the stream, this should avoid the
> > lagging you saw.
>
> Carl, could you add a hint as to what option achieves this? I had no clue
> this was possible, despite--so I thought--spending lots of time looking
> through docs.

ffmpeg has several display output muxers/devices. The most common one
(saying it works well, and that on many platforms) is "sdl" a.k.a.
"sdl". Have ffmpeg create two outputs:

$ ffmpeg -i INPUT -c whatever OUTPUTFILE -c copy -f sdl :0

(You may need to drop the copy codec if sdl cannot handle your input or
it isn't raw, and/or at least adjust the pixel format to one which sdl
handles - but it will report that in an error message, I believe.)

Cheers,
Moritz


More information about the ffmpeg-user mailing list