Audio/Video/Image/Text/ISO Convert
Nautilus Scripts
Score 78%
Description:

Right-click on a file, and this script will decide what conversions are appropriate, ask some questions about what you want, and execute the proper command and options to convert it into something else.

Multimedia: change formats, bitrate, framerate, size, aspect ratio, and more. Also strip audio.
Audio: change formats, bitrate, volume, and more.
Multimedia and Audio: your most-used sets of options can be stored for future use.
Images: change formats, size, jpg compression, rotate, equalize, and more.
Documents: change formats, text-to-speech, text-to-jpg, and more.
Convert multi-image files, like pdf or animated gif, into a series of frames,
pdf to gif creates animaged gif, animated gif to pdf creates multi-page pdf.
Convert various "CD Images" into standard .iso files.

[li]Comments welcome, suggestions invited, votes appreciated.[/li]

There's a lot of description here, but you don't need any of it to make this work.
Just download and extract. Then do one or more of these with the file "avconvert":
(1) move (or copy or link) it to ~/.gnome2/nautilus-scripts
(2) move (or copy or link) it to somewhere in $PATH (eg /usr/local/bin)
..(obviously don't move it twice :-)
(3) do #2, then add it as a nautilus-action (The Command "Parameters" must be "space-separated list of selected filenames", and "Working Directory" must be "first base directory". On Fedora, these are %F and %d)
(4) add it to Gnome panel/launch-bar (drag/drop or right-click panel Add/Custom-Application)

...Depending on 1, 2, 3, and 4 above (you can do any combination of these), you can now:
(1) right-click on selected icon(s) and choose the script
(2) from command line: avconvert filename (quote name(s) with spaces, multiple files OK)
(3) right-click on selected icon(s) and choose "Avconvert"
(4) click the icon to launch -or- drag-and-drop file(s) on the icon

To repeat, you can do as many of these as you want. For example: move the file to ~/.gnome2/natuilus-scripts, then link that to /usr/local/bin, then add it as a nautilus-action, then add it to the gnome-panel.


Much more than a quick shortcut to a common command, this shell script is over 2000 lines of code!

[li]If you feel inclined not to vote "good", tell me why - I'm still actively developing this.
If you like it and you're not registered, take the time to sign up and vote....
After all, I took the time to write this and give it away! :-) :-)

If this has become a tool you use regularly, PLEASE consider a small donation
A lot of time and effort has gone into bringing this to the "free" world


[/li]

The first run will create some files in ~/.config/avconvert. The files "avconvert", "avconvert.lang", and "avconvert.ffopts.custom" may be hand-edited. A default file will be recreated if any file is missing.

When using Key-In-Options during audio or video conversion, your ffmpeg options can be saved into the menu for future use. When your Key-In options end in a comment (as in "# my conversion"), a line will be automatically added to the 'custom' section of the ffmpeg options menu.

There's a progress indicator during conversions. In most cases, it estimates that the result file will grow to the size of the source file. This is not always the case because depending on the conversion the result may be larger or smaller than the original, so it may only reach 25-30% and be finished or quickly rise to 98% and hover there depending on your conversion. Be patient - behind the scenes, the progress window stays up as long as the result file is growing.

AUDIO: Converts between various formats (see below).

VIDEO: Converts between various formats. Can also produce audio-only from a video source. Video size can be scaled by specifying a new width - the new height is calculated based on aspect ratio. A video can also be letter-boxed by choosing the aspect ratio of your display device - calculation automatically determines whether to pad on top/bottom or left/right. Videos can also be rotated to compensate for the type of recorder used (this feature is the only one that relies on mencoder). NOTE REGARDING ROTATION - mencoder has some codec limitations, and depending on the source or destination file type, rotation may fail. This will be detected and reported, but without automatically fixing it. The best course of action is to convert the source first, perhaps to AVI, then use THAT file as the source for your rotation and other changes.

AUDIO AND VIDEO: Can adjust audio volume, sample rate, bitrate. In fact, you can do anything ffmpeg is capable of. Options in default menus offer common operations, but a special KEY-IN function lets you test your own and store them in your own custom file. Further, there's a file of user-submitted options (downloaded separately).

VIDEO FRAMES: Converts an input video into a series of frames in either jpg or png format. The capture rate can range from 1 to 60 seconds between frames, or 'all'.

VIDEO MERGE: If you have selected multiple AVI video files, you'll be given the option of merging them. Other video formats will need to be converted to AVI first. Pre-converting is also recommended if AVI files of differing video or audio quality are to be merged. The final AVI can of course then be converted to the format of your choice.

IMAGES: Convert between various formats. Optionally set resolution for output. If outputting jpg, optionally set quality. A single conversion can specify multiple output types and multiple resolutions.

ISO IMAGES: Why should "images" be limited to "pictures"? Generate an ISO file from source files in the following formats: b5i, bin/cue, csi, daa, mdf, nrg, pdi, uif.

IMAGE SPECIAL CASES: Converting an animated gif to a format other than gif will produce a separate file for each frame in the source. Converting a pdf to an format other than pdf does the same thing. In both cases the "progress indicator" will suggest that there was an error, but this is only because the files created are not named in accordance with what it expects. Be patient if the source contains many frames, and do not click Cancel to the progress window. Also, conversion of a .psd (or similar) which contains layers will generate multiple images in some formats (eg jpg), or an animation (eg gif), so you may want to flatten them first.

TEXT to TEXT: Various conversions between TXT, RTF, HTML, M$Office and OpenOffice, with more being added.

TEXT to SOUND: Produces an audio file from a .txt file. Choose language, gender, pitch and speed.

TEXT to IMAGE: Produces an image of your .txt file. Choose the output image size, font size, colors, border, and font. Text is automatically rewrapped as needed, based on the requested image width and font size. After wrapping, if the text will not fit on a single image vertically, multiple image pages will be generated.

GENERAL:
- The source file is not overwritten. The destination file is named for the source with a new extension.
- An image conversion will also insert resolution into the destination name.
- If any conversion would produce the source filename (eg changing image jpg quality only, or audio bitrate only, or same conversion twice), "new" is inserted into destination name or user is prompted to supply a name.

If you are missing any packages or plug-ins that it relies on, it will try to help. Help and notes are within the script at the very bottom.

REQUIRES:
xterm . . . . . . . . used to inform user if zenity not installed, and to auto-fix zenity defaults
zenity . . . . . . . . for all dialogs
ffmpeg . . . . . . . everything video and audio
imagemagick . . image and text-to-image
bc . . . . . . . . . . . . to do math calculations

CODECS (more is always better):
amrwb
faac
faad2
ffmpeg-libs
gpac
gstreamer-ffmpeg
gstreamer-plugins-*
xmms2-avcodec
xmms2-wma

OPTIONAL:
transcode . . . . . for merging avi
translate/libtranslate . language translation
curl . . . . . . . . . . language translation
links/elinks . . . . language translation
nautilus-actions . add directly to context menu
kdegraphics . . . GUI colors in text-to-image
espeak . . . . . . . text to audio
faac . . . . . . . . . required for m4a audio
faad2 . . . . . . . . mpeg-2 and mpeg-4
antiword . . . . . . M$Office to txt and rtf
unrtf . . . . . . . . . rtf to txt and html
odt2txt . . . . . . . OpenOffice to txt and xml
txt2tags . . . . . . txt to html
libavcodec-unstripped-52 . avi to .mp4
AcetoneISO . . . disk images b5i/cdi/mdf/nrg/pdi to ISO.
nrg2iso, daa2iso, cdd2iso, uif2iso, bchunk . more disk images to ISO
mencoder . . . . . to rotate videos

Upon startup, "ffmpeg" and "file" are both executed against the source file, and the information gathered is displayed in the initial windows. This is helpful in deciding what choices to make, especially if the source file happens to be of an 'unknown' type. If the script cannot figure out what to do with a file, it will let you specify whether to treat it as audio, video, image, or text.

The destination is chosen from a list of common and appropriate file extensions. If you want something that's not listed, you can click OTHER and type in any extension that is appropriate for the input file type and conversion being done.

For a typical system (eg, mine :-) conversions for the following image, audio and video formats...

Image formats supported by convert (ImageMagick)
-- Readable:
A ART AVI AVS B BMP C CAPTION CIN CMYK CMYKA CR2 CRW CUR CUT DCM DCR DCX DFONT DNG DPX EPDF EPI EPS EPSF EPSI EPT EPT2 EPT3 FAX FITS FRACTAL FTS G G3 GIF GIF87 GRADIENT GRAY ICB ICO ICON IPL JNG JP2 JPC JPEG JPG JPX K LABEL M M2V MAP MAT MIFF MNG MONO MPC MPEG MPG MRW MSL MSVG MTV MVG NEF NULL O ORF OTB OTF PAL PALM PAM PATTERN PBM PCD PCDS PCL PCT PCX PDB PDF PEF PFA PFB PFM PGM PGX PICON PICT PIX PJPEG PLASMA PNG PNG24 PNG32 PNG8 PNM PPM PS PSD PTIF PWP R RAF RAS RGB RGBA RGBO RLA RLE SCR SCT SFW SGI STEGANO SUN SVG SVGZ TEXT TGA TIFF TILE TIM TTC TTF TXT UYVY VDA VICAR VID VIFF VST WBMP WMF WMZ WPG X X3F XBM XC XCF XPM XV XWD Y YCbCr YCbCrA YUV
-- Writable:
A ART AVS B BMP BMP2 BMP3 C CIN CIP CLIP CMYK CMYKA CUR DCX DPX EPDF EPI EPS EPS2 EPS3 EPSF EPSI EPT EPT2 EPT3 FAX FITS FTS G G3 GIF GIF87 GRAY HISTOGRAM HTM HTML ICB ICO ICON INFO IPL JNG JP2 JPC JPEG JPG JPX K M M2V MAP MAT MATTE MIFF MNG MONO MPC MPEG MPG MSL MSVG MTV MVG NULL O OTB PAL PALM PAM PBM PCD PCDS PCL PCT PCX PDB PDF PFM PGM PICON PICT PJPEG PNG PNG24 PNG32 PNG8 PNM PPM PREVIEW PS PS2 PS3 PSD PTIF R RAS RGB RGBA RGBO SGI SHTML SUN SVG SVGZ TEXT TGA THUMBNAIL TIFF TXT UIL UYVY VDA VICAR VID VIFF VST WBMP X XBM XPM XV XWD Y YCbCr YCbCrA YUV
--NOTE that "readable" or "writable" do not necessarily imply "useful" :-Q

Audio/Video formats supported by ffmpeg
-- Read/Write:
3g2 3gp 4xm MTV RoQ aac ac3 adts aiff alaw amr apc ape asf asf_stream au avi avm2 avs bethsoftvid c93 crc daud dsicin dts dv dv1394 dvd dxa ea ea_cdata ffm film_cpk flac flic flv framecrc gif gxf h261 h263 h264 idcin image2 image2pipe ingenient ipmovie libdc1394 lmlm4 m4v matroska mjpeg mm mmf mov mov,mp4,m4a,3gp,3g2,mj2 mp2 mp3 mp4 mpc mpc8 mpeg mpeg1video mpeg2video mpegts mpegtsraw mpegvideo mpjpeg mulaw mxf nsv null nut nuv ogg oss psp psxstr pva rawvideo redir rm rtp rtsp s16be s16le s8 sdp shn siff smk sol svcd swf thp tiertexseq tta txd u16be u16le u8 vc1 vc1test vcd video4linux video4linux2 vmd vob voc wav wc3movie wsaud wsvqa wv x11grab yuv4mpegpipe
Last changelog:

Final notes... 3 years ago

[ READ ME!! ] After processing, the last part of the output from the actual conversion program used is displayed to confirm proper operation or to help diagnose any problems. If there are problems, you can view the complete output: in /tmp, list the files with "ls -lrt" which will show the newest at the bottom. The files that capture conversion output are named as follows: conversion-program.NNNNN where NNNNN is the PID of the process that ran. For example, you might see "ffmpeg.8512" or "antiword.405". Just view the file and look for the first error listed, which is probably the culprit.

=====

0.56 It is now possible to replace originals during a conversion IF:
1 - converting images
2 - converting into the source folder
3 - converting to only one file type
4 - converting to only one resolution
If these conditions are all true, you will be prompted before the conversion begins. If you choose YES:
1 - originals are replaced with the converted files
2 - the new files will have a different extension if appropriate
3 - the new file names will not have the resolution inserted

0.60 You are invited to submit your own custom option sets, which will be added to a "user submissions" config file that will be posted here and available for download!

0.61 Now recognizes .vob files - just mount your DVD and rip away!

0.65 When a keyed-in option is used in audio or video conversion, if you add a "comment" (a # followed by text), then that option set will be automatically added to your ~/.config/avconvert/avconvert.ffopts.custom file for future use

0.90 Merging multiple AVI files. If all the files you select are AVI, a new prompt will offer to merge them to a single AVI. All the source files should be of the same size/bitrate/etc (you may want to pre-convert them to ensure this).

0.93 New "veryquiet" option to completely turn off progress popups. To enable this after upgrading to 0.93, go to the directory ~/.config/avconvert and either remove the file "avconvert" (the next run will create a new one), or edit that file and add the line "veryquiet=y".

0.94 Translations work once again (if you have them turned off, just remove ~/.config/avconvert/avconvert.lang to reset). Various minor fixes as well, like an adjustment for a change in how Zenity works.

0.95 Google no longer offers the translation API as a free service. Changed things to use the built-in "libtranslate" function, which automatically references multiple such services. It's a little slower, but works.

0.97 Adjustments to detecting libtranslate. Also fixed a bug that, when converting multiple multimedia files, destination folder is asked for in each loop.

0.98 Recognizes when only VOB file(s) are selected and offers to rip DVD to an AVI on the Desktop.

0.99 Added SVG file type to image conversions. Due to a change in ffmpeg output when analyzing a video, rewrote the parsing of this output (still compatible with older ffmpeg versions).

0.999 For Arch Linux, added detection and use of package translate-shell. In Audio/Video section, small changes to acomodate latest ffmpeg command-line args.

truelove500

8 months ago

didn't worked for me... it keep asking for installing libtranslate which not found in arch linux distro AUR.
I wish I have a way to overcome this

Report

C

marc41

8 months ago

Hello!!

I do not have an Arch Linux set up here, but I have done some research. I am sure that the package you need is "translate-shell" https://aur.archlinux.org/packages/translate-shell/

I will adjust the script to add this as satisfying the requirement and re-post with a new version number.

I am sure this will fix it for you. Let me know after you have tested it.

-- Marc

Report

C

marc41

8 months ago

I have just uploaded the change. The new version is 0.999
Does this now work for you??

Report

amorpher

8 months ago

No. I've installed translate-shell and:
"Please install the package
"libtranslate" or "libtranslate-bin" or "translate-shell"
(whichever your distro offers)
and start the conversion again!"

//Arch Linux user

Report

amorpher

8 months ago

translate-shell 0.9.4-1
https://www.soimort.org/translate-shell

Files:
/usr/bin/trans
/usr/bin/translate-shell
/usr/share/licenses/translate-shell/LICENSE
/usr/share/man/man1/trans.1.gz
/usr/share/man/man1/translate-shell.1.gz

Report

C

marc41

8 months ago

OK. It looks good.

My script tests two things, trying to be sure that the package is installed. First, it looks for the binary (in Arch, /usr/bin/trans). That part should have worked fine.

Then the script does a second test. In Fedora and Ubuntu and others, the command "info translate" (or "info translate-bin") returns a text page that includes the string "translate a text or web page".

I'm checking for that, just in case I found a program named "translate" that isn't actually the package that's needed.

So please on your system type "info trans" to see what you get. If nothing, then I'll remove the test for 'translate-shell'. Or if you DO get something, please message me with a short piece of the text you see that could be used as this test (something that's probably unique).

Report

amorpher

8 months ago

info trans shows man trans

Report

C

marc41

8 months ago

I don't think I stated my question clearly enough...

What I'm wanting is some text from either "info trans" or from "man trans" that the script can use to guarantee that the /usr/bin/trans it finds is indeed the "translate-shell" package.

For example, on my system (Fedora, which installs /usr/bin/translate): "info translate" and "man translate" both display text that includes the phrase "translate a text or web page".

On your system, do you get something similar?

I just need to know what phrase to look for, and whether to use "info" or "man", so I can add that second test properly for Arch.

Report

amorpher

8 months ago

On Arch Linux "info trans" & "man trans" display the same manual file — /usr/share/man/man1/trans.1.gz:


TRANS(1) TRANS(1)

NAME
trans - Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc.

SYNOPSIS
trans [OPTIONS] [SOURCE]:[TARGETS] [TEXT]...

DESCRIPTION
This tool translates text into any language from the command-line, using a translation engine such as Google
Translate, Bing Translator and Yandex.Translate.

Each argument which is not a valid option is treated as TEXT to be translated.

If neither TEXT nor the input file is specified by command-line arguments, the program will read and trans‐
late from standard input.

OPTIONS
...
0.9.4 2016-05-18 TRANS(1)

Report

C

marc41

8 months ago

OK -- Updated version is in place...
Let me know what happens!!

Report

amorpher

8 months ago

OK, it work but very slow.
And... Look at this screenshot — https://u.teknik.io/0gSV4.png

Report

C

marc41

8 months ago

My guess is that we're still dealing with the translate-shell program and that it must behave differently than the "translate" in Fedora and Ubuntu.

Did you set the language to something other than English? If you did, then try this and send me the results:

echo -e "This is a test of\ntranslate-shell" | sed 's/$/++/' | trans

Report

amorpher

8 months ago

LANG=en_US.UTF-8 only.

$ echo -e "This is a test of\ntranslate-shell" | sed 's/$/++/' | trans
This is a test of++

This is a test of++

translate-shell++

translate-shell++

Report

C

marc41

8 months ago

When you answered the initial setup questions, did you set the language to something other than English?

Report

amorpher

8 months ago

LANG=en_US.UTF-8 only.

Report

C

marc41

8 months ago

I see it!! The Fedora/Ubuntu "translate" program outputs only the translated text. The Arch version has the "-verbose" option set by default, which tells it to display each original line, followed by the translation in bold print (using escape sequences).

THAT'S THE PROBLEM!!

The solution should be to add the "-b" option (for "brief").

I have done that and re-posted.

Report

amorpher

8 months ago

Last version (2017-01-05 17:28:52) seems work fine.
I didn't change something.

Report

C

marc41

8 months ago

It works fine and you did NOT download the fixed version I posted? That would be weird!

Does it still seem to be slow?

Report

amorpher

8 months ago

Everything is OK.
Thank You very much.

Report

rojthevorlon

3 years ago

An audio file integrity checker, again a la Foobar2000 on Windows. That and the capability to add ReplayGain tags would finally break the last dependency I have on the Windows platform.

Report

C

marc41

3 years ago

Anything to help a comrade leave M$ :-)

Report

C

marc41

3 years ago

To both your suggestions...

Regarding an integrity check, I may include this in the actual script, though it does take as long to run as to play the audio or video file. But for now, here is the command to run:
ffmpeg -v error -i filename.ext -f null -

Regarding tags, it appears that these can be specified directly in the command line. This means that it would be simple for you to add them using the "key in options" function that is already in my script. Further, this function in the script allows you to permanently add them to your menus simply by providing a comment when you key them in. Message me if you need more instruction than that.

This web page shows the options and how to specify them:
http://jonhall.info/how_to/create_id3_tags_using_ffmpeg

Has this been helpful?

-- Marc

Report

rojthevorlon

3 years ago

The one and only thing I don't see is the ability to calculate and apply ReplayGain (track, album and peak) to audo files (flac, off, mp3, aac, etc.) via ID3 tags a la Foobar2000 on Windows.

Any chance of this?

Report

C

marc41

3 years ago

Just saw your message -- sometimes gnome-look fails to email them to me.

I'm not familiar with this and will have to look into it. If you'd like to elaborate on this suggestion please email me directly tsi-inc@comcast.net

Report

fuckingbugmenot

4 years ago

in ubuntu 11.04 im running i got the error below

Please install the package
"libtranslate" or "libtranslate-bin"
(whichever your distro offers)
and start the conversion again!

so you should
install the package if not already in terminal
sudo apt-get install libtranslate-bin

and in the script also line 1380
replace it with
########
which translate-bin 2>&1 >/dev/null || info translate-bin | grep -q "translate a text" && trbin=/usr/bin/translate-bin
########
notice how it has || instead of &&
found this fix on the spanish fourms. thanks for the work mang i love what you have done.

Report

Final notes... 3 years ago

[ READ ME!! ] After processing, the last part of the output from the actual conversion program used is displayed to confirm proper operation or to help diagnose any problems. If there are problems, you can view the complete output: in /tmp, list the files with "ls -lrt" which will show the newest at the bottom. The files that capture conversion output are named as follows: conversion-program.NNNNN where NNNNN is the PID of the process that ran. For example, you might see "ffmpeg.8512" or "antiword.405". Just view the file and look for the first error listed, which is probably the culprit.

=====

0.56 It is now possible to replace originals during a conversion IF:
1 - converting images
2 - converting into the source folder
3 - converting to only one file type
4 - converting to only one resolution
If these conditions are all true, you will be prompted before the conversion begins. If you choose YES:
1 - originals are replaced with the converted files
2 - the new files will have a different extension if appropriate
3 - the new file names will not have the resolution inserted

0.60 You are invited to submit your own custom option sets, which will be added to a "user submissions" config file that will be posted here and available for download!

0.61 Now recognizes .vob files - just mount your DVD and rip away!

0.65 When a keyed-in option is used in audio or video conversion, if you add a "comment" (a # followed by text), then that option set will be automatically added to your ~/.config/avconvert/avconvert.ffopts.custom file for future use

0.90 Merging multiple AVI files. If all the files you select are AVI, a new prompt will offer to merge them to a single AVI. All the source files should be of the same size/bitrate/etc (you may want to pre-convert them to ensure this).

0.93 New "veryquiet" option to completely turn off progress popups. To enable this after upgrading to 0.93, go to the directory ~/.config/avconvert and either remove the file "avconvert" (the next run will create a new one), or edit that file and add the line "veryquiet=y".

0.94 Translations work once again (if you have them turned off, just remove ~/.config/avconvert/avconvert.lang to reset). Various minor fixes as well, like an adjustment for a change in how Zenity works.

0.95 Google no longer offers the translation API as a free service. Changed things to use the built-in "libtranslate" function, which automatically references multiple such services. It's a little slower, but works.

0.97 Adjustments to detecting libtranslate. Also fixed a bug that, when converting multiple multimedia files, destination folder is asked for in each loop.

0.98 Recognizes when only VOB file(s) are selected and offers to rip DVD to an AVI on the Desktop.

0.99 Added SVG file type to image conversions. Due to a change in ffmpeg output when analyzing a video, rewrote the parsing of this output (still compatible with older ffmpeg versions).

0.999 For Arch Linux, added detection and use of package translate-shell. In Audio/Video section, small changes to acomodate latest ffmpeg command-line args.

product-maker amorpher Dec 29 2016

product-maker kermith13 Jun 21 2013

product-maker I4C Feb 19 2013

product-maker fraxunil2 Jan 28 2013

product-maker MacWomble Aug 25 2012

product-maker kerron Aug 17 2012

product-maker sakasa Aug 14 2012

product-maker droper03121 May 29 2012

product-maker sadi Feb 06 2012

product-maker florinkobe Jan 11 2012

product-maker Drakon Jan 08 2012

product-maker KYRN Jan 03 2012

product-maker jasbutut Oct 24 2011

product-maker herver Oct 04 2011

product-maker LucasE Sep 12 2011

product-maker nikore90 Sep 06 2011

product-maker mdh3ll Aug 30 2011

product-maker Broker Jul 06 2011

product-maker sandrshe Jun 20 2011

product-maker wombalton Jun 20 2011

product-maker habbab Jun 20 2011

product-maker jaywink May 27 2011

product-maker kolesky May 05 2011

product-maker zookalicious May 04 2011

product-maker marecord Apr 30 2011

product-maker gracca Apr 29 2011

product-maker Karmicbastler Apr 28 2011

product-maker marcalbero Mar 11 2011

product-maker elkooder Mar 07 2011

product-maker zsolt Jan 08 2011

product-maker sunflower Jan 08 2011

product-maker Xanf Jan 08 2011

product-maker RedAcid Jan 05 2011

product-maker likimoki Jan 02 2011

product-maker legluondunet Jan 02 2011

product-maker acinic Nov 23 2010

product-maker xypepper Nov 10 2010

product-maker Keyblover Oct 31 2010

product-maker 95 327

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
0.999
updated Jan 05 2017
added Nov 03 2008
downloads today
0
page views today 20