Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7491695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:06:20+00:00 2026-05-29T16:06:20+00:00

I am using the following command to encode an AVI to an H264 video

  • 0

I am using the following command to encode an AVI to an H264 video for use in an HTML5 video tag:

ffmpeg -y -i "test.avi" -vcodec libx264 -vpre slow -vpre baseline -g 30 "out.mp4"

And this works just fine. But I also want to create a placeholder video (long story) from a single still image, so I do this:

ffmpeg -y -i "test.jpg" -vcodec libx264 -vpre slow -vpre baseline -g 30 "out.mp4"

And this doesn’t work. What gives?

EDIT: After trying LordNeckbeards answer, here is my full output: http://pastebin.com/axhKpkLx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:06:22+00:00Added an answer on May 29, 2026 at 4:06 pm

    Example for a 10 second output:

    ffmpeg -loop 1 -framerate 24 -i input.jpg -c:v libx264 -preset slow -tune stillimage -crf 24 -vf format=yuv420p -t 10 -movflags +faststart output.mp4
    

    Same thing but with audio. The output duration will match the input audio duration:

    ffmpeg -loop 1 -framerate 24 -i input.jpg -i audio.mp3 -c:v libx264 -preset slow -tune stillimage -crf 24 -vf format=yuv420p -c:a aac -shortest -movflags +faststart output.mp4
    
    • -loop 1 loops the image input.

    • -framerate sets the frame rate of the image input. Default is 25. Some players have issues with low frame rates so a value over 6 or so is recommended.

    • -i input.jpg the input.

    • -c:v libx264 the H.264 video encoder.

    • -preset x264 encoding preset. Use the slowest one you can.

    • -tune x264 tuning for various adjustments to fit specific situations.

    • -crf for quality. A lower value results in higher quality. Use the highest value that still provides an acceptable quality to you. Default is 23.

    • -vf format=yuv420p outputs the pixel format as yuv420p. This ensures the output uses a widely acceptable chroma sub-sampling scheme. Recommended for libx264 when encoding from images.

    • -c:a aac the AAC audio encoder. If your input is already AAC or M4A then use -c:a copy instead to stream copy instead of re-encode.

    • -t 10 (in the first example) makes a 10 second output. Needed because the image is looping indefinitely.

    • -shortest (in the second example) makes the output the same duration as the shortest input. In this case it is the audio since the image is looping indefinitely.

    • -movflags +faststart relocates the moov atom to the beginning of the file after encoding is finished. Allows playback to begin faster in progressive download playing; otherwise the whole video must be downloaded before playing.

    • -profile:v main (optional) some devices can’t handle High profile.

    See FFmpeg Wiki: H.264 for more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to execute following code using gcc test.c -o test.o -ldbi command. #include
I am currently using the following command to upload my site content: scp -r
I'm using the following command to remove every .dummy directories in a folder named
I am using the following beamer command \newcommand{\imgslide}[2]{ {\setbeamertemplate{background canvas}{ \includegraphics [width=\paperwidth,height=\paperheight]{images/#1}} \begin{frame}[plain] \txtonimg{#2}
How can I run the following command using subprocess.Popen ? mysqldump database_name table_name |
I have created a certificate using the following SSL command: makecert -r -pe -n
I launch the following command line (process) from a Windows VC++ 6 program using
I am currently using PHP_Beautifier for formatting code with the following command like options
I'm trying to drop a SQL Server database using the following code: SqlCommand command
I'm using the following to to tee output of a command into a file:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.