October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk7 min

How to Encode a 24-Hour YouTube Video with FFmpeg Two-Pass Encoding

A practical FFmpeg two-pass workflow for encoding a 24-hour video, with YouTube's recommended upload targets, approximate storage needs, and fixes for common problems.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To encode a 24-hour YouTube video with FFmpeg two-pass encoding, first assemble the playlist items into one input file, then run FFmpeg once to analyze the video and a second time to create the output. Two-pass encoding is useful when you want to target an average bitrate and estimate file size; it is not required for YouTube uploads. YouTube publishes recommended upload settings, not mandatory bitrate limits.

This workflow assumes you already have the intended 24-hour sequence as a single file. It does not create a playlist on YouTube: a YouTube playlist is a collection of separate videos. Check that you have the rights to use the source material and enough local storage before assembling and encoding a long program.

As an Amazon Associate I earn from qualifying purchases.

Before encoding: check the input and plan the output

Inspect the assembled file before starting. Confirm its duration, video and audio streams, resolution, frame rate, whether the picture is interlaced, audio layout, and color characteristics. You can use ffprobe, which is distributed with FFmpeg; consult the FFmpeg documentation for its options. The commands below select the first video stream and optionally map audio streams; they do not assemble playlist items or correct mismatched clips automatically.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Choose an output resolution and frame rate that suit the source and intended upload. YouTube recommends encoding and uploading at the frame rate at which the material was recorded.
  • Decide whether a bitrate target and approximate size matter more than a quality-based rate-control approach. Two-pass encoding is for bitrate targeting; CRF is a constant-quality mode and is not interchangeable with the bitrate target in these examples.
  • Allow working room for the source, final output, pass logs, and any intermediate assembly files. A 24-hour encode may require substantial disk space.

Choose a YouTube upload bitrate

YouTube’s upload-settings page, accessed on 2026-10-03, recommends the following reference bitrates. These are YouTube recommendations, not required limits or independent quality measurements. Use the resolution, frame-rate group, and SDR or HDR category that match your output.

#1 Best Overall
Sale
Pinnacle Studio 26 | Value-Packed Video Editing & Screen Recording Software [PC Download]
  • Your gateway to advanced video editing software loaded with powerful tools, an intuitive interface, and creative titles, transitions, filters, and effects that deliver quality productions—all with incredible stability and performance
  • Jumpstart a new project with a themed template or easily combine photos and videos across a six-track timeline, then fine-tune every parameter of your production with enhanced keyframe editing and management
  • Tap into tools for Stop Motion Animation, Selective Color, Split Screen Video, Screen Recording, and MultiCam Editing to take your edits to the next level
  • Produce cinema-quality sound by layering video and audio tracks, adjusting the volume, adding fade effects, recording voiceover, and tapping into royalty-free music and sound effects
  • Create high-quality DVDs with 20+ stylized menus and chapters, upload directly to YouTube or Vimeo, or export to popular file formats to share with your audience
Format and resolution Standard frame rate High frame rate
SDR, 360p 1 Mbps 1.5 Mbps
SDR, 480p 2.5 Mbps 4 Mbps
SDR, 720p 5 Mbps 7.5 Mbps
SDR, 1080p 8 Mbps 12 Mbps
SDR, 1440p 16 Mbps 24 Mbps
SDR, 2160p 35–45 Mbps 53–68 Mbps
HDR, 1080p 10 Mbps 15 Mbps
HDR, 1440p 20 Mbps 30 Mbps
HDR, 2160p 44–56 Mbps 66–85 Mbps

The table uses YouTube’s standard and high frame-rate groups as shown in its recommended upload encoding settings. The page also recommends MP4, H.264 video, progressive scan, High Profile, two consecutive B frames, a closed GOP with a GOP duration of half the frame rate, CABAC, variable bitrate, and 4:2:0 chroma. For audio it lists AAC-LC, Opus, or Eclipsa Audio at 48 kHz, with stereo, stereo plus 5.1, or stereo plus Eclipsa channel combinations. These are upload recommendations; they are not all imposed by the sample command below.

For example, 8 Mbps is YouTube’s SDR recommendation for 1080p at standard frame rates. At that video bitrate, 24 hours of video payload works out to about 86.4 decimal GB: 8 megabits per second × 86,400 seconds ÷ 8 bits per byte. That calculation excludes audio, container overhead, and working files, so it is not a finished-file size guarantee. A stereo audio reference on YouTube’s page is 384 kbps; the example command uses that rate, but the appropriate audio settings depend on the source and desired output.

Rank #2
Sale
Corel VideoStudio Ultimate 2023 | Video Editing Software with Premium Effects Collection | Slideshow Maker, Screen Recorder, DVD Burner [PC Download]
  • POWERFUL VIDEO EDITING SUITE: Create stunning movies and slideshows with this powerful, fun, and intuitive video editing suite, packed with advanced features and premium effects
  • TITLES and TRANSITIONS: Streamline your video storytelling with all kinds of unique transitions from basic ones to unique customizable transitions and introduce title and on-screen captions that highlight important scenes
  • CREATIVE CONTENT: Add style with built-in templates, hundreds of creative filters including premium effect collections from NewBlueFX and proDAD, bring fun with animated AR Stickers, Face Effects, and GIF Creator
  • AUDIO EDITOR: Set cue points with new Audio Cues to make your video match the music beats. Import your own music, use our royalty-free music library, clean background noise, or record your own narration
  • POPULAR FORMATS: Export your videos to popular formats and devices, easily share online, upload directly to YouTube, or burn to a DVD with 100+ customizable menus. Now supports AV1 and 8K formats

Run the two FFmpeg passes

The following illustrative Linux/macOS template targets 8 Mbps video with the libx264 software encoder. It makes a first analysis pass without audio, then a second pass to produce an MP4 with AAC audio. The commands are a template, not a tested encode for a particular file or FFmpeg build.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Pass one: analyze the video

    ffmpeg -i input.mp4 
      -map 0:v:0 -c:v libx264 -preset medium -b:v 8M 
      -pass 1 -passlogfile encode_stats -an -f null /dev/null

    This pass writes analysis statistics using the encode_stats prefix. It does not create the final video file.

    Rank #3
    Sale
    Pinnacle Studio 26 Ultimate | Pro-Level Video Editing & Screen Recording Software [PC Download]
    • Discover advanced video editing software fully loaded with powerful tools, an intuitive interface, and creative titles, transitions, filters, and effects that produce pro-level productions—all with incredible stability and performance
    • Expertly edit HD, 4K, and 360 video across unlimited tracks, import 8K video, and fine-tune every parameter of your project—positioning, color, transparency, and more—with precise keyframe customization and enhanced keyframe editing
    • Leverage powerful tools like Video Masking, Motion Tracking, complete Color Grading, Smart Object Tracking, Green Screen, Blend Modes, Screen Recording, MultiCam Editing, and more
    • Master your sound with advanced audio editing features including custom noise profiles, pitch scaling, multi-channel sound mixing, voiceover recording tools, and access to royalty-free music and sound effects
    • Create high-quality DVDs with 100 plus pro-caliber templates, upload directly to YouTube or Vimeo, or export to popular file formats to share with your audience
  2. Pass two: encode the final file

    ffmpeg -i input.mp4 
      -map 0:v:0 -c:v libx264 -preset medium -b:v 8M 
      -pass 2 -passlogfile encode_stats 
      -map 0:a? -c:a aac -b:a 384k -ar 48000 
      -pix_fmt yuv420p -movflags +faststart output.mp4

    Use the same input, selected video stream, encoder, target bitrate, and material video filters or options in both passes so that pass two can use pass one’s statistics. The FFmpeg general bitrate option is expressed in bits per second; 8M means 8 megabits per second. FFmpeg documents the pass controls and pass-log prefix in its full documentation and codec documentation.

On Windows, use NUL as the first pass’s null device instead of /dev/null. Output muxer handling can vary, so check your installed FFmpeg version and encoder availability. Give each simultaneous job or separate input its own pass-log prefix to avoid mixing statistics.

Rank #4
Corel VideoStudio Pro 2023 | Beginner-Friendly Video Editing Software | Slideshow Maker, Screen Recorder, DVD Burner [PC Download]
  • VIDEO EDITING SUITE: Enjoy this fun, easy-to-use and beginner-friendly video editing suite designed to create movies and slideshows that impress and inspire
  • VALUE-PACKED: Explore the robust collection of features including essential trimming tools, screen recording, MultiCam capture and editing, color correction, motion and speed effects, GIF Creator, audio editing, and more
  • TITLES and TRANSITIONS: Streamline your video storytelling with all kinds of unique transitions from basic ones to unique customizable transitions and introduce title and on-screen captions that highlight important scenes
  • CREATIVE CONTENT: Add style with built-in templates, hundreds of creative filters and overlays, bring fun with animated AR Stickers, Face Effects, and GIF Creator
  • AUDIO EDITOR: Import your own music, use our royalty-free music library, clean background noise with Audio Ducking, or record your own narration with our built-in voiceover tools
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Adjust settings to match the source

Resolution, frame rate, and GOP

The sample command does not scale or change frame rate. If you need scaling, frame-rate conversion, deinterlacing, or other video filters, choose them deliberately and apply the relevant settings consistently in both passes. YouTube recommends progressive video and advises encoding and uploading at the recorded frame rate; deinterlace interlaced source material. Its GOP recommendation is a closed GOP with a duration of half the frame rate. Do not add a frame-rate conversion simply to match a table row if it would misrepresent the source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Audio

-map 0:a? makes audio mapping optional, so the command can still run when the input has no audio stream. The example re-encodes mapped audio to AAC at 384 kbps and 48 kHz. If the source audio already meets your target format, copying or separately encoding it may be more appropriate; verify the source streams and the resulting MP4 rather than assuming every input has the same layout.

Color and pixel format

The example requests yuv420p, a common upload pixel format, but it does not set color metadata. YouTube recommends BT.709 for SDR uploads and explains that unspecified or unsupported color metadata may affect how it interprets or converts a video. Preserve or correctly signal the source’s color characteristics; a particular set of -color_* tags is not universally correct without knowing the source.

Bitrate control versus CRF

Use this two-pass pattern when an average bitrate or approximate output size is the priority. CRF instead targets a quality level and allows bitrate to vary with the content, so the final size is less predictable. Two-pass gives the encoder a complete analysis pass before the final encode, at the cost of processing the material twice. Neither approach guarantees a particular visual result; outcomes depend on the source, settings, encoder, and system.

Check disk space, upload capacity, and YouTube processing

Estimate video payload using bitrate × duration ÷ 8, then leave additional space for audio, container overhead, pass logs, assembly intermediates, and the original files. The 24-hour 8 Mbps example is about 86.4 decimal GB of video payload alone. Ensure you also have enough time and bandwidth to upload the finished file. The cited encoding guidance does not establish a maximum video duration for a particular account, a universal finished-file size, or how long an encode or upload will take.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After encoding, inspect the output’s duration, picture, audio, and metadata before uploading. YouTube’s encoding guidance describes recommended formats and settings, not account-specific upload limits or a guarantee of how a particular upload will process. Confirm current limits and publishing options in your YouTube account.

Troubleshooting

  • Pass two reports missing or unusable statistics: make sure pass one completed successfully, both commands use the same pass-log prefix, and the material video settings match. Do not reuse a prefix for another concurrent job.
  • The output is much larger or smaller than expected: the target applies to video, while audio and container overhead add data; also verify that the chosen resolution, frame-rate class, and SDR/HDR target are appropriate. The bitrate calculation is an estimate, not an exact file-size promise.
  • Audio is absent or wrong: check whether the input contains an audio stream and whether it is mapped as intended. The optional map permits no-audio inputs; inspect the output stream layout after encoding.
  • Color looks different after upload: verify the source color characteristics and metadata before adding tags. YouTube may handle unspecified or unsupported color metadata differently, so do not apply guessed color flags.
  • Encoding is too slow or storage is tight: two-pass necessarily adds a full analysis pass. Actual completion time depends on the hardware, source, encoder settings, and filters; no universal speed estimate applies. Check free space for source, logs, and output before restarting a long job.

Or let it run in the cloud

If your goal is to keep a YouTube channel continuously live by looping uploaded videos, rather than to create a single 24-hour file for upload, StreamNeo is a different workflow. Upload a recording or build a playlist, add your YouTube stream key once, and go live. StreamNeo loops the uploaded material from the cloud, so your computer and home connection do not have to stay on. It streams to YouTube and does not go live from a camera.

  • Nothing has to stay on at home; StreamNeo can recover automatically if YouTube drops the stream.
  • Each slot streams the video as uploaded, up to 4K 60fps, at one price per slot with no quality tiers.
  • The first day is free with no card required (one free day per account). The monthly option is $9.99 per month.

See StreamNeo or start the free first day.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.