0

I'm using FFMPEG shell utility in an Android app to convert users pictures to video, here's an example command:

cat *.jpg | ffmpeg -f image2pipe -r 10  -vcodec mjpeg -i - -vcodec libx264 -s 1280x720 -preset ultrafast slideshow.mp4 

I used to crop images when the user import it in the app but now I would like to allow the user to reposition the image later, here's an example:

enter image description here

So the user could drag or zoom the image to position it in the clear area (video ratio).

So using the ffmpeg shell command can I specify the image coordinate for each image and position the image in the video.

Jimmy
  • 10,427
  • 18
  • 67
  • 122
  • mark the coordinates per your picture of the shader and then use those x,y values in the crop . http://stackoverflow.com/questions/15789049/crop-a-bitmap-image output of the is piped to your ffmpeg expression – Robert Rowntree Dec 27 '15 at 22:53
  • Crossposting the [same question](http://superuser.com/questions/1018544/ffmpeg-position-images-in-video-when-making-slide-show) on multiple Stack Exchange sites is discouraged. – llogan Dec 28 '15 at 08:04
  • @LordNeckbeard I meant to do that, I think two different expert communities could have two different perspective. I solved it now by using Java code to process image in-memory and then pipe it to ffmpeg, However, a power user friend (not a coder, youtuper) pointed me to a command line tool can be used instead. I deleted the super-user question coz I already solved it but I stand by my choice of crossposting. – Jimmy Dec 29 '15 at 01:19
  • See [Is cross-posting a question on multiple Stack Exchange sites permitted if the question is on-topic for each site?](http://meta.stackexchange.com/questions/64068/is-cross-posting-a-question-on-multiple-stack-exchange-sites-permitted-if-the-qu) and [Is SO/SE crosspost accepted?](http://meta.stackoverflow.com/questions/255649/is-so-se-crosspost-accepted). – llogan Dec 29 '15 at 01:24
  • Thanks, In my opinion it might fall under (from the second link)`It's a rare question that's on topic on multiple sites.` but I respect your perspective and removed the answer from the other site. – Jimmy Dec 29 '15 at 01:27

1 Answers1

0

I solved it by processing image in-memory serially, piping it to FFMPEG (command line tool) and then using the same reference to load the next image. For the UI, I used PhotoView and stored the info provided by the view to crop the image later.

Jimmy
  • 10,427
  • 18
  • 67
  • 122