[FFmpeg-user] When capturing rawvideo from camera (avfoundation), ffmpeg adds extra 32 bytes for each frame.

Peter Gusev gpeetonn at gmail.com
Fri Sep 21 18:25:49 EEST 2018


The discussion on StackOverflow
<https://stackoverflow.com/questions/52390694/video-moves-sideways-when-captured-raw-from-camera-and-piped-into-ffplay?noredirect=1#comment91816164_52390694>
shed
some light on what's going on and provided one possible solution.
I one uses `-vsync 2` or `-vsync vfr` option, the frame size would be
correct:

$ ffmpeg -f avfoundation -pixel_format 0rgb -framerate 25 -video_size
1280x720 -i "0" -map 0:v -vsync vfr -f rawvideo -vframes 1 /tmp/frame.0rgb
$ wc -c /tmp/frame.0rgb
3686400 /tmp/frame.0rgb

The possible explanation, I believe, is this: "*avfoundation is reporting
the framerate of the source as 1000k tbr i.e. a million, and for constant
frame rate muxers, ffmpeg will duplicate frames to get that rate if input
rate is lacking. -vsync vfr or 2 disables that behaviour. *".
So, is it a muxer's fault? And should we expect the original command to
yield correct frame sizes?

Thanks,

On Wed, 19 Sep 2018 at 14:50, Peter <gpeetonn at gmail.com> wrote:

> Yes,
> it is default internal camera.
>
>
> --
> Peter Gusev
> *gpeetonn at gmail.com <gpeetonn at gmail.com>*
> *+1 213 5872748 <+1%20213%205872748>*
> *peetonn_ (skype)*
>
> On Sep 19, 2018, at 2:31 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>
> 2018-09-19 15:33 GMT+02:00, Peter Gusev <gpeetonn at gmail.com>:
>
> As a part of figuring out the problem I have with ffplay
>
> <
> https://stackoverflow.com/questions/52390694/video-moves-sideways-when-captured-raw-from-camera-and-piped-into-ffplay/52399554#52399554
> >,
>
> I noticed, that ffmpeg adds 32 bytes to raw 0rgb frames when capturing from
>
> a camera (macOS 10.12):
>
>
> Is this an internal camera?
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>
>

-- 
Peter Gusev <https://www.linkedin.com/in/peter-gusev-8135441a/>
*gpeetonn at gmail.com <gpeetonn at gmail.com>*


*+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>*


More information about the ffmpeg-user mailing list