0

I have RPi running raspbian. I want a solution to convert a folder of image files to an mp4 slide show video that can be played with omxplayer. I did it with ffmpeg and following command:

ffmpeg -y -framerate .1 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p out.mp4

It works with mpv media player but playing it with the flowing command with omx player does not do anything.

omxplayer --loop --no-osd --win 0,0,128,224 --orientation 90 out.mp4

I must use omx player to output on exact window and be compatible with older programs. Not sure what would be the right way to do this. I have already a node js server running on Pi that I can use if needed. Thanks

Ramin
  • 1
  • 3
  • Add `-r 5` after the input and check. – Gyan Nov 24 '20 at 04:15
  • -r Does not do it. I think the output is missing fps metadata. – Ramin Nov 24 '20 at 17:13
  • Share full command you tried and its log. – Gyan Nov 25 '20 at 05:16
  • ffmpeg -y -framerate .1 -pattern_type glob -i '*.jpg' -r 5 -c:v libx264 -pix_fmt yuv420p out.mp4 – Ramin Nov 25 '20 at 10:03
  • [swscaler @ 0x1f28250] deprecated pixel format used, make sure you did set range correctly [libx264 @ 0x1e69c10] using SAR=1/1 Metadata: encoder : Lavf58.20.100 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 540x960 [SAR 1:1 DAR 9:16], q=-1--1, 5 fps, 10240 tbn, 5 tbc Metadata: encoder : Lavc58.35.100 libx264 frame= 3 fps=0.0 q=-1.0 Lsize= 46kB time=00:00:00.00 bitrate=3861387.8kbits/s dup=0 drop=8 speed=0.000268x – Ramin Nov 25 '20 at 10:06

1 Answers1

0

So the problem was I should have force both input and output rates(r .2 and -r 30) Here is my final command:

ffmpeg -y -r .2 -pattern_type glob -i '*.jpg'  -vcodec libx264 -pix_fmt yuv420p -preset fast -crf 18 -b-pyramid none -acodec ac3 -ab 1536k -scodec copy -r 30 out.mp4

Thank you Gyan for your comments.

Ramin
  • 1
  • 3
  • Input `-r` is not required. Difference will be due to value of output `-r`. Depends on your player's caching policy. – Gyan Nov 25 '20 at 10:58
  • Actually it is required to control the time of each slide. but the right argument is -framerate not -r. so I modified the command to : sudo ffmpeg -y -framerate .11 -pattern_type glob -i '*.jpg' -r 10 -c:v libx264 -vf scale=128:224 Org1.mp4 – Ramin Nov 30 '20 at 23:34
  • Yes, but not for generating playback friendly files on your platform. – Gyan Dec 01 '20 at 11:19
  • Since I do not need to use play back, this is fine for me. But if I remove the -framrate then the video will be too short how can I control each slide time? – Ramin Dec 02 '20 at 15:11