All Questions

Tagged with
Filter by
Sorted by
Tagged with
2
votes
1answer
34 views

How do I run an on-the-fly ffmpeg (pipe) conversion in parallel?

I want to do the following conversion: for f in *.m4a; do ( ffmpeg -i "$f" -f wav - | opusenc --bitrate 38 - "${f%.m4a}.opus" ) & done I know I could use ffmpeg directly to convert to ...
0
votes
2answers
132 views

Pipe and filter bash outputs in realtime

I am running some commands in bash (basically some ffmpeg commands), that I'm using grep and awk to filter out the results. The command takes some time and continously outputs some results as it ...
0
votes
1answer
39 views

ffmpeg - how to split a .aac audio-file into small parts, exactly 4.00 seconds in size (so ignoring keyframes)

How can I split the audio file .aac into small parts of exactly 4.0 seconds, ie. with ignoring keyframes? The original video file was in .mp4 format. From this video file I got an .aac audio file. ...
0
votes
0answers
38 views

Bash - find certain files and remux with ffmpeg then delete the old one

i just would like to use this command: for i in *.ts; do ffmpeg -i "$i" -c:a aac -b:a 128k -c:v copy -crf 20 "${i%.ts}.mp4"; done but only for a specific files like: above 350 000KB size or created ...
0
votes
1answer
224 views

Convert all video files in a folder to images per frame using ffmpeg iteratively

I use ffmpeg -i FILE_NAME -vf fps=1/1 FILE_NAME%05d.jpg -hide_banner to convert a single file to several images which keep the file name followed by 5 zeros, a counter and then ends with a .jpg. How ...
0
votes
2answers
85 views

How to highlight terms in an output that has a live update?

I'm doing a loop over ffmpeg to convert a bunch of videos, and I would like to highlight some terms in ffmpeg's output. But the solution I tried always made the live progress of the conversion ...
0
votes
2answers
354 views

ffmpeg: filenames with spaces from bash script

I have composed the following bash script to automatically concatenate mp3 files using ffmpeg: i=0 for f in "${@:2}" do filter+="[$i:a:0]" i=`expr $i + 1` files+="-i $f " done ...
1
vote
1answer
72 views

ffmpeg truncates paths on output when there are dots involved when run on bash

If I have a path with dots in the path, for instance: /home/user/Documents/hello/test.testing_23-24.123/test.testing_23-24.124 ffmpeg can locate the file if you pass the file's path as an argument ...
1
vote
1answer
249 views

ffmpeg mass transcode videos in directory

I have loads of videos named different things and different extensions (some mp4 some wmv etc). I would like to run the command below but on every video in a specific directory and then save that in ...
0
votes
2answers
70 views

In nested directories, extract JPG from each MP4 frame, leaving JPGs in MP4's directory

I have this script, which creates a directory for each file, and moves the file into the directory. #!/bin/bash for file in *; do if [[ -f "$file" ]]; then mkdir "${file%.*}" mv "$file" "${...
1
vote
1answer
315 views

Mass convert audio files to a specified bitrate, but only if their bitrate is higher than that bitrate using ffmpeg

I have a bunch of audio files in a directory some are 128Kbps , some are higher. I want to convert the ones with a bitrate higher than 128Kbps to 128Kbps to save space. I tried writing a shell script ...
4
votes
3answers
2k views

Convert all found m4a to mp3

I'm trying to covert all m4a to mp3 my code look like this: find . -name '*.m4a' -print0 | while read -d '' -r file; do ffmpeg -i "$file" -n -acodec libmp3lame -ab 128k "${file%.m4a}.mp3"; done ...
1
vote
1answer
116 views

ffmpeg screenshot files recursively

if [ -d "$1" ]; then echo If files are media, screenshots will be made to ~/Screenshots for media in $(find "${1%/}/"* -name '*.mkv' -or -name '*.mp4'); do ffmpeg -hide_banner -loglevel panic -ss 00:...
0
votes
1answer
375 views

ffmpeg does not accept variable name read from file [closed]

I am attempting to batch download a number of videos using ffmpeg. A list of the site addresses and save names is stored in a text file in the following format. "site",filename.mp4 The code that I ...
0
votes
1answer
43 views

Building a for loop around exsisting loop, to replace user input

I basicly have this script: #!/bin/bash #Asks For filname and Word echo 'Which word are you looking for?' read word echo 'What's the name of the file?' read fileName #Searches word and parses the ...
0
votes
2answers
344 views

Subtract two time codes

I need to subtract two time codes from each other, I have multiple in an array and the output looks like this: **Input:** echo ${arr3[0]} echo ${arr3[1]} **Output:** 00:00:22.180 --> 00:00:25....
1
vote
1answer
368 views

How can I convert a folder of audio files into a single file (iterate over many folders)?

I have a couple of radio plays of various series. Some are already single-track, some are multi-track. I want all to be single-track. I don't mind re-encoding; in fact I want to transfer them to my ...
0
votes
1answer
1k views

Bash Script with ffmpeg

my HD Homerun for PLEX saves .TS files (transport stream). in order to shrink this to 720 i use the following script: #!/bin/bash for INF in *.ts do ffmpeg -i "$INF" -vf scale=-1:720 -c:v ...
1
vote
2answers
832 views

Pipe to get one line output of command

There are a few commands that print some status lines in the console when they are doing something (ffmpeg or fsarchiver). -[00][ 0%][DIR ] /boot/grub/fonts -[00][ 0%][REGFILE ] /boot/grub/...
1
vote
1answer
267 views

ffmpeg script only running for first in list?

I wrote a small script that converts HQ video to LQ: ls video/hq | cut -d. -f1 | while read line ; do HQ=./video/hq/$line.mp4 LQ=./video/lq/$line.mp4 ffmpeg -i $HQ -crf 40 $LQ done; When I run ...
1
vote
1answer
84 views

bash parallel encoding and uploading

I am working on a bash script for encoding videos with ffmpeg in a special format. To save the resulting videos I want to upload the video as soon as the encoding is finished. Therefore I want to use ...
0
votes
1answer
458 views

Bash script with ffmpeg and sed

So I am trying to write a script in bash which will add the relative path to the beginning of each line of the concat_files.txt and then I want to concatenate all files and put the output file in the ...
1
vote
1answer
134 views

Problems converting WAV to ALAC by a batch job

I use the following code to convert WAV to ALAC (bash, macOS 10.12.1): find . -type f -iname "*.wav" | while read fn; do ffmpeg -i "$fn" -acodec alac "${fn%.wav}.m4a"; done But there seems to be a ...
0
votes
1answer
426 views

ffmpeg bash script segment template

I was trying to control ffmpeg file segment function through a bash script to cut a large movie file into smaller pieces. I took a look at the documentation here but this doesn't really cover what I ...
0
votes
1answer
231 views

bash script controlling ffmpeg to convert from mkv

Help me debugs this script to create control ffmpeg from a bash script. for f in $FILES do INPUT_MOVIE=`basename "${f%.*}.mkv"` OUTPUT_MOVIE=${MOVIE:1} OUTPUT_MOVIE=${OUTPUT_MOVIE:0:2}") ...
1
vote
0answers
179 views

Record fullscreen program with avconv/ffmpeg?

I'm trying to record a fullscreen program (snes9x) with avconv, aka ffmpeg. I have avconv set up to use my whole screen, but it doesn't capture snes9x when I run it. #!/bin/bash avconv \ -f ...
1
vote
1answer
121 views

How can I edit my bash script to account for whitespace entries? [duplicate]

I made a script to automate ffmpeg conversion from mkv > m4v > open the m4v in Subler.app to import the metadata manually, at which point I'll move the file into my iTunes library. I use iTunes ...
2
votes
1answer
2k views

Problem with ffmpeg in bash loop

When running the following command line to convert multiple .mkv files into .mp4 files, things go awry. It's as if the script tries to run all the commands at once or they get entangled in each other ...
5
votes
2answers
2k views

Create thumbnail from video at random time frame

I'm using this bash script to generate thumbnails from videos: #!/bin/bash source_dir="." output_dir="/output" input_file_types=(avi wmv flv mkv mpg mp4) output_file_type="jpg" r1=$(( ( RANDOM % 10 ) ...
5
votes
1answer
894 views

Bash Script — ffmpeg not being invoked as expected

I'm working on a bash script to convert my music library to ogg* but executing the right command is somehow eluding me. This is the line that should accomplish it: ffmpeg -i "${file}" -f flac pipe:1 |...
1
vote
1answer
961 views

FFMPEG batch convert quits before processing all files

I have an audiobook which consists of over 700 ra files (RealAudio) which I'm trying to batch convert to mp3 using ffmpeg. RA files are named as chapter-verse.ra (e.g. 13-01.ra) I run a script and it ...
0
votes
1answer
652 views

Find and convert all ALAC files to mp3 / opus / aac

I'm looking for a way to convert all alac files in a directory recursively to another format. Problem: alac as well as aac use suffix m4a, so find -name "*.m4a" doesn't work.
9
votes
2answers
17k views

Interactively concatenate video files

How to concatenate (join) multiple MP4 video files into one file interactively? There are a lot of programs that do this for two files from the command line. For instance: ffmpeg avconv MP4Box ...
26
votes
14answers
77k views

Bash script to convert all *flac to *.mp3 with FFmpeg?

I want to convert all *.flac to *.mp3 in the specific folder. This is what I've tried, but not works: # change to the home directory cd ~/music # convert all *.flac files ffmpeg -i *.flac -acodec ...
2
votes
4answers
4k views

how to convert number to time format in shell script?

I want to cut a video into about 10 minute parts like this. ffmpeg -i video.mp4 -ss 00:00:00 -t 00:10:00 -c copy 01.mp4 ffmpeg -i video.mp4 -ss 00:10:00 -t 00:10:00 -c copy 02.mp4 ffmpeg -i video.mp4 ...
5
votes
1answer
7k views

Split video file into pieces with ffmpeg

When you want to extract two minutes of a video file from minute 2 to minute 4, you will use command ffmpeg -i input.mpg -sameq -ss 00:02:00 -t 00:02:00 output.mpg I'd like to split the video into ...