LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-13-2020, 12:14 PM   #16
michaelsavage
Member
 
Registered: Apr 2019
Distribution: Linux Mint
Posts: 58

Original Poster
Rep: Reputation: 11

sorry this was a duplicate. Please see below post.

Last edited by michaelsavage; 06-13-2020 at 12:39 PM.
 
Old 06-13-2020, 12:35 PM   #17
michaelsavage
Member
 
Registered: Apr 2019
Distribution: Linux Mint
Posts: 58

Original Poster
Rep: Reputation: 11
michaelk

I think you hit the nail on the head. That command creates the out.mp4 file but only 1 image is in the out.mp4 file. So, ffmpeg is working. The command is not correct.

I'm looking to see what changes I need to make. I was able to get it to work via the command line at first but I need to glob the image files

Code:
ffmpeg -framerate 1 -pattern_type glob -i '*.jpg' -vf scale=500:300 out.mp4
 
Old 06-13-2020, 12:54 PM   #18
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,592

Rep: Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880Reputation: 5880
Its been awhile since I have used ffmpeg only single audio files. Its a syntax error and probably due to no map option.

Try this:
Code:
ffmpeg -framerate 1 -i acaproni_maldives.jpg -i adeole_yosemite.jpg -i agucklhorn-lake_brienz.jpg  -map 0 -map 1 -map 2 -vf scale=500:300 out.mp4
 
Old 06-13-2020, 04:49 PM   #19
cordx
Member
 
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 797

Rep: Reputation: 184Reputation: 184
i know just about the minimum about scripting, but this person was able to get their script to accept multiple selections with a loop (? not sure if that is the correct term, still doing some reading...). i get that their script then acted on each input separately instead of running them through the same command, but could something like that be used to add them to the video similar to what the globbing usually does?
 
Old 06-14-2020, 12:51 AM   #20
cordx
Member
 
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 797

Rep: Reputation: 184Reputation: 184
i think i got mine to do (most of?) what you were looking for.
Code:
[Nemo Action]
Active=true
Name=pix2vid
Comment=create video from images
Exec=<pix2vid.sh %F>
Icon-Name=image
Selection=any
Extensions=jpg;png;bmp;gif
Quote=double
Terminal=true
using ffmpeg's concat demuxer.
Code:
#!/bin/bash
for f in "$@"
    do
        echo "file '$f'\rduration 3" >> ./mylist.txt
    done

ffmpeg -f concat -safe 0 -i ./mylist.txt -vf scale=500:300 out.mp4
of course you may want to change where that list is and probably wipe it (maybe echo /dev/null ./mylist.txt?) after the video is made so you can make another, but i was able to choose 3 photos all with whitespaces. all of mine happened to be png's as well. i'm not sure what might/would happen if different formats were selected. most of the examples on ffmpeg.org used one single format to make the video.

that duration bit might not be exactly what you were looking for, but in general i think it is similar to what you were trying to set with -framerate (which for some reason threw an error when i tried to use it. maybe it doesn't work with concat?). without a specified duration, concat wouldn't make the video. there should be a way around it, but that is the best my limited skills have come up with for now.

Last edited by cordx; 06-14-2020 at 01:00 AM. Reason: clarity
 
1 members found this post helpful.
Old 06-14-2020, 07:50 AM   #21
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Code:
for f in "$@"
is the same as just
Code:
for f
 
1 members found this post helpful.
Old 06-14-2020, 01:54 PM   #22
michaelsavage
Member
 
Registered: Apr 2019
Distribution: Linux Mint
Posts: 58

Original Poster
Rep: Reputation: 11
Sorry for the delay in response. Cordx, I did need to make some small changes to your code. But you ROCK. It works

Code:
#!/bin/bash
for f
    do
        echo "file '$f' 
duration 3" >> ~/Videos/mylist.txt
    done

ffmpeg -f concat -safe 0 -i ~/Videos/mylist.txt -s 500x300 ~/Videos/out.mp4
rm ~/Videos/mylist.txt
A BIG thanks to all of you and your help

Last edited by michaelsavage; 06-14-2020 at 03:00 PM.
 
Old 06-14-2020, 02:56 PM   #23
cordx
Member
 
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 797

Rep: Reputation: 184Reputation: 184
i'm glad to hear that worked i wasn't aware of the existence of nemo actions before your question and found them to be a fun customization to look into.
 
Old 06-14-2020, 03:00 PM   #24
cordx
Member
 
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 797

Rep: Reputation: 184Reputation: 184
Quote:
Originally Posted by shruggy View Post
Code:
for f in "$@"
is the same as just
Code:
for f
thank you for the correction/pointer.
 
Old 06-14-2020, 03:11 PM   #25
michaelsavage
Member
 
Registered: Apr 2019
Distribution: Linux Mint
Posts: 58

Original Poster
Rep: Reputation: 11
Cordx
I've been tweaking some other nemo action files. Below are some you may like.

Code:
Compress data

[Nemo Action]
Active=true
Name=Compress data
Comment=compress %N
Exec=file-roller -d %F
Icon-Name=gnome-mime-application-x-compress
Selection=any;
Extensions=any;
Code:
Decompress data

[Nemo Action]
Active=true
Name=Extract here
Comment=Extract here
Exec=file-roller -h %F
Icon-Name=gnome-mime-application-x-compress
#Stock-Id=gtk-cdrom
Selection=Any
Extensions=zip;7z;ar;cbz;cpio;exe;iso;jar;tar;tar;7z;tar.Z;tar.bz2;tar.gz;tar.lz;tar.lzma;tar.x
Code:
reduce image by 50%

[Nemo Action]
Active=true
Name=Reduce Image 50%
Comment=Reduce the size of the image by 50%
Exec=ffmpeg -i %F -vf scale=iw/2:-1 %F
Icon-Name=image
Selection=any;
Extensions=jpg;png;bmp;gif
Terminal=true
Code:
reduce image by 75%

[Nemo Action]
Active=true
Name=Reduce Image 75%
Comment=Reduce the size of the image by 75%
Exec=ffmpeg -i %F -vf scale=iw/4:-1 %F
Icon-Name=image
Selection=any;
Extensions=jpg;png;bmp;gif
Terminal=true
Code:
Convert to mp3

[Nemo Action]
Active=true
Name=Convert to MP3
Comment=Convert an audio file to the MP3 format
Exec=ffmpeg -i %F %F.mp3
Icon-Name=emblem-music-symbolic
Selection=any;
Extensions=wav;ogg;aac;
Terminal=true

Last edited by michaelsavage; 06-14-2020 at 04:35 PM.
 
1 members found this post helpful.
Old 06-14-2020, 03:37 PM   #26
cordx
Member
 
Registered: Oct 2018
Location: texas
Distribution: bodhi 5.1.0
Posts: 797

Rep: Reputation: 184Reputation: 184
Quote:
Originally Posted by michaelsavage View Post
Code:
reduce image by 75%

[Nemo Action]
Active=true
Name=Reduce Image 75%
Comment=Reduce the size of the image by 50%
thank you for sharing those. a quick note ^ about the comment on that one. for the record, i got a decent understanding about how nemo actions work by looking through smurphos' posts on the mint forum and then taking a look at their work on github.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
x11vnc: clipboard and right click menu(context menu) "Paste" item not in sync Vilius Linux - Desktop 0 11-17-2017 11:46 PM
When right/left clicking for a context menu to appear, it display a pitch black menu pupuela Linux - Newbie 4 08-07-2014 06:54 AM
How to modify the library path variable?modify the Electronkz Linux - Newbie 1 04-13-2004 06:18 AM
modify file access & modify timestamps i2itstud Linux - General 1 05-20-2003 03:34 AM
Help with icewm - Remove RightClick context menu from taskbar Glenn Albrecht Linux - Software 2 11-15-2002 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration