Skip to content
streamneo.
Troubleshooting11 min read

How to Make an FFmpeg Playlist Skip Videos with Different Resolutions

Inspect video dimensions with ffprobe, filter separate playlist entries, or normalize clips before joining them with FFmpeg.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

“How to make an FFmpeg playlist skip videos with different resolutions” depends on what you mean by playlist. If you mean separate files listed for playback, inspect their video dimensions and include only files that match a target you choose; if you mean one video made by joining clips, normalize their dimensions before concatenating them.

Filtering a playlist omits mismatched files; it does not resize them or make them compatible. The steps below distinguish those outcomes, show how to inspect dimensions with ffprobe, and explain what changes when you create a joined output.

First decide: separate entries or one joined video

A playlist of separate files is a list of paths or media entries that a player or demuxer visits in sequence. Each video remains its own file. If one entry has a different frame size from the one you want, a playlist-generation script can leave that entry out while retaining the file unchanged on disk.

A joined output is different: it is one newly encoded video containing material from multiple source clips. If their frame sizes differ, simply placing their paths in a playlist does not produce a uniform-size file. You need a workflow that scales each input to a common frame size and then joins the resulting streams.

Start by asking: do you want to remove mismatched files from a playlist, or combine clips into one video? If you only need the first result, do not transcode the files. If you need a single file, filtering would discard material you may want to keep, and you should instead plan normalization and encoding.

The word “playlist” does not identify a specific format. An M3U8 list, an FFmpeg concat-demuxer file, and a player-specific list have different syntax and rules. Decide which program will read the result before writing the final list. The FFmpeg playlist-shuffling guide is useful background on playlist handling, but resolution filtering is a separate step that your list-generation logic must perform.

Choose the dimensions or matching rule

Before probing anything, state what “same resolution” means for your use. You might select an exact width and height, such as 1920x1080, if you need every listed file to share both dimensions. That example is only a possible target, not a requirement; use the dimensions suitable for your material and destination.

Exact matching checks both values. A file at 1920x1080 does not match 1280x1080, even though the height is the same. Nor does matching width alone establish that the frame shape is the same. If your actual requirement is “keep every clip with a height of 1080 pixels”, then define the rule as height-only and understand that resulting entries may have different widths and aspect ratios.

A target can come from your existing library, your editing project, or a delivery requirement. Do not infer it from a filename such as final_1080p.mp4; names and labels can be stale or inaccurate. If you are preparing a continuous YouTube broadcast, check the current official guidance for the destination and your encoding workflow rather than assuming one target is right for every channel. For practical context on a continuous channel’s picture settings, see how video resolution is set for a continuous live showcase.

Also decide how to treat files that cannot be inspected. A missing video stream, unreadable file, or probe error is not a match. Report it or place it in a separate review list. Treating “unknown” as “probably correct” can put precisely the wrong file into an overnight playlist.

Inspect each file with ffprobe

ffprobe is FFmpeg’s companion tool for reading media information. It can report stream dimensions in a compact, machine-readable form. For one candidate file, run:

ffprobe -v error -select_streams V:0 \
  -show_entries stream=width,height \
  -of csv=s=x:p=0 input.mp4

This asks for the first video stream and requests its width and height, printed in a compact form such as 1920x1080. The V:0 selector refers to the first video stream while excluding attached cover art from the selection. Replace input.mp4 with the path of a file you are checking. The ffprobe documentation describes stream selection and output formats; options may differ across installed versions, so check the documentation that matches your FFmpeg build when a command behaves unexpectedly.

The probe reports encoded frame dimensions, not a guarantee about how every player will display the picture. Rotation metadata, pixel aspect ratio, cropping, and display settings can affect appearance. For the narrow job of filtering on coded width and height, however, the reported stream fields give you a direct, repeatable comparison instead of relying on names or visual guesses.

For a directory, the general process is to enumerate candidate paths, invoke the probe once per path, parse the result, and write only matching paths to the playlist format your player accepts. Use the same stream-selection rule for every file. If a file contains multiple video streams, decide whether the first video stream is the one that matters or whether your workflow needs to examine another stream. Do not let automatic output stream selection make that decision on your behalf.

Keep a record of the file path, the probe result, and whether it was included. This makes it easier to find a typo in a target or diagnose a failed probe. It also avoids silently dropping a valuable file when the problem was a damaged container or an unexpected stream layout rather than a true size mismatch.

Compare both width and height

Once each probe result is parsed, compare the dimensions to your chosen rule. For an exact target, the inclusion test is conceptually:

include when width equals target_width AND height equals target_height

For example, if you choose 1920x1080, then 1920x1080 is an exact match and 1920x1088 is not. A width-only test would mistakenly admit the latter. Similarly, a height-only rule should be written as a height comparison, not described as an exact resolution match.

Do not compare just a resolution label or a single dimension unless that is deliberately what you want. Two videos with equal height can have different widths, and the player may show them with different frame shapes. If the goal is a consistent viewing frame, compare both width and height or define another explicit rule that addresses aspect ratio as well.

Be precise about equality. “At least this large” is not the same as “exactly this size”. A rule such as width greater than or equal to a threshold and height greater than or equal to a threshold will include larger frames, but it can also include unusual shapes. Decide whether the filtering criterion is exact dimensions, minimum dimensions, or height-only before writing a script. The title does not supply that choice.

A playlist filter should make an inclusion decision, not make an edit. If a file fails the comparison, it is absent from the generated list. Its resolution and contents remain unchanged. If you need to keep its content but make it fit a common frame, use the separate normalization workflow below.

Filter separate playlist entries

A playlist-generation script can follow this simple logic for each path: probe the selected video stream, parse width and height, compare them with your chosen rule, and append the path only if it matches. Keep nonmatches out of the output list, and report probe errors or missing dimensions separately. This is the core operation regardless of whether you implement it in a shell script, Python, PowerShell, or another language.

The final playlist syntax depends on the consumer. A plain line-per-path list is not interchangeable with an FFmpeg concat-demuxer input or an HLS playlist. Follow the relevant format’s escaping and path rules, particularly when filenames contain spaces, punctuation, or non-ASCII characters. Generate a test list and open it in the intended player or demuxer before replacing a working playlist.

Do not confuse playlist filtering with FFmpeg’s -map option or automatic stream selection. Those options determine which streams from provided inputs go into an output; they do not scan a directory and skip files based on a target width and height. The FFmpeg command-line documentation explains stream selection and mapping. Your script must do the per-file probe and comparison before writing playlist entries.

If your goal is a 24/7 stream, a bad list can repeat the same omission or unexpected clip every time the sequence cycles. Keep the source directory intact, write the filtered playlist to a separate path, and test the opening, a transition, and the return to the start. For an FFmpeg broadcast process, a health-check script for monitoring FFmpeg streaming addresses a different but complementary problem: whether the process remains healthy after your prepared media has been accepted.

Normalize dimensions when making one output

If you need every clip in one continuous video, use a workflow that filters and encodes the inputs to a common frame size before concatenating. The FFmpeg FAQ distinguishes the concat filter, concat demuxer, and concat protocol; it recommends the concat filter when re-encoding is needed. The official concat guidance is worth checking alongside the documentation for your installed version.

A conceptual two-input filter chain is shown below. It scales each image to fit a chosen box while preserving its aspect ratio, then adds padding to reach that exact frame size:

[0:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2[v0];
[1:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2[v1];
[v0][0:a][v1][1:a]concat=n=2:v=1:a=1[outv][outa]

This is an illustration, not a ready-to-run command for every pair of files. It assumes that both inputs have audio streams in the expected order. If one has no audio, multiple audio streams, or a different layout, the filter graph and mappings need to be adapted. You also need to choose output codecs and encoding settings for your delivery needs. A scale filter changes the video, and the concat-filter route entails re-encoding; stream copy does not resize frames.

The example’s 1920:1080 is an editorial choice, not a universal target. Replace it consistently with the target dimensions you actually need. The force_original_aspect_ratio=decrease option fits the complete source image inside the target box. Padding then fills the unused area to make the output frame exact, producing bars where the source shape does not fill the box. The scale filter documentation describes output sizing and aspect-ratio behaviour.

Cropping is the alternative when you want to fill the entire frame without bars: it discards parts of the image that fall outside the crop. That may cut off text, a face, or a devotional image detail. Padding preserves the whole picture but leaves unused space around it. Preview representative clips and choose deliberately; neither treatment is a neutral change.

The concat demuxer can be appropriate when the inputs already meet the needed format and stream conditions and you want to avoid re-encoding. It does not scale clips, so it cannot solve differing frame dimensions by itself. Check the inputs and the FAQ before choosing it; the method depends on the media and desired result. For a recurring channel where keeping a local computer on is itself the fragile part, StreamNeo can remove that particular burden by taking an uploaded video and running it as a YouTube live stream while your computer is off; it does not replace checking or preparing the media correctly.

Verify the list or the encoded result

For a separate-file playlist, inspect the generated list before using it. Check that every included path exists, that a known matching file appears, and that a known mismatch is absent. Then open the list with the actual consumer. A syntactically valid file is not necessarily a playlist in the format your chosen player expects.

If a file was omitted unexpectedly, rerun the probe manually and compare the reported values with the rule in your script. Check for probe failures, missing dimensions, unexpected stream ordering, and path handling. If the output list is empty, the target may be wrong for the library, or the parser may not be reading the probe output as expected. Do not “fix” that by weakening the comparison until you know which case applies.

For a joined output, probe the final file and confirm its video dimensions are the target you selected. Play through clip boundaries, because resolution checks alone do not validate audio continuity, frame pacing, or visual framing. Look for bars or cropping that were not intended, and listen at transitions for an audio gap or sudden change in level.

Finally, test the exact file or playlist in the environment that will run it. FFmpeg documentation is maintained as the project develops, and a local build may have different options from the online manual. The FFmpeg filters reference and ffprobe manual are useful references, but verify behaviour with your installed version and a short test before scheduling an unattended broadcast.

Before committing, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.

FAQ

Does filtering resize files that have the wrong dimensions?

No. A playlist filter only decides whether a path is written to the list. To retain mismatched clips in a single output, normalize them with a scale-and-encode workflow; that changes the video rather than merely filtering the playlist.

Should I compare width, height, or both?

For an exact resolution match, compare both width and height. Compare height alone only if that is the requirement you have chosen, and remember that files with the same height can still have different widths and frame shapes.

Can I use stream copy to make joined clips the same size?

No. Stream copy passes encoded streams through without applying a scale filter. When dimensions need to change, you need filtering and re-encoding; if the files already meet the required conditions, a concat demuxer may be suitable, but it does not resize them.

Why does the example use a particular target size?

The dimensions in the example illustrate the syntax and are not prescribed for your channel. Choose a target based on your material and delivery needs, then substitute it consistently in the comparisons or filter graph.

YOU’VE REACHED THE END

Keep the ideas coming.

More guides, useful tools and a little help for your next broadcast.

Back to the journal ↗
YOUR NEXT READ

A little more to explore.

More Troubleshooting guides ↗ · All topics ↗