ropensci / av

Working with Video in R
https://docs.ropensci.org/av
Other
92 stars 10 forks source link

Issue with using vfilter argument in av_encode_video #35

Open cateness opened 3 years ago

cateness commented 3 years ago

Hi! New I'm new to Github and working with video, but appreciate this easy to use package.

I'm having an issue using the vfilter argument in the av_encode_video function. It might be an issue with my code, not the package, but I wanted to ask just in case.

I'm trying to use vfilter to change the scaling on the output video to match my input video and hopefully speed up the encoding process. My input video is a 352x240 .mpg file. I'm outputting to .mp4, but the scaling is defaulting to 1280x720 even when I add vfilter "scale=352:240."

So for example, my current code is: vid <- av_video_images("video_1.mpg", destdir = "images") av_encode_video(input = vid, output = "vid_new.mp4"), vfilter="scale=352:240", framerate = 29.970030, verbose = T)

Example error: _"Changing video frame properties on the fly is not supported by all filters. Adding frame 57274 at timestamp 1911.01sec (26%) filter context - w: 1280 h: 720 fmt: 12, incoming frame - w: 352 h:420 fmt: 12 ptstime: 1912.71"

My guess is that somehow the vfilter argument isn't being passed to ffmpeg. Let me know if you have any suggestions on why or how to fix this! Thanks!