omxplayer icon indicating copy to clipboard operation
omxplayer copied to clipboard

Freeze with videos generated with FFMPEG.

Open ffloress opened this issue 7 years ago • 6 comments

Omxplayer wont play any videos generated with ffmpeg command: ffmpeg -framerate 10 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p out.mp4

source: https://trac.ffmpeg.org/wiki/Slideshow

It freezes in black screen.

Error msg:

Invalid framerate 0, using forced 25fps and just trust timestamps Video codec omx-h264 width 1920 height 1080 profile 100 fps 25.000000 Subtitle count: 0, state: off, index: 1, delay: 0 Error: Unable to open font

ffloress avatar Oct 18 '17 00:10 ffloress

Try to force the framerate of the output file (out.mp4) to e.g. 25.

In my case as I used just a couple of jpg files (14 to be exactly) I found out that I needed a framerate setting for the input file (the first argument) and not to exceed it above the value 3. With larger values I think the movie is to short for omxplayer to show. Maybe it is in your case too, as the value depends on the number of jpg's you use.

Use omxplayer option -I (capital i) to show some info about your (created) movie.

The command I used to generate the movie:

ffmpeg -r 1/2 -pattern_type glob -i '*.JPG' -c:v libx264 -pix_fmt yuv420p -r 25 -vf "scale=1920:1080" out.mp4

I had to scale my (photo) images as omxplayer can only handle max 1920x1080 movies.

The Error: Unable to open font may come from the subtitle renderer. You need to verify if the following files are on your raspberry:

  • /usr/share/fonts/truetype/freefont/FreeSans.ttf
  • /usr/share/fonts/truetype/freefont/FreeSansOblique.ttf

These are the default fonts the subtitle renderer uses. Although you don't have subtitles the renderer is also used for display status information on screen (which can be switched of by omxplayer option --no-osd).

jehutting avatar Oct 18 '17 10:10 jehutting

also, I don't think omxplayer supports "profile 100" h264 videos

StCyr avatar Mar 19 '18 11:03 StCyr

may I ask, what flag makes it "profile 100" in this command? ffmpeg -framerate 10 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p out.mp4

nagualcode avatar Mar 19 '18 11:03 nagualcode

rather, the absence of a flag :-)

"profile 100" is related to h264 profiles. Try adding "-profile baseline -level 3.0" to your ffmpeg command that may help (this should also result to a "profile 578" on your omxplayer's output).

Regards

StCyr avatar Mar 19 '18 13:03 StCyr

Thank you, you can close this issue, since this is related to the profile used.

nagualcode avatar Apr 23 '19 03:04 nagualcode

I am experiencing intermittent behavior. Adding "-profile baseline -level 3.0" does not eliminate the message "Invalid framerate 0, using forced 25fps and just trust timestamps". Sometimes it works and sometimes it does not work. I cannot explain why/when it plays or not plays.

The full ffmpeg command is: ffmpeg -framerate 1/10 -pattern_type glob -i '/home/pi/mkt/media_downloading/*.jpg' -c:v libx264 -pix_fmt yuv420p -profile baseline -level 3.0 /home/pi/mkt/media_processed/images.mp4

omxplayer sometime plays and sometime freezes playing the resulting images.mp4

chocksmith avatar Dec 31 '20 11:12 chocksmith