If FFmpeg reports Unsafe file name, its concat demuxer is rejecting a playlist entry under its default path-safety rules. If it reports No such file or directory, the entry is not resolving to a readable file from the playlist’s effective location. Use safe relative paths where possible; for trusted absolute paths, put -safe 0 before -i. Then check media compatibility and YouTube’s ingest protocol separately: a path fix does not solve either one.
First identify which path problem you have
Unsafe file name: the concat demuxer’s defaultsafe=1validation is rejecting an entry. Absolute paths, protocol-like entries, or path components outside its permitted portable-character rules can trigger this.No such file or directory: FFmpeg cannot find the file at the location implied by the playlist entry, or the name differs. The path may be relative to a different directory than you expect.- A different read or decode error: the path may resolve, but the file could be unreadable, damaged, or incompatible with the other clips. Diagnose those only after path resolution succeeds.
Make the playlist paths resolve
1. Put the playlist beside the promo clips
A persistent playlist stored beside its media makes safe relative paths straightforward. For example, if playlist.ffconcat, promo-01.mp4, and promo-02.mp4 are in /home/ubuntu/shop-promo/, the playlist can be:
As an Amazon Associate I earn from qualifying purchases.
ffconcat version 1.0
file 'promo-01.mp4'
file 'promo-02.mp4'
Keep ffconcat version 1.0 as the first line when using this header. Each file directive names one input. With the default safety check enabled, use relative paths whose components meet FFmpeg’s safe-name rules: no protocol specification, no leading period in a component, and only the permitted portable characters. Simple names using letters, digits, underscores, and hyphens avoid many portability problems.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute2. If the media is elsewhere, choose a deliberate path strategy
Either store the playlist where its relative entries make sense, or use absolute entries for files in another directory. For example:
#1 Best Overall
ffconcat version 1.0
file '/home/ubuntu/shop-promo/promo-01.mp4'
file '/home/ubuntu/shop-promo/promo-02.mp4'
Absolute paths are rejected by the default safety check. For a playlist you created and trust, disable that check with -safe 0 as an input option before -i. This bypasses path screening; do not use it casually with a playlist whose contents come from an untrusted source.
3. Handle spaces and special characters using concat-script syntax
Quote or escape whitespace and special characters according to FFmpeg’s concat-script rules. The quotes in file 'promo-01.mp4' are part of that script syntax, not shell quoting. If a filename contains an embedded single quote, escape it using the concat demuxer’s quoting rules rather than assuming ordinary shell escaping will work. Renaming promo files to simple names can be the clearest way to avoid mistakes.
Rank #2
4. Check every entry and its permissions
- Confirm each playlist name exactly matches a file, including capitalization and extension.
- Confirm the files are in the directory implied by the paths.
- Run FFmpeg as a Ubuntu user that can read both the playlist and every listed clip.
- Use a persistent playlist file while diagnosing. Process substitution can give the playlist a temporary effective location, changing the base for relative paths; a path that worked beside a saved playlist may then fail.
Use the matching FFmpeg command
For a persistent playlist beside the clips with safe relative entries, an illustrative RTMP-shaped command is:
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →ffmpeg -re -stream_loop -1 -f concat -i playlist.ffconcat -c copy -f flv "$YOUTUBE_RTMP_URL"
For a trusted playlist with absolute entries, use:
ffmpeg -re -stream_loop -1 -f concat -safe 0 -i playlist.ffconcat -c copy -f flv "$YOUTUBE_RTMP_URL"
-safe 0 must precede -i because it is an input option. These examples illustrate path handling and an RTMP-shaped output, not a tested, complete YouTube encoder configuration. Set the output URL and encoding to match the actual YouTube ingest method and source media. Keep the stream key private: do not paste it into public scripts, logs, or support posts.
Rank #3
Check media compatibility after paths work
The concat demuxer joins files by reading their streams; a valid path does not guarantee that the streams can be concatenated with -c copy. Inspect the clips’ stream layouts and codecs if FFmpeg errors after opening them. Stream-copy concat is suitable only when the streams are compatible. If they differ and need normalization or re-encoding, the concat filter is the more flexible route; it requires a filter-and-encoding workflow rather than simply changing the path or adding -safe 0.
Confirm whether YouTube ingest is RTMP or HLS
Do not apply HLS-specific output settings to an RTMP command just because both are YouTube ingest options. The examples above are RTMP-shaped. YouTube’s cited HLS requirements apply specifically when you select HLS ingestion: use TS segments, segment durations of 1–4 seconds, and a rolling playlist with no more than five outstanding segments. HLS also uses an HTTPS stream URL and has higher latency than continuous RTMP. Confirm the ingest protocol and configure its output accordingly; playlist path repair alone does not determine those settings.
Rank #4
Troubleshoot by symptom
| Symptom | Likely cause | What to check or change |
|---|---|---|
Unsafe file name |
An entry is outside the concat demuxer’s default safe-path rules. | Prefer safe relative paths, or for a trusted playlist put -safe 0 before -i. |
No such file or directory |
The entry does not resolve from the playlist’s effective location, or its name is wrong. | Use a persistent playlist beside the clips, correct the relative path, or use the intended absolute path; check spelling and capitalization. |
| Paths work in a saved playlist but not with process substitution | The playlist’s effective location changed, so its relative paths now have a different base. | Use a persistent playlist file or rewrite entries for the effective playlist location. |
| FFmpeg opens files but fails while concatenating | The media streams may not be compatible for stream-copy concat. | Compare stream layouts and codecs; use the concat filter if re-encoding or normalization is required. |
| YouTube rejects the outgoing stream | The output may not match the selected ingest protocol, or another ingest setting may be wrong. | Check RTMP versus HLS before changing output settings. Apply the TS segment and rolling-playlist requirements only to HLS. |
Or let it run in the cloud
If the goal is to keep a pre-recorded shop promo looping on YouTube, StreamNeo is a cloud alternative to running FFmpeg on an Ubuntu machine: upload the video or build a playlist, add your YouTube stream key once, and go live. Nothing has to stay on at home; it plays uploaded videos, not a live camera feed. Every slot streams the upload as made, up to 4K 60fps, at one flat price per slot, with no re-encode or quality tiers. It can automatically recover if YouTube drops the stream. The first day is free with no card, once per account. The monthly option is $9.99 per month.
Quick Recap
Best Value
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.




