capture from camera (macOS) and pass video to ffplay

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

capture from camera (macOS) and pass video to ffplay

Peter Gusev
Hi there! I need to capture video from a camera (macOS) and then pass it
through a file pipe to ffplay for displaying it. Can't figure out how to
specify ffmpeg's output pixel format. When passing -pix_fmt argb ffmpeg
says that the format is incompatible with the input device (?). I expect
ffmpeg to transcode whatever incoming pixel format is to the one I
specified so that I can have ffplay read from file pipe like this "ffplay
-f rawvideo -vcodec rawvideo -s 320x180 -i file_pipe".
Also, can ffmpeg write to a file pipe (not the pipe:
<http://ffmpeg.org/ffmpeg-protocols.html#pipe> functionality)?

Thanks!

--
Peter Gusev <https://www.linkedin.com/in/peter-gusev-8135441a/>
*[hidden email] <[hidden email]>*


*+1 213 587-27-48*


*Research Scholar @ REMAP UCLA <http://www.remap.ucla.edu/home/about>Video
streaming/ICN networks/Creative Coding/Interactive Media*
*dj peetonn <https://soundcloud.com/peter-gusev>*
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: capture from camera (macOS) and pass video to ffplay

Carl Eugen Hoyos-2
2018-09-12 1:25 GMT+02:00, Peter Gusev <[hidden email]>:
> Hi there! I need to capture video from a camera (macOS) and then pass it
> through a file pipe to ffplay for displaying it. Can't figure out how to
> specify ffmpeg's output pixel format. When passing -pix_fmt argb ffmpeg
> says that the format is incompatible with the input device (?).

Command line and complete, uncut console output missing.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: capture from camera (macOS) and pass video to ffplay

Peter Gusev
Hi! well I'm sure the ones I tried are incorrect as I'm not familiar with
ffmpeg much. But here's one of them:

ffmpeg -f avfoundation -framerate 30 -i "0" -f rawvideo -pix_fmt argb - |
ffplay -f rawvideo -s1280x720 -pix_fmt argb -i -
ffmpeg version 3.4ffplay version 3.4 Copyright © 2000-2017 the FFmpeg
developers Copyright © 2003-2017 the FFmpeg developers

  built with Apple LLVM version 9.0.0 (clang-900.0.38)
  built with Apple LLVM version 9.0.0 (clang-900.0.38)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared
--enable-pthreads --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl
--enable-ffplay --enable-libmp3lame --enable-libx264 --enable-libxvid
--enable-opencl --enable-videotoolbox --disable-lzma
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared
--enable-pthreads --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl
--enable-ffplay --enable-libmp3lame --enable-libx264 --enable-libxvid
--enable-opencl --enable-videotoolbox --disable-lzma
  libavutil      55. 78.100 / 55. 78.100
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
  libpostproc    54.  7.100 / 54.  7.100
Failed to set value '-pix_fmt' for option 's1280x720': Option not found
2018-09-12 09:06:43.611 ffmpeg[79783:2432910] Error loading
/Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn:
dlopen(/Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn,
262): no suitable image found.  Did find:
/Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn:
mach-o, but wrong architecture
/Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn:
mach-o, but wrong architecture
2018-09-12 09:06:43.611 ffmpeg[79783:2432910] Cannot find function pointer
New_SHP_PlugIn for factory 834FC054-C1CC-11D6-BD01-00039315CD46 in
CFBundle/CFPlugIn 0x7fbbac7080b0
</Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin> (bundle, not
loaded)
[avfoundation @ 0x7fbbad000000] Selected pixel format (yuv420p) is not
supported by the input device.
[avfoundation @ 0x7fbbad000000] Supported pixel formats:
[avfoundation @ 0x7fbbad000000]   uyvy422
[avfoundation @ 0x7fbbad000000]   yuyv422
[avfoundation @ 0x7fbbad000000]   nv12
[avfoundation @ 0x7fbbad000000]   0rgb
[avfoundation @ 0x7fbbad000000]   bgr0
[avfoundation @ 0x7fbbad000000] Overriding selected pixel format to use
uyvy422 instead.
Input #0, avfoundation, from '0':
  Duration: N/A, start: 175.304500, bitrate: N/A
    Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 1280x720, 30
tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, rawvideo, to 'pipe:':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0: Video: rawvideo (ARGB / 0x42475241), argb, 1280x720,
q=2-31, 884736 kb/s, 30 fps, 30 tbn, 30 tbc
    Metadata:
      encoder         : Lavc57.107.100 rawvideo

thanks!

On Wed, 12 Sep 2018 at 06:54, Carl Eugen Hoyos <[hidden email]> wrote:

> 2018-09-12 1:25 GMT+02:00, Peter Gusev <[hidden email]>:
> > Hi there! I need to capture video from a camera (macOS) and then pass it
> > through a file pipe to ffplay for displaying it. Can't figure out how to
> > specify ffmpeg's output pixel format. When passing -pix_fmt argb ffmpeg
> > says that the format is incompatible with the input device (?).
>
> Command line and complete, uncut console output missing.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".



--
Peter Gusev <https://www.linkedin.com/in/peter-gusev-8135441a/>
*[hidden email] <[hidden email]>*


*+1 213 587-27-48*


*Research Scholar @ REMAP UCLA <http://www.remap.ucla.edu/home/about>Video
streaming/ICN networks/Creative Coding/Interactive Media*
*dj peetonn <https://soundcloud.com/peter-gusev>*
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: capture from camera (macOS) and pass video to ffplay

Kieran O Leary
Hi

On Wed, 12 Sep 2018, 17:09 Peter Gusev, <[hidden email]> wrote:

> Hi! well I'm sure the ones I tried are incorrect as I'm not familiar with
> ffmpeg much. But here's one of them:
>
> ffmpeg -f avfoundation -framerate 30 -i "0" -f rawvideo -pix_fmt argb - |
> ffplay -f rawvideo -s1280x720 -pix_fmt argb -i -
>

Put a space between -s and 1280x720

ffmpeg version 3.4ffplay version 3.4 Copyright © 2000-2017 the FFmpeg

> developers Copyright © 2003-2017 the FFmpeg developers
>
>   built with Apple LLVM version 9.0.0 (clang-900.0.38)
>   built with Apple LLVM version 9.0.0 (clang-900.0.38)
>   configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared
> --enable-pthreads --enable-version3 --enable-hardcoded-tables
> --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl
> --enable-ffplay --enable-libmp3lame --enable-libx264 --enable-libxvid
> --enable-opencl --enable-videotoolbox --disable-lzma
>   configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared
> --enable-pthreads --enable-version3 --enable-hardcoded-tables
> --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl
> --enable-ffplay --enable-libmp3lame --enable-libx264 --enable-libxvid
> --enable-opencl --enable-videotoolbox --disable-lzma
>   libavutil      55. 78.100 / 55. 78.100
>   libavutil      55. 78.100 / 55. 78.100
>   libavcodec     57.107.100 / 57.107.100
>   libavcodec     57.107.100 / 57.107.100
>   libavformat    57. 83.100 / 57. 83.100
>   libavformat    57. 83.100 / 57. 83.100
>   libavdevice    57. 10.100 / 57. 10.100
>   libavdevice    57. 10.100 / 57. 10.100
>   libavfilter     6.107.100 /  6.107.100
>   libavfilter     6.107.100 /  6.107.100
>   libavresample   3.  7.  0 /  3.  7.  0
>   libavresample   3.  7.  0 /  3.  7.  0
>   libswscale      4.  8.100 /  4.  8.100
>   libswscale      4.  8.100 /  4.  8.100
>   libswresample   2.  9.100 /  2.  9.100
>   libswresample   2.  9.100 /  2.  9.100
>   libpostproc    54.  7.100 / 54.  7.100
>   libpostproc    54.  7.100 / 54.  7.100
> Failed to set value '-pix_fmt' for option 's1280x720': Option not found
>

The lack of a space is causing this error.

Best,

Kieran
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: capture from camera (macOS) and pass video to ffplay

Peter Gusev
this actually helped! thanks a lot!

On Wed, 12 Sep 2018 at 09:37, Kieran O Leary <[hidden email]>
wrote:

> Hi
>
> On Wed, 12 Sep 2018, 17:09 Peter Gusev, <[hidden email]> wrote:
>
> > Hi! well I'm sure the ones I tried are incorrect as I'm not familiar with
> > ffmpeg much. But here's one of them:
> >
> > ffmpeg -f avfoundation -framerate 30 -i "0" -f rawvideo -pix_fmt argb - |
> > ffplay -f rawvideo -s1280x720 -pix_fmt argb -i -
> >
>
> Put a space between -s and 1280x720
>
> ffmpeg version 3.4ffplay version 3.4 Copyright © 2000-2017 the FFmpeg
> > developers Copyright © 2003-2017 the FFmpeg developers
> >
> >   built with Apple LLVM version 9.0.0 (clang-900.0.38)
> >   built with Apple LLVM version 9.0.0 (clang-900.0.38)
> >   configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared
> > --enable-pthreads --enable-version3 --enable-hardcoded-tables
> > --enable-avresample --cc=clang --host-cflags= --host-ldflags=
> --enable-gpl
> > --enable-ffplay --enable-libmp3lame --enable-libx264 --enable-libxvid
> > --enable-opencl --enable-videotoolbox --disable-lzma
> >   configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared
> > --enable-pthreads --enable-version3 --enable-hardcoded-tables
> > --enable-avresample --cc=clang --host-cflags= --host-ldflags=
> --enable-gpl
> > --enable-ffplay --enable-libmp3lame --enable-libx264 --enable-libxvid
> > --enable-opencl --enable-videotoolbox --disable-lzma
> >   libavutil      55. 78.100 / 55. 78.100
> >   libavutil      55. 78.100 / 55. 78.100
> >   libavcodec     57.107.100 / 57.107.100
> >   libavcodec     57.107.100 / 57.107.100
> >   libavformat    57. 83.100 / 57. 83.100
> >   libavformat    57. 83.100 / 57. 83.100
> >   libavdevice    57. 10.100 / 57. 10.100
> >   libavdevice    57. 10.100 / 57. 10.100
> >   libavfilter     6.107.100 /  6.107.100
> >   libavfilter     6.107.100 /  6.107.100
> >   libavresample   3.  7.  0 /  3.  7.  0
> >   libavresample   3.  7.  0 /  3.  7.  0
> >   libswscale      4.  8.100 /  4.  8.100
> >   libswscale      4.  8.100 /  4.  8.100
> >   libswresample   2.  9.100 /  2.  9.100
> >   libswresample   2.  9.100 /  2.  9.100
> >   libpostproc    54.  7.100 / 54.  7.100
> >   libpostproc    54.  7.100 / 54.  7.100
> > Failed to set value '-pix_fmt' for option 's1280x720': Option not found
> >
>
> The lack of a space is causing this error.
>
> Best,
>
> Kieran
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".



--
Peter Gusev <https://www.linkedin.com/in/peter-gusev-8135441a/>
*[hidden email] <[hidden email]>*


*+1 213 587-27-48*


*Research Scholar @ REMAP UCLA <http://www.remap.ucla.edu/home/about>Video
streaming/ICN networks/Creative Coding/Interactive Media*
*dj peetonn <https://soundcloud.com/peter-gusev>*
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: capture from camera (macOS) and pass video to ffplay

Peter Gusev
relevant question - is there a way to dump argb frames to a file pipe (not
stdout)?

On Wed, 12 Sep 2018 at 10:52, Peter Gusev <[hidden email]> wrote:

> this actually helped! thanks a lot!
>
> On Wed, 12 Sep 2018 at 09:37, Kieran O Leary <[hidden email]>
> wrote:
>
>> Hi
>>
>> On Wed, 12 Sep 2018, 17:09 Peter Gusev, <[hidden email]> wrote:
>>
>> > Hi! well I'm sure the ones I tried are incorrect as I'm not familiar
>> with
>> > ffmpeg much. But here's one of them:
>> >
>> > ffmpeg -f avfoundation -framerate 30 -i "0" -f rawvideo -pix_fmt argb -
>> |
>> > ffplay -f rawvideo -s1280x720 -pix_fmt argb -i -
>> >
>>
>> Put a space between -s and 1280x720
>>
>> ffmpeg version 3.4ffplay version 3.4 Copyright © 2000-2017 the FFmpeg
>> > developers Copyright © 2003-2017 the FFmpeg developers
>> >
>> >   built with Apple LLVM version 9.0.0 (clang-900.0.38)
>> >   built with Apple LLVM version 9.0.0 (clang-900.0.38)
>> >   configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared
>> > --enable-pthreads --enable-version3 --enable-hardcoded-tables
>> > --enable-avresample --cc=clang --host-cflags= --host-ldflags=
>> --enable-gpl
>> > --enable-ffplay --enable-libmp3lame --enable-libx264 --enable-libxvid
>> > --enable-opencl --enable-videotoolbox --disable-lzma
>> >   configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared
>> > --enable-pthreads --enable-version3 --enable-hardcoded-tables
>> > --enable-avresample --cc=clang --host-cflags= --host-ldflags=
>> --enable-gpl
>> > --enable-ffplay --enable-libmp3lame --enable-libx264 --enable-libxvid
>> > --enable-opencl --enable-videotoolbox --disable-lzma
>> >   libavutil      55. 78.100 / 55. 78.100
>> >   libavutil      55. 78.100 / 55. 78.100
>> >   libavcodec     57.107.100 / 57.107.100
>> >   libavcodec     57.107.100 / 57.107.100
>> >   libavformat    57. 83.100 / 57. 83.100
>> >   libavformat    57. 83.100 / 57. 83.100
>> >   libavdevice    57. 10.100 / 57. 10.100
>> >   libavdevice    57. 10.100 / 57. 10.100
>> >   libavfilter     6.107.100 /  6.107.100
>> >   libavfilter     6.107.100 /  6.107.100
>> >   libavresample   3.  7.  0 /  3.  7.  0
>> >   libavresample   3.  7.  0 /  3.  7.  0
>> >   libswscale      4.  8.100 /  4.  8.100
>> >   libswscale      4.  8.100 /  4.  8.100
>> >   libswresample   2.  9.100 /  2.  9.100
>> >   libswresample   2.  9.100 /  2.  9.100
>> >   libpostproc    54.  7.100 / 54.  7.100
>> >   libpostproc    54.  7.100 / 54.  7.100
>> > Failed to set value '-pix_fmt' for option 's1280x720': Option not found
>> >
>>
>> The lack of a space is causing this error.
>>
>> Best,
>>
>> Kieran
>> _______________________________________________
>> ffmpeg-user mailing list
>> [hidden email]
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> [hidden email] with subject "unsubscribe".
>
>
>
> --
> Peter Gusev <https://www.linkedin.com/in/peter-gusev-8135441a/>
> *[hidden email] <[hidden email]>*
>
>
> *+1 213 587-27-48*
>
>
> *Research Scholar @ REMAP UCLA <http://www.remap.ucla.edu/home/about>Video
> streaming/ICN networks/Creative Coding/Interactive Media*
> *dj peetonn <https://soundcloud.com/peter-gusev>*
>


--
Peter Gusev <https://www.linkedin.com/in/peter-gusev-8135441a/>
*[hidden email] <[hidden email]>*


*+1 213 587-27-48*


*Research Scholar @ REMAP UCLA <http://www.remap.ucla.edu/home/about>Video
streaming/ICN networks/Creative Coding/Interactive Media*
*dj peetonn <https://soundcloud.com/peter-gusev>*
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: capture from camera (macOS) and pass video to ffplay

Moritz Barsnick
On Wed, Sep 12, 2018 at 11:10:19 -0700, Peter Gusev wrote:
> relevant question - is there a way to dump argb frames to a file pipe (not
> stdout)?

Is a "file pipe" what Unix calls a "fifo" or "named pipe"? Sure, just
replace "-" or "pipe:" with the name of the named pipe.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: capture from camera (macOS) and pass video to ffplay

Peter Gusev
thanks!

On Wed, 12 Sep 2018 at 11:48, Moritz Barsnick <[hidden email]> wrote:

> On Wed, Sep 12, 2018 at 11:10:19 -0700, Peter Gusev wrote:
> > relevant question - is there a way to dump argb frames to a file pipe
> (not
> > stdout)?
>
> Is a "file pipe" what Unix calls a "fifo" or "named pipe"? Sure, just
> replace "-" or "pipe:" with the name of the named pipe.
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".



--
Peter Gusev <https://www.linkedin.com/in/peter-gusev-8135441a/>
*[hidden email] <[hidden email]>*


*+1 213 587-27-48*


*Research Scholar @ REMAP UCLA <http://www.remap.ucla.edu/home/about>Video
streaming/ICN networks/Creative Coding/Interactive Media*
*dj peetonn <https://soundcloud.com/peter-gusev>*
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".