Sponsored Content
Top Forums Shell Programming and Scripting Recursive (Into subdirectories) ffmpeg generate jpg from video Post 302984560 by rbatte1 on Thursday 27th of October 2016 09:04:09 AM
Old 10-27-2016
Breaking this up for clarity, you have this:-
Code:
#!/bin/bash

for i in `find /home/videos/ -name "*.mp4" -print0 | xargs -0`
do
   ffmpeg -loglevel panic -y -i "$i" -frames 1 -q:v 5 -vf "select=not(mod(n\,400)),scale=-1:250,tile=3x2" "${i%}.jpg"
   echo "$i"
done

If you want to extract the section of the name you are after, you could do something based on this:-
Code:
#!/bin/bash

for i in `find /home/videos/ -name "*.mp4" -print0 | xargs -0`
do
   ffmpeg -loglevel panic -y -i "$i" -frames 1 -q:v 5 -vf "select=not(mod(n\,400)),scale=-1:250,tile=3x2" "${i%}.jpg"
   echo "$i"
   echo "You are starting with ${i}"
   i="${i#/home/videos/}"
   echo "You have removed the leading /home/videos to leave you with ${i}"
   i="${i%/*}"
   echo "You have removed everything after the next slash to leave you with ${i}"
done


Does that help?


Robin
This User Gave Thanks to rbatte1 For This Post:
 

7 More Discussions You Might Find Interesting

1. OS X (Apple)

Video grab using ffmpeg?

Does anyone know how to grab video (screen) on Terminal using ffmpeg (not X11). I have written a unix library and I'd like to make a short movie (demo) of it. Tried: I already own SNapz Pro2 but it hangs the system (I have an old Powerbook 15" PPC). I guess my system is too slow for version... (0 Replies)
Discussion started by: sentinel
0 Replies

2. AIX

recursive archive directories and subdirectories

Hi everyone, Maybe this is simple question for many of you, but I get confused.:confused: How to archive a parent directory which contains some subdirectories and some files? I have searched this forum, there are some commands like tar,etc, I tried but can not be implemented in my system.... (6 Replies)
Discussion started by: wilsonSurya
6 Replies

3. UNIX for Dummies Questions & Answers

Touch all files and subdirectories (recursive touch)

I have a folder with many subdirectories and i need to set the modified date to today for everything in it. Please help, thanks! I tried something i found online, find . -print0 | xargs -r0 touch but I got the error: xargs: illegal option -- r (5 Replies)
Discussion started by: glev2005
5 Replies

4. Shell Programming and Scripting

Rename all ".JPG" files to ".jpg" under all subfolders...

Hi, Dear all: One question ! ^_^ I'm using bash under Ubuntu 9.10. My question is not to rename all ".JPG" files to ".jpg" in a single folder, but to rename all ".JPG" files to ".jpg" in all subfolders. To rename all ".JPG" to ".jpg" in a single folder, for x in *.JPG; do mv "$x"... (7 Replies)
Discussion started by: jiapei100
7 Replies

5. UNIX for Advanced & Expert Users

trim 165 MB video clip with ffmpeg (only last 3 minutes)

Hi original video clip > ls -alh reallynotpr0n.flv -rw-r--r-- 1 jonny staff 165M Nov 18 19:57 reallynotpr0n.flvtrying to cut only last 3 minutes of the clip out. > ffmpeg -i reallynotpr0n.flv -vcodec copy -acodec copy -ss 00:52:00 -t 00:03:48 trimmed_video.avi ffmpeg version 0.7.7,... (3 Replies)
Discussion started by: slashdotweenie
3 Replies

6. UNIX for Dummies Questions & Answers

recursive copy into a directory and all its subdirectories...

I want to copy a file from the top directory into all the sub-folders and all of the sub-folders of those sub-folder etc. Does anyone have any idea how to do this? Thanks in advance of any help you can give. (3 Replies)
Discussion started by: EinsteinMcfly
3 Replies

7. UNIX for Advanced & Expert Users

Ffmpeg (avconv) + crtmpserver Linux streaming video, no player to play it

Hello Linux experts, I'm working on live video streaming project, and my job is to create video streaming server using Ubuntu 13.04 Here is what I've done so far: 1. Installed crtmpserver from Ubuntu's repositories. 2. Installed ffmpeg To test the server i use webcam as source of video,... (0 Replies)
Discussion started by: +Yan
0 Replies
pfsoutffmpeg(1) 					      General Commands Manual						   pfsoutffmpeg(1)

NAME
pfsoutffmpeg - Read pfs frames from stdin and forward them to ffmpeg program SYNOPSIS
pfsoutffmpeg [--help] <ffmpeg options> output_file DESCRIPTION
This command is a wrapper for ffmpeg program and can be used to write pfs frames to a compressed video. Check the examples section to for sample usage and see manual of ffmpeg for further information. Note that the usage of '-f' switch (input format specifier) and '-i' switch (input file specifier) of the ffmpeg program is implemented inside the script and is therefore not allowed. EXAMPLES
pfsinrgbe frame%04d.hdr --frames 100:2:200 | pfstmo_reinhard02 -s | pfsgamma -g 1.7 | pfsoutffmpeg -qscale 4 test.avi 1. Read HDR frames in RGBE format with the following names: frame0100.hdr, frame0102.hdr, frame0104.hdr,... frame0200.hdr 2. Apply local tone mapping operator to each frame (Reinhard2002 model, part of the PFSTMO package) 3. Apply gamma correction to each tone mapped frame 4. Compress frames to test.avi animation SEE ALSO
ffmpeg(1) pfsin(1) pfstmo_reinhard02(1) pfsgamma(1) BUGS
Frames smaller than 512x384 can cause broken pipe error, due to bug in ppm pipe reading routine in ffmpeg. Please report bugs and comments to Rafal Mantiuk <mantiuk@mpi-sb.mpg.de> or Grzegorz Krawczyk <krawczyk@mpi-sb.mpg.de>. pfsoutffmpeg(1)
All times are GMT -4. The time now is 07:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy