Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober 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 Scan×
Skip to content
DocumentaryTube
FFmpeg

How to Batch Convert a Video Folder to H.264 MP4 with FFmpeg for YouTube Live

Learn when to batch transcode files separately, how to join compatible clips, and which YouTube Live settings apply to the live feed rather than the MP4.

By DocumentaryTube Team 7 min read

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Use FFmpeg to make either a separate H.264 MP4 for every source video or one joined program from a playlist of clips; these are different jobs. For separate files, run one transcode per input. To join clips, use FFmpeg’s concat demuxer only when their streams and timing are compatible, or use a concat-filter workflow that re-encodes them. A saved MP4 is a video file, not a live stream: YouTube’s live-encoder settings apply to the feed sent during a broadcast, not automatically to the file you create.

Choose separate MP4 files or one continuous program

First decide what the folder should produce:

  • Separate outputs: each source gets its own MP4. This is usually the straightforward choice for a folder with mixed resolutions, frame rates, codecs, or audio tracks.
  • One joined output: clips play sequentially as a single program. They need a deliberate playback order, and the concat demuxer has strict compatibility requirements.

FFmpeg commands below are starting points, not universal presets. The right dimensions, frame rate, quality or bitrate, and audio handling depend on the source files and intended use. FFmpeg’s libx264 documentation describes its wrapper for the x264 H.264 encoder. Confirm that your FFmpeg build includes the encoder you choose.

Convert each video in a folder to its own MP4

Run one transcode per input

A basic conversion command is:

ffmpeg -i "input.ext" -c:v libx264 -pix_fmt yuv420p -c:a aac "output.mp4"

Replace the filenames with the actual input and output paths. This command encodes video as H.264, requests the widely compatible 8-bit 4:2:0 pixel format, and encodes audio as AAC. It does not set a target resolution, frame rate, or bitrate; FFmpeg will generally follow the input’s dimensions and frame rate unless you add options. If you need a particular output profile, set it intentionally rather than assuming this command has normalized every file to the same specifications.

Batch with a shell loop

For a Bash-compatible shell, create an output directory separate from the source folder, then run a loop such as:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
mkdir -p output
for f in input/*; do
  [ -f "$f" ] || continue
  name=$(basename "$f")
  ffmpeg -i "$f" -c:v libx264 -pix_fmt yuv420p -c:a aac "output/${name%.*}.mp4"
done

This handles regular files directly inside input; it does not recursively traverse subfolders. Quoting paths protects spaces and many shell-special characters. The output goes to a different directory so it will not be picked up as another input on a later run. The original files remain untouched. If the folder includes non-video files, use a deliberate input list or filter extensions rather than sending every file to FFmpeg.

Check audio and batch results

Sources without an audio stream can make a command that explicitly requests audio encoding fail. Inspect such files and use an audio-optional mapping when appropriate, for example -map 0:v:0 -map 0:a:0?, followed by the codecs you want. If a source has multiple audio or subtitle streams, decide which ones to retain; the basic command does not explain or preserve every possible stream choice.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

For unattended or large batches, capture FFmpeg’s errors and check that each expected output exists and plays. A completed loop alone does not prove every file converted successfully. Avoid adding overwrite options unless you intend to replace existing outputs.

Join clips into a single MP4

Use the concat demuxer for compatible inputs

Create a text file named list.txt in playback order:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
file 'clip-001.mp4'
file 'clip-002.mp4'
file 'clip-003.mp4'

Then run:

ffmpeg -f concat -safe 0 -i list.txt -c:v libx264 -pix_fmt yuv420p -c:a aac output.mp4

This example re-encodes the joined video and audio. The concat demuxer itself reads packets sequentially and adjusts timestamps; it is not a general-purpose way to merge arbitrary, mismatched videos. FFmpeg requires demuxer inputs to have the same streams, including codecs and time bases. Differences in resolution, frame rate, audio layout, or whether a stream exists can make direct concatenation fail or produce timing problems. Normalize inputs to compatible streams and parameters first, or choose the concat filter and re-encode.

-safe 0 relaxes FFmpeg’s path-safety checks. Keep the list to trusted, controlled paths; when possible, use simple relative filenames and omit that option if the paths meet FFmpeg’s safety rules. The demuxer uses each input’s duration to place the next one, so inaccurate duration metadata or differences in stream durations can cause gaps or artifacts. Inspect the joined file, especially around clip boundaries.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2Ă— USB C male to USB A female adapters and 2Ă— USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Use the concat filter when re-encoding is needed

The concat filter is the alternative when clips need conversion or normalization as part of the join. It is an FFmpeg filter workflow rather than a drop-in replacement for the list-file command: inputs must be supplied and mapped through the filter, with matching parameters such as video dimensions and audio layout prepared as needed. Because no single command fits arbitrary source folders, do not paste a generic filter command without first inspecting the clips and defining the target profile. For mixed sources, normalize each file to a common profile, then concatenate and test the transitions.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep the MP4 conversion profile separate from YouTube Live ingest

A converted H.264 MP4 can be used as an input asset in a separate live-streaming workflow. The settings for the file and the settings for a live encoder are related but not interchangeable. YouTube’s live guidance calls for constant bitrate (CBR), while its upload guidance describes variable bitrate for stored video.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

YouTube’s H.264 live recommendations

YouTube’s Live encoder settings, accessed 2026-10-03, list RTMP/RTMPS delivery, H.264, H.265, or AV1 video, AAC or MP3 audio, CBR, and frame rates up to 60 fps. For H.264, its recommended video bitrates include:

Live resolution and frame rate YouTube-recommended H.264 video bitrate
720p30 8 Mbps
720p60 8 Mbps
1080p30 10 Mbps
1080p60 17 Mbps
1440p30 21 Mbps
1440p60 34 Mbps

These are YouTube’s published recommendations, not guarantees of picture quality or stream success. Select a resolution and frame rate that suit the source and that your upload connection can sustain reliably. YouTube also recommends a two-second keyframe interval, not exceeding four seconds; 128 Kbps stereo audio; progressive scan; square pixels; two B-frames; one reference frame; CABAC; and Rec. 709 for SDR. Check the live-settings page for the current table before configuring an encoder because platform recommendations can change.

Upload-file recommendations are different

YouTube’s recommended upload encoding settings include an MP4 container, H.264 video, AAC-LC among its listed audio choices, progressive scan, 4:2:0 chroma, and fast-start placement of the MP4 moov atom. The upload guidance also describes variable bitrate and a closed GOP. These are recommendations for uploaded files; do not copy them blindly as live-ingest settings, where YouTube specifies CBR.

Test the actual live workflow before relying on it

Test with representative sound and movement before the broadcast, then check YouTube’s stream-health messages during the event. YouTube Help specifically advises testing with audio and movement similar to what will be in the stream. RTMPS is recommended for encrypted delivery. These checks apply to the live feed; a file that plays locally does not by itself confirm the encoder, network, stream key, or YouTube ingest is working.

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

Troubleshoot common conversion and joining problems

  • FFmpeg reports that libx264 is unavailable: your build may not include the requested encoder. Use a build that provides it, then rerun the conversion.
  • A batch job fails on files with no audio: the command may be requesting an audio stream that is absent. Inspect the file and make audio mapping optional or handle silent files separately.
  • The concat demuxer rejects a clip or the output has timing issues: compare stream presence, codecs, time bases, resolutions, frame rates, and audio layouts. Normalize the clips to compatible parameters or use a concat-filter workflow with re-encoding.
  • There are gaps or glitches at a join: inspect durations and metadata, then review the transition in the output. The demuxer places subsequent inputs according to input durations, so inaccurate timing information can affect the result.
  • The output is not the intended size or frame rate: the basic transcode command does not set either. Specify output dimensions or frame rate based on the desired profile and source; review the result before using it.
  • The live encoder is unstable or YouTube reports stream-health warnings: test the chosen live resolution and bitrate against reliable upload capacity, check the encoder’s CBR and keyframe settings against YouTube’s current guidance, and verify the live workflow rather than assuming the MP4 conversion is responsible.

Or let it run in the cloud

If the goal is to keep uploaded videos looping as a 24/7 YouTube live stream, StreamNeo is a cloud alternative: upload a recording or build a playlist, add your YouTube stream key, and go live. It keeps running without a computer or home connection staying on, automatically recovers if YouTube drops the stream, and plays your uploads as made up to 4K 60fps at one flat price per slot. The first day is free with no card. The monthly option is $9.99 per month. StreamNeo is for YouTube streams, not camera broadcasting. 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 Screening Room

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

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.