Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Linux, Mac OS X, & Co

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th February 2013, 13:10   #1  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
file2dvd for Linux

Hi,

I wrote a small script for converting video files into DVD compliant encodes and structures. The main reason for writing it was so I can watch DVDs on my Medion TV which has an integrated DVD player, but doesn't support DivX/Xvid and co codecs. The output from the script works with no issues on my DVD player but I can't guarantee it will do the same on other DVD players. Best is to test and see.

Requires bc, MPlayer, ffmpeg (for encoding), dvdauthor and mkisofs (which should be a link to genisoimage)

http://sourceforge.net/projects/file2dvd/

PS: this script is dedicated to my mom, who's a big movie lover and who passed away from cancer on the 26th of January 2013.
__________________
ffx264--ffhevc--ffxvid

Last edited by froggy1; 10th February 2013 at 13:20.
froggy1 is offline   Reply With Quote
Old 19th February 2013, 18:46   #2  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
Hi there,

thanks for sharing this...it is always nice to see how other people solve their problems.
And sorry to hear about your mother. It always hurts when a beloved one goes away.

I must admit that I rather use Windows plus the Freemake Video Converter for such purposes. You simply drag in your source video(s), choose the output format and click on "go".

Just allow me a comment / question:
May I ask why you mainly use Bash scripting for your tools ?
Personally I always found Python more suitable and simpler for a lot of purposes (e.g. string processing, calculation). I often simply "glue" together a few bash arguments with Python and do things like string processing, comparison, etc in Python.

Here are three examples for my crappy scripts.

MKV DTS to AC3 converter (converts DTS to AC3 streams and strips DTS streams):
http://pastebin.com/w6JtVczr

MKV DTS to AC3 converter (which only adds AC3 streams to the MKV and leaves the DTS streams in place):
http://pastebin.com/0QaYSWFC

A simple multi process MP3 encoder:
http://pastebin.com/Cd71eU6a
Darksoul71 is offline   Reply With Quote
Old 19th February 2013, 18:57   #3  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
Hi Darksoul71

Thanks for the heads up. The reason why I use Bash is because it's the only thing I know at the moment and I lack the time to learn something new and probably better than shell scripting.
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 19th February 2013, 19:28   #4  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
Quote:
Originally Posted by froggy1 View Post
Hi Darksoul71

Thanks for the heads up. The reason why I use Bash is because it's the only thing I know at the moment and I lack the time to learn something new and probably better than shell scripting.
Well, Python is pretty straight forward. Simply have a look at my three examples and all the other scripts around in the web.
Darksoul71 is offline   Reply With Quote
Old 20th February 2013, 14:15   #5  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
Just a short note:
Not all of the encoding parameters you use, are supported by the standard version of ffmpeg included with Ubuntu-based distro.

Using your script under the latest Linux mint version I get this error messages:
Code:
Unrecognized option 'mpv_flags'
Failed to set value '+cbp_rd' for option 'mpv_flags'
Darksoul71 is offline   Reply With Quote
Old 20th February 2013, 14:20   #6  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
Quote:
Originally Posted by Darksoul71 View Post
Just a short note:
Not all of the encoding parameters you use, are supported by the standard version of ffmpeg included with Ubuntu-based distro.

Using your script under the latest Linux mint version I get this error messages:
Code:
Unrecognized option 'mpv_flags'
Failed to set value '+cbp_rd' for option 'mpv_flags'
Yes, I know. You need a more recent version like ffmpeg 1.0.x or higher. If you can't get it, modify the options at the top of the script
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 20th February 2013, 16:22   #7  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
So, in other words one is better off to use a pre-compiled static version of ffmpeg from pages like this:
http://ffmpeg.gusari.org/static/64bit/

Darksoul71 is offline   Reply With Quote
Old 20th February 2013, 16:24   #8  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
Sure, but if your distro provides a supported version (1.0 and higher) you can use it instead. My openSUSE 12.2 has ffmpeg 1.0.4 and it works with no issues
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 20th February 2013, 17:27   #9  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
Yes, for sure !
I just wanted to highlight this ! Those error messages about unsupported options are simply not self-explaining for people which are not skilled with the shell and / or the standard Linux AV tools such as ffmpeg or mencoder.
That's why I highlighted it.
Darksoul71 is offline   Reply With Quote
Old 20th February 2013, 17:44   #10  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
Yes, I understand that but on the other way, omitting them to support a broader range of ffmpeg versions sacrifices quality :P
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 24th February 2013, 11:19   #11  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
@Darksoul71

I looked at your Python scripts and I must say it looks Chinese to me, haha. I'm so used to Bash that I guess I'll have difficulties learning something else.
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 24th February 2013, 11:21   #12  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
@froggy1: Agreed....I had the benefit of a one week seminar about coding Python last year.
This was my entry...but I have to admit that my code is quite ugly....
In the end: It works for me and this is all what is important to me
Darksoul71 is offline   Reply With Quote
Old 14th March 2013, 20:54   #13  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
ChangeLog for version 1.6
Code:
* Use XML file for dvdauthor
* Be compatible with dvdauthor version 0.7.x
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 15th March 2013, 17:38   #14  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
ChangeLog for version 1.7
Code:
* Added resolution to the dvdauthor XML file
* Added chapter marks at every 5 minutes to the dvdauthor XML file
* Few typo fixes
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 11th May 2013, 14:08   #15  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
ChangeLog for version 1.8
Code:
* & character is often present in movie titles. Escape it in the dvdauthor XML file
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 13th May 2013, 12:41   #16  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
ChangeLog for version 1.9
Code:
* Added workaround for input files with spaces in their name
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 14th May 2013, 16:09   #17  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
ChangeLog for version 2.0
Code:
* Added one more preset (-nq - Normal Quality)
* Added -v option to display version
* Added -h option for help info. Currently this just calls the man page
* All presets now use a dash (eg, -vhq) for consistency reasons
* Use -vf scale instead of -s for resolution scaling
* Add Volume ID when creating ISO file
* Updated the man page
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 15th May 2013, 09:26   #18  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
ChangeLog for version 2.1
Code:
* Added support for a config file. It will be located in $HOME/.file2dvd. In the config file one can set the default output dir, default scaler,
   default nice value and the paths to the programs
* Allow user to specify the passmode (ie, 1-pass or 2-pass encoding). This introduces the -1p and -2p switches
* Check status of ffmpeg. Abort and clean up if it's not successful and notify the user
* Check status of dvdauthor. If successful, proceed with ISO creation. If not successful, warn and exit
* Remove dvdauthor XML file upon success
* Updated the man page
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 16th May 2013, 10:02   #19  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
ChangeLog for version 2.2
Code:
* Added support for interlaced encoding and deinterlacing
* Use -trellis 2 for the -vhq, -ehq and -uhq presets
* Set GOP to 15 for PAL and 18 for NTSC
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Old 17th May 2013, 09:35   #20  |  Link
froggy1
ffx264/ffhevc author
 
froggy1's Avatar
 
Join Date: May 2007
Location: Belgium
Posts: 1,476
ChangeLog for version 2.3
Code:
* Don't use -target pal|ntsc-dvd and instead go the "manual" way of config. This approach seems to eliminate buffer underflow messages on
   older ffmpeg versions (eg, 1.0.x) and potentionally fixes freezes on some DVD players
* Minor quality optimizations to the presets
* Reworked the interlace/deinterlace code
* Use the clean_func() function when exiting upon error. That way we can remove the output directory which is no longer needed in such case
__________________
ffx264--ffhevc--ffxvid
froggy1 is offline   Reply With Quote
Reply

Tags
dvd, ffmpeg, file2dvd, mencoder, mpeg2

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.