Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
1 answers
54 views
how do I run ffmpeg so that it creates a video - an mp4 that runs in a loop and an mp3 that runs in the background?
I have been trying to do something I thought relatively simple with ffmpeg. I have two files: an MP4 and an MP3. The MP4 is short, the MP3 is long. The MP4 is silent. I want to create a video that runs the MP4 in a loop while playing in the background the MP3 (just once). So the length of the new vi...
I have been trying to do something I thought relatively simple with ffmpeg. I have two files: an MP4 and an MP3. The MP4 is short, the MP3 is long. The MP4 is silent. I want to create a video that runs the MP4 in a loop while playing in the background the MP3 (just once). So the length of the new video is the length of the MP3. I tried multiple things with ffmpeg, but nothing works. I generate a short video always without sound. This is the latest command I tried that was the closest I could understand to "should work": ffmpeg -stream_loop 1 -i silent-video.mp4 -i audiofile.mp3 -c:v copy -c:a aac -b:a 192k -preset:v fast output_video_with_multiple_video_loops.mp4
canister (11 rep)
Jan 11, 2025, 01:39 PM • Last activity: Jan 11, 2025, 05:34 PM
1 votes
2 answers
807 views
How to crop a particular part of a YouTube video clip?
Having an MPEG4 (MP4 container, H264 AVC video, AAC audio) video clip downloaded from YouTube, how to crop a particular piece of it (remove everything before a particular starting point timestamp an after a particular finish point timestamp) with free Linux tools? PS: I don't mind employing a patent...
Having an MPEG4 (MP4 container, H264 AVC video, AAC audio) video clip downloaded from YouTube, how to crop a particular piece of it (remove everything before a particular starting point timestamp an after a particular finish point timestamp) with free Linux tools? PS: I don't mind employing a patented or even a BLOB codec library.
Ivan (18358 rep)
Apr 11, 2012, 07:09 PM • Last activity: Jan 1, 2025, 09:50 PM
0 votes
0 answers
10 views
How to change which language you're editing subtitles for in Subtitld?
I'm trying to edit subtitles with Subtitld from Flatpak. It opens the .mkv file correctly, but it's editing the first language available alphabetically (Arabic). How can I change it so it opens the English subtitles? [![Screenshot of Subtitld UI][1]][1] [1]: https://i.sstatic.net/FPigehVo.png I don'...
I'm trying to edit subtitles with Subtitld from Flatpak. It opens the .mkv file correctly, but it's editing the first language available alphabetically (Arabic). How can I change it so it opens the English subtitles? Screenshot of Subtitld UI I don't see an option in the settings or anything on their website
Dr-Bracket (437 rep)
Nov 6, 2024, 04:37 AM
1 votes
1 answers
56 views
Cutting video based on the spectrogram of its audio
I have a lot of video footage. I want to cut interesting parts into a smaller video. I have found the best way to find interesting parts is looking at the spectrogram of the audio and find regions with interesting patterns in it (eg. the talking part, the music part, silence etc.). Currently I'm usi...
I have a lot of video footage. I want to cut interesting parts into a smaller video. I have found the best way to find interesting parts is looking at the spectrogram of the audio and find regions with interesting patterns in it (eg. the talking part, the music part, silence etc.). Currently I'm using Audacity, I load the audio of the video in there, scroll through the spectrogram, select the interesting part. But Audacity does not have a feature to copy the selection start and length times to clipboard. So I have to look at the selection toolbar and manually copy the timestamps into a text file, then I use a script that turns that into an ffmpeg command line to cut the video. Needless to say this is time consuming and is very error prone. There must be a better way to do this. So I'm looking for either a video editor that allows me to load the footage and then switch to spectrogram view to pick the interesting parts. This would be nice because sometimes it would be nice to see the image too to make a better cut. Or an audio editor with spectrogram view that allows me to copy selection timestamps to the clipboard in a format that ffmpeg understands. That would faster and less error prone, than manually copying them.
Calmarius (645 rep)
Nov 4, 2024, 11:00 AM • Last activity: Nov 4, 2024, 11:37 AM
0 votes
1 answers
225 views
Trimming a video using FFmpeg leads to black screen
I try to figure out how to use FFmpeg to trim videos. I have created a 30 second `.mov` screen capture using Apple's QuickTime player, and then tried to trim it using three different ways: 1. Using `-copyts`, without re-encoding ``` ffmpeg -copyts -ss 00:00:10 -i input.mov -to 00:00:15 -map 0 -c cop...
I try to figure out how to use FFmpeg to trim videos. I have created a 30 second .mov screen capture using Apple's QuickTime player, and then tried to trim it using three different ways: 1. Using -copyts, without re-encoding
ffmpeg -copyts -ss 00:00:10 -i input.mov -to 00:00:15 -map 0 -c copy output.mov
2. Using -copyts, with re-encoding
ffmpeg -copyts -ss 00:00:10 -i input.mov -to 00:00:15 -c:v libx264 -crf 23 -c:a aac -b:a 192k output.mov
3. Using -trim (with re-encoding, which is the only option):
ffmpeg -i input.mov -vf trim=10:15 output.mov
No matter which approach I tried, the output video is always 15 seconds long and the first 10 seconds of that is just a black screen, whereas what I expected is a 5-second video and without the black screen. All the three solutions are from here: https://superuser.com/questions/377343/cut-part-from-video-file-from-start-position-to-end-position-with-ffmpeg (answers by [@slhck](https://superuser.com/users/48078/slhck) and [@malat](https://superuser.com/users/106444/malat)) , and are very high-voted, so I expect they should work without issues, but they don't. Why is that? Is there a problem with the commands, or with the video? The video is uploaded here: https://github.com/jsx97/test/blob/main/input.mov
jsx97 (1347 rep)
Jun 11, 2024, 03:35 PM • Last activity: Jul 14, 2024, 02:11 AM
1 votes
1 answers
171 views
FFmpeg: To trim a video using 'trim' and specify time using HH:MM:SS format
FFmpeg 7.0.1. I want to understand whether it is possible to trim a video using `trim` and to specify start and end time using the HH:MM:SS format instead of just seconds. That is, the following command trims a video from 5s to 10s: ``` ffmpeg -y -i input.mp4 -vf trim=5:10,setpts=PTS-STARTPTS output...
FFmpeg 7.0.1. I want to understand whether it is possible to trim a video using trim and to specify start and end time using the HH:MM:SS format instead of just seconds. That is, the following command trims a video from 5s to 10s:
ffmpeg -y -i input.mp4 -vf trim=5:10,setpts=PTS-STARTPTS output.mp4
But if I try to specify start and end time using HH:MM:SS format, FFmpeg returns an error:
ffmpeg -y -i input.mp4 -vf trim='00:00:05':'00:00:15',setpts=PTS-STARTPTS output.mp4
ffmpeg -y -i input.mp4 -vf trim=00\:00\:05:00\:00\:15,setpts=PTS-STARTPTS output.mp4
> Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used) Is it possible to fix it? (A guy on Super User suggested trim='00\:00\:05':'00\:00\:15' or trim=00\\:00\\:05:00\\:00\\:15, but I receive the same error message.) **Side questions** - To keep the first 5 seconds and drop everything else, I can use ffmpeg -i input.mp4 -vf trim=end=5 output.mp4. But how to keep only the last 5 seconds? - To drop frist 5 seconds, I can use ffmpeg -i input.mp4 -vf trim=start=5,setpts=PTS-STARTPTS output.mp4. But how to drop the last 5 seconds?
jsx97 (1347 rep)
Jun 19, 2024, 07:54 AM • Last activity: Jul 1, 2024, 07:37 AM
0 votes
1 answers
38 views
FFmpeg: The option 'to' works differently depending on where we put it. Why is it so?
Could anybody explain, why ``` ffmpeg -i input.mov -ss 00:00:10 -to 00:00:15 output1.mov ``` produces a 5-second video, from second 10 to second 15, whereas ``` ffmpeg -ss 00:00:10 -i input.mov -to 00:00:15 output2.mov ``` produces a 15-second video, from second 10 to second 25?
Could anybody explain, why
ffmpeg -i input.mov -ss 00:00:10 -to 00:00:15 output1.mov
produces a 5-second video, from second 10 to second 15, whereas
ffmpeg -ss 00:00:10 -i input.mov -to 00:00:15 output2.mov
produces a 15-second video, from second 10 to second 25?
jsx97 (1347 rep)
Jun 14, 2024, 07:57 AM • Last activity: Jun 14, 2024, 08:36 AM
1 votes
1 answers
54 views
Rendering video with Blender on Pop!_os
I have been using blender as a video editor for a few years now, but it has always rendered very slowly. I worry that I've installed a few too many drivers and something has gotten mixed up at some point. For unrelated reasons, I'm about to do an OS re-install so I will have a clean Pop!_os installa...
I have been using blender as a video editor for a few years now, but it has always rendered very slowly. I worry that I've installed a few too many drivers and something has gotten mixed up at some point. For unrelated reasons, I'm about to do an OS re-install so I will have a clean Pop!_os installation with the default video drivers (mesa, if I'm not mistaken). 1. What version of blender should I install? 2. What drivers should I install, if any, for my Radeon RX 5600 gpu?
JonesCode (13 rep)
Mar 20, 2024, 01:07 PM • Last activity: Mar 20, 2024, 01:53 PM
0 votes
2 answers
199 views
simplest non-raid way of pooling nvme ssd drives on a single node - glusterfs?
We are putting together a RHEL OS video editing server which is fully nvme-ssd based. It needs to be high thoughput and very low latency. RAID controllers kill the speeds. Commercial software RAID (xiRAID) is available and in our tests works well. However, I don't see the need for the complexity and...
We are putting together a RHEL OS video editing server which is fully nvme-ssd based. It needs to be high thoughput and very low latency. RAID controllers kill the speeds. Commercial software RAID (xiRAID) is available and in our tests works well. However, I don't see the need for the complexity and inflexibility of RAID when individual disks are fast enough to have full files on individual drives. Unraid and MergerFS look good, but our management is not happy to base a production server on a one-man open source project. How about GlusterFS? I can't find any references to people running this on a single node. We don't want a distributed file system, we just want pooled storage on a single node with optionally some parity for redundancy.
swami (205 rep)
Dec 9, 2023, 01:40 PM • Last activity: Dec 10, 2023, 09:50 AM
0 votes
1 answers
347 views
Where do I extract and install the .txz file of the Shotcut Video editor?
I recently installed Shotcut on my Chromebook via the Linux Virtual Environment (Debian) on the Terminal. While the program works for the most part, it is also asked me to update to the latest version. I downloaded the .txz files from the site but I am not sure where to extract the files. The versio...
I recently installed Shotcut on my Chromebook via the Linux Virtual Environment (Debian) on the Terminal. While the program works for the most part, it is also asked me to update to the latest version. I downloaded the .txz files from the site but I am not sure where to extract the files. The version of the Shotcut video editor that I have installed is not the latest version. The .txz file is but I have no idea where to extract the file on Linux. I cannot use the Terminal to update it either as it tells me that I have the latest version. The .txs file is the lastest version and it has all the updated files. What should I do? Should I reinstall the software? Should I find a .rom or .deb file?
GAP (23 rep)
Dec 1, 2023, 11:03 PM • Last activity: Dec 2, 2023, 03:30 PM
185 votes
11 answers
291893 views
How can I use ffmpeg to split MPEG video into 10 minute chunks?
There is often a need in the open source or active developer community to publish large video segments online. (Meet-up videos, campouts, tech talks...) Being that I am a developer and not a videographer I have no desire to fork out the extra scratch on a premium Vimeo account. How then do I take a...
There is often a need in the open source or active developer community to publish large video segments online. (Meet-up videos, campouts, tech talks...) Being that I am a developer and not a videographer I have no desire to fork out the extra scratch on a premium Vimeo account. How then do I take a 12.5 GB (1:20:00) MPEG tech talk video and slice it into 00:10:00 segments for easy uploading to video sharing sites?
Gabriel (1953 rep)
Sep 6, 2010, 04:16 PM • Last activity: Sep 23, 2023, 06:47 AM
1 votes
2 answers
5272 views
YAD and Zenity - Input Start/Stop Times to Trim Video
I have a bash script and a php script that function in concert to [trim audio/video files using start/stop times](https://unix.stackexchange.com/questions/182602/trim-audio-file-using-start-and-stop-times). PHP script: format('U') - $dt1->format('U'); // echo $dt3."\n"; $h = (int)($dt3 / 3600); $dt3...
I have a bash script and a php script that function in concert to [trim audio/video files using start/stop times](https://unix.stackexchange.com/questions/182602/trim-audio-file-using-start-and-stop-times) . PHP script: format('U') - $dt1->format('U'); // echo $dt3."\n"; $h = (int)($dt3 / 3600); $dt3 %= 3600; $m = (int)($dt3 / 60); $dt3 %= 60; $s = $dt3; // Dump as H:M:S echo $h . ":" . $m . ":" . $s; ?> chopvideoaudio.sh script: #!/bin/bash INFILE=$1 START=$2 STOP=$3 OUTFILE=$4 OFFSET=php TimeDiff.php "$START" "$STOP" echo "Disecting $INFILE starting from $START to $STOP (duration $OFFSET)" ffmpeg -ss "$START" -t "$OFFSET" -i "$INFILE" "$OUTFILE" Usage: ./chopvideoaudio.sh [input.mp4] [startchop] [stopchop] [output.mp4] Where [startchop] and [stopchop] are both absolute timestamps from the beginning of the track. Example command to run this script:
./chopvideoaudio.sh input.mp4 00:01:20 00:01:45 output.mp4
I want a [YAD (yet another dialog)](http://sourceforge.net/projects/yad-dialog/) script that will open up a dialog box(es) containing an input field to enter a custom file type (e.g. mp3, mp4, avi). Then input fields for the two timestamps, in which I can enter two custom timestamps. After pressing OK the script will run and extract the section from between the two timestamps. I would also be interested in a solution using [Zenity](http://www.linux.org/threads/zenity-gui-for-shell-scripts.5567/) , but I prefer YAD.
whitewings (2527 rep)
Feb 10, 2015, 07:00 AM • Last activity: May 12, 2023, 02:42 PM
2 votes
0 answers
1178 views
add/edit custom metadata fields to video files without remuxing?
**TL;DR - Looking for a way to edit/add *CUSTOM* metadata fields to video files without remuxing**. I have some media files that I add custom metadata fields to ([mostly mkv files downloaded with `yt-dlp`](https://stackoverflow.com/questions/71347719/set-metadata-based-on-the-output-filename-in-yt-d...
**TL;DR - Looking for a way to edit/add *CUSTOM* metadata fields to video files without remuxing**. I have some media files that I add custom metadata fields to ([mostly mkv files downloaded with yt-dlp](https://stackoverflow.com/questions/71347719/set-metadata-based-on-the-output-filename-in-yt-dlp/74202367#74202367) but I also have a few mp4 videos and occasionally some m4a/m4b audio files, usually a podcast or something similar). Every so often, especially if the source info is incorrect, I go back and make modifications and sometimes even add new fields. I am aware that I can use ffmpeg to do so, such as with the following example snippet: $ filePath=sample.mkv; propName=MY_CUSTOM_FIELD; propValue='The quick brown fox jumps over the lazy dog'; tempFilePath=temp.mkv $ mediainfo --Language=raw --Full --Inform="General;%${propName}%" "${filePath}" $ ffmpeg -i "${filePath}" -movflags use_metadata_tags -loglevel quiet -c copy -metadata "${propName}"="${propValue}" "${tempFilePath}"; $ mv "${tempFilePath}" "${filePath}"; $ mediainfo --Language=raw --Full --Inform="General;%${propName}%" "${filePath}" The quick brown fox jumps over the lazy dog This works great *except* for the fact that it remuxes the video. Depending on file size and system load, the remux can end up taking awhile. I have tried to look into other tools like AtomicParsley which appears to only support standardized tags. Likewise, I found a [suggestion to use mp4box](https://www.reddit.com/r/ffmpeg/comments/g4fey8/can_ffmpeg_edit_mp4_metadata_like_the_title/) (on Fedora, the binary is MP4Box in the gpac package from RpmFusion), but once again it doesn't appear to work with custom tag -- at least if it does, then for the life of me, I'm still not seeing it after reading through documentation for over half an hour. Is there any way to do something similar to my ffmpeg command above *without* going thru a remux and most importantly that will work for *custom* fields? I'm [assuming](https://superuser.com/a/351720) that I can't just make ffmpeg do an in-place, no-remux edit of metadata but it'd be awesome if I'm wrong... Anyway, I am open to pretty much any FOSS tool / project as long as I can get it to run on Fedora (or other Linux) and there's an example of how to do what I asked. For non-FOSS stuff, I would add the additional requirements that it be no- or low-cost and not do anything too obnoxious (e.g. either no telemetry and/or it won't stop working if I use firejail etc to block it from having network access). I'd prefer native FOSS CLI apps (easier to script) but if there's a GUI or even a freeware Windows app that will work under wine/mono/etc and it does what I'm asking, then by all means, please still mention it.
zpangwin (1061 rep)
Dec 5, 2022, 02:42 AM • Last activity: Dec 5, 2022, 02:51 AM
0 votes
1 answers
229 views
davinci dont show videos on timeline and dont play them
I'm new user of Linux. I have Mint. I wanted to edit my video using Davinci. After following few tutorials it's finally on my computer, but now I can't play video inside of it and it doesn't even show frames of that video. I used `ffmpeg` to convert my files into `mp4` (didn't work), and `mov`. Stil...
I'm new user of Linux. I have Mint. I wanted to edit my video using Davinci. After following few tutorials it's finally on my computer, but now I can't play video inside of it and it doesn't even show frames of that video. I used ffmpeg to convert my files into mp4 (didn't work), and mov. Still not working. Please help I dont want to use kdenlive because it sucks. enter image description here EDIT: I have OpenCL enter image description here
bebekorginal (1 rep)
May 18, 2022, 06:06 PM • Last activity: May 25, 2022, 07:52 AM
13 votes
7 answers
41744 views
FFMPEG - Interpolate frames or add motion blur
I just watched the [trailer for the hobbit][1], and [a trailer for the avengers][2] which both feature an increased framerate. A lot of the comments state that this isn't "true" 60fps since it was not shot at 60fps, but actually a lower frame-rate that has been interpolated. ![enter image descriptio...
I just watched the trailer for the hobbit , and a trailer for the avengers which both feature an increased framerate. A lot of the comments state that this isn't "true" 60fps since it was not shot at 60fps, but actually a lower frame-rate that has been interpolated. enter image description here If this is the case, **is there any way that I can convert some of my existing media in Linux with ffmpeg or avconv in the same way in order to create this "illusion"?** I can understand if higher framerates are not to other's tastes, but not the point of this post.
Programster (2289 rep)
Jan 10, 2015, 08:58 PM • Last activity: Jun 17, 2021, 07:18 AM
5 votes
2 answers
2856 views
trim and fade in/out video and audio with avconv (or different tool)
I'm using `avconv` for trimming and converting videos. Let's say I want to drop the first 7 and last 2.5 seconds of the video stream and one audio stream of an one-hour `mts` file: avconv -i input.mts -map 0:0 -map 0:3 -ss 0:0:07 -t 0:59:50.5 out.mov This works so far, but now I want to add two seco...
I'm using avconv for trimming and converting videos. Let's say I want to drop the first 7 and last 2.5 seconds of the video stream and one audio stream of an one-hour mts file: avconv -i input.mts -map 0:0 -map 0:3 -ss 0:0:07 -t 0:59:50.5 out.mov This works so far, but now I want to add two seconds of fading in and out at the beginning and the end by adding: -vf fade=type=in:start_frame=350:nb_frames=100 -vf fade=type=out:start_frame=178750:nb_frames=100 Those frames are calculated with the 50 fps that avconv reports for the video source. But there is neither fading in nor out. 1) What goes wrong with the video fading and how to do it right? 2) How to add audio fading. There seems to be an -afade option. but I don't find it documented. Alternatively, you can propose a different tool for this goal (trim and fade video and audio), preferrably available as package for Debian 8.
Philippos (13680 rep)
May 18, 2017, 08:42 AM • Last activity: Apr 4, 2021, 05:12 AM
4 votes
3 answers
5716 views
What video editing applications are available in Linux?
Please recommend me a video editor. I am looking for a GUI application. I haven't done any video editing recently so I do not know what the possibilities are. Using a Linux only software is fine with me.
Please recommend me a video editor. I am looking for a GUI application. I haven't done any video editing recently so I do not know what the possibilities are. Using a Linux only software is fine with me.
user7610 (2188 rep)
Sep 2, 2013, 01:24 PM • Last activity: Jan 29, 2021, 02:33 PM
1 votes
1 answers
970 views
Does kdenlive have a limit regarding the workable filesize?
Does kdenlive have a limit regarding the workable file-size?
Does kdenlive have a limit regarding the workable file-size?
sid_com (1661 rep)
May 11, 2012, 03:47 PM • Last activity: Jan 25, 2021, 02:21 PM
-1 votes
1 answers
57 views
How can I reencode a video's audio when it was recorded in stereo with a mono source?
I have a video that I recorded with an interface using an XLR microphone (mono). The video recording software (Simple Screen Recorder), and my PulseAudio all saw that as a stereo source. Now I have a video with a stereo stream but only one audio channel. How can I correct this so sound plays from bo...
I have a video that I recorded with an interface using an XLR microphone (mono). The video recording software (Simple Screen Recorder), and my PulseAudio all saw that as a stereo source. Now I have a video with a stereo stream but only one audio channel. How can I correct this so sound plays from both speakers? Currently sound only plays from the left speaker.
Evan Carroll (34663 rep)
Jan 13, 2021, 07:40 PM • Last activity: Jan 15, 2021, 05:40 AM
1 votes
2 answers
1196 views
Which video editor for Linux has the video speed control effect?
I have so far tried Pitivi and Shotcut, but neither of these seem to have this effect, by which one could speed up or slow down certain segments of a video. Also, Shotcut doesn't even work very well on my system and tends to crash at every opportunity. Unfortunately my bandwidth is limited, so I don...
I have so far tried Pitivi and Shotcut, but neither of these seem to have this effect, by which one could speed up or slow down certain segments of a video. Also, Shotcut doesn't even work very well on my system and tends to crash at every opportunity. Unfortunately my bandwidth is limited, so I don't have much of a chance to try out many such video editors. If someone knows one such editor for Linux, I would find such answer very helpful.
sequence (321 rep)
Jan 12, 2021, 04:31 PM • Last activity: Jan 12, 2021, 05:42 PM
Showing page 1 of 20 total questions