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

To create a one-hour looped file from a local nature ambience video on Ubuntu, run:

ffmpeg -stream_loop -1 -i input.mp4 -t 01:00:00 -map 0 -c copy output.mp4

Replace the filenames and duration as needed. -stream_loop -1 repeats the input indefinitely; -t limits the output to one hour. The command requests all input streams and copies them without re-encoding, provided the streams and output container are compatible.

What the command does

  • -stream_loop -1 repeats the input indefinitely. The option belongs before the corresponding -i because it applies to the input. Use -stream_loop 0 for no looping. See the FFmpeg command-line documentation.
  • -i input.mp4 identifies the source file.
  • -t 01:00:00 sets the output duration to one hour. Change it to the length you want.
  • -map 0 requests all streams in the input, which may include video, audio, subtitles, or multiple tracks.
  • -c copy asks FFmpeg to copy streams rather than decode and re-encode them. It avoids another lossy encode, but works only when the streams and output container are compatible.
  • output.mp4 is the new file. Choose an extension and container suitable for the streams and the player that will use it.

Make an output that keeps playing until stopped

For a finite file, keep -t and set the length you want. For a workflow that should continue until you stop it, omit -t and send FFmpeg to an appropriate output or player workflow. Do not leave an ordinary file output running without a stopping condition unless you intend the file to keep growing. There is no single command that is safe for every live display or player configuration.

Choose between streamcopy and re-encoding

Use streamcopy when the existing streams are suitable

Keep -c copy when the source streams can be placed in the chosen output container and the target player supports them. Streamcopy avoids decoding and re-encoding, so it is usually the simpler choice for making a looped copy without changing formats.

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.
#1 Best Overall
Tim Janis Soothing Sounds of Nature Audio Relaxation, Meditation, Sleep & Stress Relief - Tranquil Nature Sounds, Relaxing Music CD, Calming Music CD & Spa Ambiance for Meditation, Yoga & Deep Restful Sleep
  • TRANQUIL NATURE SOUNDS: Experience the soothing embrace of Tim Janis' nature sounds CD. Let the calming melodies transport you to serene landscapes, offering a natural remedy for relaxation.
  • MEDITATIVE ESCAPE: Elevate your meditation journey with this guided meditation CD. Immerse yourself in the harmonious tunes that create an ambiance of calm, enhancing your mindfulness practice.
  • RESTFUL SLEEP AID: Drift into deep slumber with sleep music designed for restful sleep. Let the gentle melodies lull you into tranquility, promoting a peaceful and rejuvenating night's rest.
  • CALMING SPA AMBIANCE: Transform your space into a spa-like haven with calming music that melts away stress and anxiety. Create your own oasis of relaxation and serenity, whether you're unwinding after a long day or practicing yoga.
  • STRESS RELIEF THROUGH MUSIC: Embrace the power of music as a calming force in your life. This relaxation CD offers a collection of relaxing melodies that provide relief from the pressures of the day, fostering a sense of inner peace and well-being.

Re-encode when compatibility requires it

If the output container cannot carry a stream or the destination cannot play it, remove -c copy and select suitable encoders and settings for your installed FFmpeg build and target. Check the available encoders with the local FFmpeg documentation; exact choices depend on the source, output format, and playback device. FFmpeg’s FAQ discusses concatenation approaches, but joining arbitrary files may require matching or preparing their stream properties.

Check whether the loop sounds and looks seamless

The loop option repeats the source; it does not create a crossfade or repair a break between the last and first frame or audio sample. Play the output across the loop boundary and listen for clicks or abrupt ambience changes, and watch for a visual jump or audio/video timing mismatch. If the transition is distracting, edit the source boundary or use a suitable transition workflow. A loop flag alone cannot guarantee a seamless result.

Rank #2
Sale
Deep Relaxation Nature Sounds 4 Album Set - for Meditation, Relaxation and Sleep - Nature's Perfect White Noise
  • Relaxation and Sleep Support: Relax your body and calm your mind with these relaxation and sleep CDs designed to promote restful sleep and stress relief
  • Authentic Nature Recordings: Includes the sounds of rain and thunder, calming forest sounds, singing songbirds, and soothing guitar with ocean waves with tracks that are continuous recordings and are not looped
  • Music Therapist Developed: Developed by a music therapist who gives a percentage of profits to help kids with cancer
  • Premium Quality Manufacturing: High quality CDs NOT made in China - Unlike cheaper CDs like CD-Rs, this CD will work in all players
  • Thoughtful Gift Packaging: Gift quality packaging makes a thoughtful gift for those with stress, anxiety or insomnia

Check your Ubuntu FFmpeg version

Ubuntu releases ship different FFmpeg builds. Ubuntu Jammy’s manual identifies package build 7:4.4.2-0ubuntu0.22.04.1; that version identifier applies to that release-specific package reference, not to every Ubuntu installation. The FFmpeg project notes that its regenerated documentation corresponds to the newest revision and directs users of older revisions to their installed documentation. On your machine, check:

ffmpeg -version
man ffmpeg

Confirm that the option and any encoder names you plan to use are documented for your installed build. The FFmpeg manual is useful for option behavior, but the local manual is the relevant reference when your package is older.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Relaxing Nature Sounds 4 Album Set - for Meditation, Relaxation and Sleep - Nature's Perfect White Noise
  • Relaxation and Sleep Support: Relax your body and calm your mind with these relaxation and sleep CDs designed to promote restful sleep and stress relief
  • Authentic Nature Recordings: Includes the sounds of calming ocean waves, a peaceful stream, relaxing rain and soothing guitar, with tracks that are continuous recordings and are not looped
  • Created by Music Therapist: Developed by a music therapist who gives a percentage of profits to help kids with cancer
  • Premium Quality Manufacturing: High-quality CDs made in the USA - Unlike cheaper CDs like CD-Rs, this CD will work in all players
  • Thoughtful Gift Packaging: Gift quality packaging makes a thoughtful gift for those with stress, anxiety or insomnia

Troubleshoot common problems

  • The clip plays only once: Check that -stream_loop -1 appears before the input’s -i option and is attached to the correct input.
  • The output runs longer or shorter than expected: Check the value passed to -t; it controls the output duration.
  • FFmpeg errors when copying streams to MP4: The source streams may not be suitable for that container. Try a compatible output container, or remove -c copy and choose suitable encoders.
  • Subtitles, audio tracks, or other streams are missing: -map 0 requests all input streams, but the output container and target player may not support every stream. Check the source’s streams and the destination’s compatibility.
  • The loop has a click, jump, or pause: Repetition does not smooth the boundary. Inspect the ending and beginning of the source and edit the transition if needed.
  • An option or encoder is unrecognized: Check ffmpeg -version and man ffmpeg on the target Ubuntu machine; package versions and available features differ.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or let it run in the cloud

If your goal is a 24/7 YouTube ambience stream rather than a local looped file, StreamNeo is a cloud option: upload your recording or build a playlist, add your YouTube stream key, and go live. Your computer and home connection do not have to stay on. It automatically recovers if YouTube drops the stream, and accepts uploads as made up to 4K 60fps for one flat price per slot, with no re-encode or quality tiers. The first day is free with no card required; it is one free day per account. The monthly option is $9.99 per month. StreamNeo streams to YouTube only and plays uploaded videos rather than going live from a camera. Start at StreamNeo’s free trial signup.

Rank #4
Sale
Calming Forest Sounds - Soothing Nature Ambience for Stress Relief, Meditation and Creating a Peaceful Environment - Natural White Noise
  • Helps you relax and find peace with over 1 hour of calming forest sounds with songbirds and a gentle stream in the background.
  • Creates white noise to drown out household sounds.
  • No annoying loops, jarring sounds, or cheesy music. Just the pure sounds of nature.
  • Gift quality packaging. Makes an elegant and thoughtful gift. Helps anxiety and stress.
  • This CD is a professional, high quality CD made in the USA and will work in all players.

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.