You can use cron on Ubuntu to start an encoder at India-local times, but cron schedules commands—not YouTube broadcasts. First prepare each broadcast in YouTube Studio, then configure a script to send the right local media playlist to its stream URL and key. If “playlist” means a YouTube playlist rather than local files, that is a different workflow: a regular YouTube playlist is not itself a scheduled live broadcast.
Know what you are scheduling
This setup has two separate parts: YouTube’s broadcast schedule and Ubuntu’s job schedule. YouTube Studio prepares a scheduled live event; cron starts local software at a chosen time. Starting FFmpeg does not, by itself, guarantee that the scheduled broadcast is live. YouTube’s documented encoder flow is to start the encoder, wait for the preview in Live Control Room, and select “Go live.” See YouTube’s encoder setup instructions.
Here, a “stream playlist” means local media files sent in sequence by an encoder. FFmpeg documents ways to concatenate local files, but that is not the same as scheduling a YouTube channel playlist as a live broadcast. YouTube’s Live Streaming API manages broadcast and stream resources; it does not establish that an ordinary video playlist can be scheduled as a live event. See the YouTube Live Streaming API overview.
Prepare each YouTube broadcast and stream key
- In YouTube Studio, open Live Control Room and create or schedule a broadcast for each event you need. Set its title, visibility, start time, and other event details there.
- For each broadcast, identify the encoder server URL and stream key provided by YouTube. Use RTMPS where available; YouTube recommends it in its encoder settings guidance.
- Decide how the event will transition from encoder preview to live. If a person will click “Go live,” cron can start the encoder but does not make the entire process unattended. If you need unattended event management, YouTube’s API is a separate development path for scheduling and associating broadcasts with stream resources.
- Keep stream keys private. Do not put a real key in a public script, repository, or article. Restrict access to configuration files and use the account and permissions appropriate to your setup.
Choose how to play local files in sequence
FFmpeg offers two main concat approaches; select based on the actual files and whether you can avoid re-encoding. Its FAQ on concatenating video files explains both methods.
#1 Best Overall
- Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
- Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
- CanaKit Turbine Black Case for the Raspberry Pi 5
- CanaKit Low Noise Bearing System Fan
- Mega Heat Sink - Black Anodized
| Approach | Best fit | Trade-off |
|---|---|---|
| Concat demuxer | Inputs have compatible media parameters and the chosen container/input combination supports concatenation. | Can avoid re-encoding, but incompatible files may fail or produce poor transitions. |
| Concat filter | Inputs need processing or re-encoding as part of joining. | Designed for concatenation when re-encoding is needed; encoding consumes resources and can change output quality. |
Test the selected method with the actual media before scheduling it. A playlist can either run once and stop or repeat; specify that behavior in your script and verify the encoder’s exit and stop behavior. There is no universal concat or streaming command that can be safely prescribed without knowing the files, formats, output settings, and encoder workflow.
Configure encoder output for YouTube
Set the encoder to use the broadcast’s server URL and stream key, then select settings supported by the source media, the machine, and the available upload connection. YouTube lists H.264 among supported video codecs and AAC or MP3 audio for RTMP/RTMPS. Its guidance recommends a two-second keyframe interval and says not to exceed four seconds. Use YouTube’s current encoder settings, bitrates, and resolutions guidance for resolution-specific bitrate values rather than assuming one bitrate fits every stream.
Rank #2
- Includes Raspberry Pi 5 16GB with 2.4Ghz 64-bit quad-core CPU (16GB RAM)
- Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
- CanaKit Turbine Black Case for the Raspberry Pi 5
- CanaKit Low Noise Bearing System Fan
- Mega Heat Sink - Black Anodized
These are YouTube’s published encoder recommendations, not a verified FFmpeg command for your particular playlist. Confirm your chosen encoder’s option names and test a private or unlisted broadcast before relying on a schedule.
Set up a cron job in India time
A crontab entry has five time fields—minute, hour, day of month, month, and weekday—followed by the command. Cron checks entries every minute, and a user’s jobs run as that crontab’s owner. The Ubuntu Noble crontab manual documents these details and `CRON_TZ`; the Ubuntu Jammy manual documents the classic cron syntax. Support for timezone settings depends on the installed cron implementation and release.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- CanaKit Raspberry Pi 5 Essentials Starter Kit
India uses the IANA time zone name Asia/Kolkata. If the installed cron supports a per-crontab timezone, an illustrative crontab could look like this:
CRON_TZ=Asia/Kolkata
15 8 * * 1-5 /home/streamer/bin/start_playlist_a.sh >> /home/streamer/logs/playlist_a.log 2>&1
45 20 * * 1-5 /home/streamer/bin/start_playlist_b.sh >> /home/streamer/logs/playlist_b.log 2>&1
This example shows separate weekday jobs and separate logs only; it is not a tested stream command. Replace the times and paths. Before relying on `CRON_TZ`, check the installed package and its manual. Ubuntu Noble’s cited manpage identifies cronie 1.7.1-1; the Jammy page identifies cron 3.0pl1-137ubuntu3, so do not assume the same timezone feature across releases. If per-table timezone support is absent or uncertain, deliberately set the host timezone and verify the schedule with a harmless logging job. Log timestamps may use the daemon’s timezone rather than the schedule timezone.
Rank #4
- All-in-One Complete Kit: This SANOOV RPi 5 bundle comes with Raspberry Pi 5 4GB RAM single board, active cooler, durable ABS case and screwdriver. No extra parts needed, ready to use right out of the box for beginners and hobbyists
- Powerful Single Board Computer: Equipped with 4GB RAM and high-performance processor, delivers fast running speed for 4K playback, AI projects, programming and daily computing tasks. SANOOV for raspberry pi 5 4GB is equipped with broadcom 64 quad-core Arm Cortex A76 processor with gigabit ethernet and upgraded with IEEE 802.11ac Wi-Fi, Bluetooth 5.0 dual-band 2.4Ghz and 5Ghz and Power Over Ethernet (POE). Upgrading delivers 2-3 x speed vs Pi 4, redefining the experience
- Efficient Active Cooler: Effectively lowers operating temperature and prevents performance throttling. Runs quietly even under long-time heavy load, ensures stable operation all day long. SANOOV RPi 5 4GB kit offer an active cooler, which combines an aluminium heatsink with a high-performance PWM fan. Active cooler is fully compatible with the Pi OS, which can effectively reduce the temperature of RPi5 and ensure its good performance during long-term high load operation
- Sturdy ABS Protective Case: Well-fitted for Raspberry Pi 5 board, can be secured with 4 screws to effectively protect the Pi 5 motherboard from damage, reserves full access to all ports and buttons. SANOOV uses ABS material to produce the case, which has a softer texture and feel. Meanwhile, SANOOV case adopts a layered design for easy disassembly and installation. (Tip: The Case cannot install M.2 HAT Add on Board and Solid State Drive!)
- Wide Application & Full Compatibility: Seamlessly compatible with official OS and mainstream peripheral accessories for Raspberry Pi 5. Whether you are a beginner, student, electronics hobbyist or professional developer, this all-in-one kit meets your diverse needs. It excels in IoT projects, robotics design, retro gaming devices, home media servers and other DIY creations. Backed by a large global community, you can easily find guides, technical support and shared projects online
Be careful when using both day-of-month and weekday fields: in ordinary cron semantics, when both are restricted, either matching field can trigger the job. Also remember cron’s environment is more limited than an interactive shell. Scripts should use stable absolute paths and explicitly define required environment variables.
Organize multiple playlists and schedules
For a small number of independent streams, use one script and cron entry per playlist. A dispatcher script can instead choose a playlist based on a schedule or configuration file. The right design depends on whether streams overlap, whether they use separate broadcasts and keys, and whether the host has enough CPU, memory, and network capacity.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, 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 minuteBest Value
- 【What you Get】You will get 1*Pi 5 8GB Single Board,1*RasTech Case,1*Active Cooler,1*Screwdriver,1*Installation instructions,12-month free warranty, lifetime service, 24-hour prompt and friendly response.
- 【More Connectors】There are two USB 3.0 ports(5Gbps simultaneously) and two USB 2.0 ports, which triple total bandwidth ,support any combination of up to two cameras or displays. Peak SD card performance is doubled through support for the SDR104 high-speed mode. It provides a smooth desktop experience for you. Offer Gigabit Ethernet and a PCIe interface, along with dual-band Wi-Fi and Bluetooth 5.0/BLE wireless capability. The RasTech Pi 5 Kit use the new 27W 5.1V 5A USB-C power connector.
- 【 Support Dual 4Kp60 Display 】Each of the two microHDMI sockets can control a 4K display at 60 Hertz, now support HDR, offering super HD video for media streaming projects. RPi 5 is the first RPi model that comes with a PCI Express port (PCIe 2.0 x1 with 500 MB/s) to attach SSDs (requires separate M.2 HAT).
- 【 Excellent Chips And Applications】Pi 5 is a full-size Pi computer using silicon built in-house at Pi. The RP1 “southbridge” provides the bulk of the I/O capabilities for Pi 5. Pi 5 is more friendly and convenient in the development of Internet of Things, Web development, machine identification, automatic control and other electronic equipment applications and network.
- 【 Faster CPU, Better GPU 】 Pi 5 features a Broadcom BCM2712 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz, it delivers a 2–3× increase in CPU performance relative to RaspberryPi 4. The 800MHz VideoCore VII GPU is compatible to OpenGL ES 3.1 and Vulkan 1.2, substantial uplift in graphics performance. Pi 5 Offers lightning-fast CPU speed, a PCI Express interface, a Real Time Clock (RTC) and a power button and runs significantly cooler than Pi 4.
- Give each job an explicit playlist, output configuration, log, and expected stop condition.
- Check whether two jobs could run at once; schedule them intentionally and test overlap rather than assuming the machine or channel setup can handle it.
- Prevent accidental duplicate encoder processes, and decide how a job should behave if its previous run is still active.
- Test each stream separately before enabling the full schedule. Confirm both the encoder output and the broadcast state in Live Control Room.
Those are operational design checks, not guarantees supplied by cron. Cron starts a command on schedule; it does not verify that the encoder connected, YouTube accepted the stream, or the broadcast transitioned live.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Logging, failure handling, and stopping
Redirect standard output and errors to a per-job log, as in the example, and inspect the log after a test run. Have scripts report failures with a nonzero exit status and record enough information to identify the playlist, start time, and encoder result. Decide how you will detect a failed connection and whether a human or separate automation will retry it; a scheduled cron entry alone is not a recovery system.
Define how each encoder stops: after one pass, after a fixed duration, or through an explicit stop action. Test that behavior so an old process does not overlap the next scheduled run. YouTube says streams under 12 hours are automatically archived; do not treat that as an archiving guarantee for longer broadcasts. For any unattended schedule, test the full handoff—from scheduled event and encoder launch through stopping—before using it for a public stream.
Common problems and fixes
- The job runs at the wrong local time: verify the host timezone and installed cron version; confirm whether `CRON_TZ=Asia/Kolkata` is supported, then check with a harmless timestamp-writing job.
- The script works manually but fails in cron: use absolute executable and media paths, define needed environment variables, and capture both output and errors in the log.
- YouTube shows no encoder preview: check that the script uses the correct broadcast’s server URL and stream key, that the encoder is running, and that the host can reach YouTube. Confirm connection errors in the log.
- The encoder preview appears but the event is not live: check the Live Control Room transition. Starting the encoder and going live are distinct steps in YouTube’s documented workflow.
- Concatenation fails or playback changes at a join: validate file compatibility and test the concat demuxer or concat filter with those exact inputs; re-encoding may be necessary.
- Two scheduled streams interfere: review overlapping cron times, duplicate-process handling, and available host resources; test the intended concurrent workload.
- A stream keeps running into the next schedule: inspect the stop condition and process lifecycle in the script, then test a complete run and shutdown before enabling recurring jobs.
Or let it run in the cloud
If the goal is simply to keep uploaded videos playing as a YouTube live stream, StreamNeo is an alternative to running Ubuntu, cron, and an encoder yourself. Upload a recording or build a playlist, add your YouTube stream key once, and go live. StreamNeo loops the uploaded video from the cloud, so nothing has to stay on at home. It streams the upload as made, up to 4K 60fps, at one price per slot; it can recover automatically if YouTube drops the stream. The first day is free with no card. Monthly pricing is $9.99 per month. See StreamNeo, or start your free day.
Quick Recap
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.

