Skip to content
streamneo.
Troubleshooting12 min read

Fix FFmpeg Playlist File Paths for a YouTube Live Shop Promo on Ubuntu

Diagnose unsafe and missing FFmpeg concat playlist paths on Ubuntu, then check media compatibility and YouTube ingestion separately.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

If FFmpeg rejects a shop-promo playlist as unsafe, it is refusing a path under the concat demuxer’s safety rules; if it reports that a file cannot be found or opened, the path or access is the problem instead. Check those cases separately: -safe 0 changes path validation for trusted playlist entries, but it does not locate missing files or solve media and YouTube ingest issues.

The steps below assume FFmpeg’s concat demuxer is reading a text playlist on Ubuntu. Start with the exact error, establish where the playlist lives, then verify each referenced file. Only after that should you investigate whether the clips can be concatenated or whether the selected YouTube ingest protocol is configured correctly.

Identify the concat error before changing options

Read the first relevant error from FFmpeg, not just the final summary. An error such as “Unsafe file name” points towards the concat demuxer’s path screening. “No such file or directory” points towards a path that does not resolve as written, a spelling or case mismatch, or a file that is absent. A permission error suggests the process cannot read the file. These messages describe different stages, so adding an option before identifying the failure can obscure the diagnosis.

The concat demuxer treats a playlist as a script describing inputs, not as a shell command. It opens the script, reads its file directives, and then tries to open the named media. A playlist can therefore be readable while one of its entries is invalid or inaccessible. Conversely, a correct entry cannot help if FFmpeg is pointed at the wrong playlist file.

Keep a note of the exact command and working directory when reproducing the issue. If a scheduled job runs FFmpeg as a different Ubuntu user or from a different directory than your interactive shell, its result can differ. Do not post a live stream key in a command transcript or public support request; redact it and share only the relevant input and error text.

For a broader playlist setup, the guide to sending several MP4 clips to YouTube Live with FFmpeg is useful context. This page stays focused on paths rather than on a complete encoder configuration.

Check the playlist directives and quoting

A basic concat playlist has one file directive for each item, for example:

ffconcat version 1.0
file 'promo-01.mp4'
file 'promo-02.mp4'

The header belongs at the start of the script when using the ffconcat format. Each following directive names one media input. Check that every intended promo clip appears once, that there are no accidental blank fragments or shell variables in the file, and that the spelling and capitalisation match the actual filenames. Linux filenames are case-sensitive: Promo-01.mp4 and promo-01.mp4 are different names.

The concat script has its own quoting rules. Spaces and special characters need to be quoted or escaped as the FFmpeg documentation describes; shell quoting around the command does not rewrite the contents of the playlist. If a filename includes a single quote, do not assume that a shell-style quoted string will work unchanged inside the script. Use the documented concat-script escaping convention, or rename the file to a simpler portable name if that is practical.

Prefer plain names such as promo-01.mp4 where you control the files. Avoid relying on punctuation or unusual characters when a straightforward rename will make the playlist easier to inspect and maintain. This is not a requirement that all media filenames be identical; it is a way to reduce ambiguity while diagnosing a path error.

The FFmpeg project’s concat demuxer documentation describes the script syntax, the default safety setting and the input-option behaviour. Refer to it for exact escaping details rather than improvising a quoting rule from Bash examples.

Resolve relative paths from the playlist location

A relative entry such as file 'promo-01.mp4' is interpreted in relation to the concat playlist’s effective location, not automatically from whichever directory you happen to be viewing in a terminal. Put the playlist next to its clips and use filenames only, or write paths relative to the directory where the playlist is stored. The first approach is usually easiest to reason about for a small shop-promo loop.

For example, if the playlist is stored in /home/ubuntu/shop-promo/playlist.ffconcat and the video is beside it, promo-01.mp4 is the concise entry. If the video is in a subdirectory, the entry needs to reflect that relationship, such as clips/promo-01.mp4. If the playlist and media are in unrelated locations, use a deliberate path strategy instead of assuming that FFmpeg will search the current shell directory.

The location can be less obvious when a playlist is generated dynamically. Process substitution can present FFmpeg with a temporary path rather than a persistent file beside your media, which changes the effective base for relative entries. A playlist that works as a saved file may fail when passed through a temporary path for this reason. For troubleshooting, write the script to a stable location and run it there; this removes one variable. The FFmpeg Wiki concat discussion also notes the relative-path concern around playlist location and process substitution.

Once the base is clear, check the path literally. Ubuntu path components use forward slashes; do not copy a Windows backslash path into the playlist. Check the directory names, spaces, and filename extension, then compare the result with the real file location. If the entry is relative, mentally append it to the playlist’s directory and verify that resulting path.

Separate unsafe paths from missing or unreadable media

The concat demuxer defaults to safe=1. Under that policy, entries must be relative, must not contain a protocol specification, and each path component must use the permitted portable characters without beginning with a period. This policy can reject a path before FFmpeg attempts to read the target media. An absolute path is an obvious example: it may point to an existing file and still be rejected as unsafe under the default.

A missing-file problem happens later in the reasoning: the entry passes the path checks, but the resulting file is not found. An unreadable file is different again: it may exist at the resolved location, while the Ubuntu user running FFmpeg lacks permission to read it. Confirm both existence and readability as that same user. A check performed in your personal shell is not conclusive if a service, cron job, or another account launches the broadcast.

Use the error and a small checklist to keep the cases apart:

What you see Likely stage What to check next
Unsafe file name Path validation Is the entry absolute, using a protocol, or outside the permitted component rules?
No such file or directory Path resolution or file lookup Is the path relative to the playlist’s location, and does the spelling match?
Permission denied or an input-open failure Access Can the same Ubuntu user that runs FFmpeg read the listed file?
A stream or codec error after opening Media handling Do the inputs have compatible streams and formats?

Treat these as diagnostic directions, not guaranteed interpretations of every version’s wording. The important distinction is whether FFmpeg has rejected the name, failed to resolve or access a file, or opened it and then encountered a media issue. Fix one stage at a time and retry with the same playlist location and user.

Understand what -safe 0 changes

If absolute paths or another path form screened out by the default are intentional, and you trust the playlist contents, -safe 0 disables that concat path screening. It is an input option: put it before the -i that opens the playlist. The documented pattern for absolute entries is:

ffmpeg -f concat -safe 0 -i playlist.ffconcat ...

Here the ellipsis stands for output options that depend on the media and selected ingest method; it is not a complete broadcast command. The safety option does not make an absolute path portable. It simply permits the demuxer to accept path forms that its default validation would reject.

Do not use the option casually if playlist contents can be changed by someone or something you do not trust. Disabling screening broadens what names the playlist can reference. If you control the clips and can keep the playlist beside them, safe relative entries are often simpler and leave the default check enabled. If absolute paths are necessary, verify the playlist and every entry before running it.

Most importantly, -safe 0 cannot create a missing file, correct a misspelt name, grant read permission, reconcile different codecs, or repair a YouTube connection. If you already have “No such file or directory”, trace the resolved path instead of adding this option. If you see a media or output error after inputs open, move to that separate check.

Check media compatibility separately

A path fix only gets FFmpeg to the inputs. The concat demuxer expects the files to have compatible stream layouts and parameters for concatenation without re-encoding. Two files can both be MP4s yet differ in video or audio properties enough to cause problems when stream-copied as one continuous input. Do not infer compatibility from the filename extension alone.

After confirming every file opens, inspect the inputs and compare their streams: whether each has video and audio, the codecs, dimensions, frame rate, sample rate, and channel layout. The specific properties that matter depend on the source material and your command. If the streams do not align, a path option is not the remedy. You may need to prepare consistent clips, or use FFmpeg’s concat filter and re-encode into a common output format.

The FFmpeg FAQ discusses concatenation approaches, including the filter for cases where re-encoding is needed. Re-encoding offers flexibility but takes processing and requires you to choose output parameters; stream copy avoids that encoding step but is less forgiving about mismatched inputs. Make that choice after the path layer is settled.

A shop promotion may combine a short logo animation, a product clip, and a spoken offer. Check that the clips do not unexpectedly switch between silent and audio-bearing streams, or use different audio layouts. If you intend to keep the sound from one clip and not another, decide how to handle that explicitly rather than expecting concat path syntax to make the tracks line up.

For a long-running channel, also consider whether the playback process itself needs supervision after configuration. The article on automatically restarting a looping YouTube stream covers that operational issue; restart behaviour is separate from whether a particular file path resolves.

Verify YouTube ingestion as a separate check

Do not use a successful local file open as proof that YouTube will accept the output, and do not use an ingest rejection as evidence of a bad playlist path. The input side reads and concatenates media; the output side must match the ingest protocol you selected and YouTube’s current requirements for that protocol. First establish whether your workflow is sending continuous RTMP or using HLS. Their settings are not interchangeable.

YouTube’s cited HLS setup requirements are specifically for HLS ingestion. Its HLS setup guidance calls for TS segments, segment durations between one and four seconds, a rolling playlist with no more than five outstanding segments, and the documented HTTPS delivery behaviour. These are HLS requirements, not settings to apply to an RTMP output. YouTube also describes HLS as higher latency than continuous RTMP. Check the official page before configuring a live workflow because protocol guidance can change.

The example command patterns sometimes shown for concat use an RTMP-shaped output. They are illustrative only, not a complete YouTube encoder configuration and not evidence that the inputs, codecs, output URL or stream key are correct for your setup. Use the actual ingest URL securely, keep the stream key private, and select output options for the protocol and media you have. Do not paste the key into public logs, article comments or a support ticket.

If FFmpeg opens every file and produces an output, but YouTube does not receive it as expected, capture the output-side error without credentials and confirm the selected ingest mode in YouTube Studio. The troubleshooting article on an encoder sending the wrong audio sample rate is a reminder that stream properties can be an ingest concern distinct from file lookup. It is not a substitute for checking the protocol-specific official instructions.

Make the fix repeatable for the overnight loop

Once the playlist works manually, preserve the conditions that made it work. Keep the playlist in a stable directory, use a known working directory in any scheduled launch, and run the command as the same Ubuntu account that will operate it unattended. Record the location and the exact playlist filename in your runbook. A later move of the playlist can invalidate relative entries even if the media files remain untouched.

For a portable setup, keep the playlist alongside the clips, use simple relative filenames, and retain the default safety policy. For a setup that deliberately references files elsewhere, maintain explicit paths, trust the playlist’s source, and use the safety override only where required. In either case, re-check access after changing ownership, deployment directories or the account used to launch FFmpeg.

If the promo rotates to a new campaign, test the revised playlist with the actual launch user before relying on it overnight. That catches the common gap between a developer’s home directory and the directory available to an automated process. Keep path validation, media inspection and YouTube ingest validation as three separate checks in the handover notes.

When a persistent playlist is too much operational work, a cloud-based file loop may remove the need to keep a local Ubuntu process and its file paths alive: StreamNeo lets you upload the video once and run the YouTube broadcast with your computer off. It is YouTube-only, so it does not change the need to choose compatible content or verify the channel and broadcast setup.

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

What does “Unsafe file name” mean in a concat playlist?

It generally means the concat demuxer’s default safety check rejected the path form before opening the media. Check whether the entry is absolute or contains a component that does not meet the documented safe-path rules. If the path is intentional and trusted, you can consider the input safety option; otherwise prefer a safe relative path.

Why does a relative filename work in my terminal but not in the playlist?

The entry is resolved in relation to the playlist’s effective location, which may not be the shell’s current directory. Put the playlist beside the clips or write the relative path from the playlist directory. A dynamically supplied playlist, including one delivered through process substitution, can have a different effective location.

Will -safe 0 fix “No such file or directory”?

No. It bypasses concat path screening for trusted entries; it does not change where a relative path resolves, create a missing file, or correct a spelling mismatch. Confirm the playlist location and check that the same user running FFmpeg can read the exact file.

My files open, but the YouTube stream fails. Is the playlist path still wrong?

Not necessarily. Once FFmpeg has opened the inputs, investigate stream compatibility and output configuration separately, then confirm whether the channel uses RTMP or HLS. Apply YouTube’s HLS requirements only when HLS is selected, and consult the current official guidance for that protocol.

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 ↗