iAudiophile.net Forums
Go Back   iAudiophile.net Forums > Flash-Memory Players > Cowon D2/D2+ > D2 Videos & Recordings

Post New Thread  Reply
 
Thread Tools Display Modes
Old 07-01-2008, 21:47   #1
scipero
Junior Member
 
Join Date: Jun 2008
Posts: 9
Default movieToD2: A Python Program for Video Conversion

I've made some improvements to the program, cleaning up the source a bit and, more importantly, adding source file parsing. Now the script will automatically set the proper aspect ratio and mix-down a 6-channel surround sound file to stereo. Call it version 0.2. Or call it Diane if you prefer.

As before, you only need to type:

Code:
movieToD2 <filename>
I've again zipped the file and attached it to this message. I didn't hear any responses from the 1st version, but would welcome comments or requests for future versions. The program should be particularly useful (I think) for people on linux.


Now out of date. The latest version (1.52) has several improvements. See the link in my last post.
Attached Files
File Type: zip movieToD2.zip (3.5 KB, 0 views)

Last edited by scipero; 09-06-2008 at 20:05.. Reason: New version
scipero is offline View scipero's Photo Album   Reply With Quote
Old 07-03-2008, 14:56   #2
adamorjames
B4NZ0R'd!
 
Join Date: Feb 2008
Location: United States
Posts: 137
Default

cool thanks
adamorjames is offline View adamorjames's Photo Album   Reply With Quote
Old 07-04-2008, 21:41   #3
scipero
Junior Member
 
Join Date: Jun 2008
Posts: 9
Default Revised script

Help function fixed.
Attached Files
File Type: zip movieToD2_revised.zip (3.5 KB, 0 views)
scipero is offline View scipero's Photo Album   Reply With Quote
Old 07-12-2008, 10:44   #4
scipero
Junior Member
 
Join Date: Jun 2008
Posts: 9
Default Version 0.22: several improvements

I've been working on syncing issues and believe I've improved them a great deal. The key is the mencoder harddup filter. It produces slightly larger files, but the A/V sync is much better in the D2.

I've also added automatic detection and conversion of the source file's frame rate and two-pass encoding through the "-2" flag.

As before, you can get the options by typing:
Code:
movieToD2 -h
...and in most cases can get the file you want by simply typing:
Code:
movieToD2 <filename>
I've attach the program again as a .zip file; please let me know how it works for you.
Attached Files
File Type: zip movieToD2.zip (3.9 KB, 0 views)
scipero is offline View scipero's Photo Album   Reply With Quote
Old 07-16-2008, 21:13   #5
rwreed
Junior Member
 
Join Date: Jul 2007
Posts: 2
Default aspect error

Hi,
I'm Trying out your utility and finally got it to start converting. A couple of problems (mostly cosmetic) I hit at the beginning. First the help says you should enter the aspect as 4:3, 16:9 etc, but the colon generates and error. They have to be entered as decimals (4.3 16.9) I think. Second on my system, mencoder is not located in /usr/local/bin so putting a hard path in also generates an error. If it does exist there just invoking mencoder should be enough.
Trying it now. I've had nothing but sync problems with a lot of longer shows so I'm hoping this will do the trick. Will let you know if I find anything else.
Thanks for your hardwork.
Randy
rwreed is offline View rwreed's Photo Album   Reply With Quote
Old 07-24-2008, 22:10   #6
scipero
Junior Member
 
Join Date: Jun 2008
Posts: 9
Default 1 fixed; 1 pending

Thanks for the feedback. The aspect problem you found was a silly regression error on my part. As it's now written the program should be given a numeric format for aspect like this:

Code:
movieToD2 -a 1.7777 <movieFile>
I didn't notice the problem because I haven't used the -a flag since I added source aspect parsing to the program. I've now fixed the help output and attached the revision to this reply.

The hard-coded paths to mencoder and mplayer are there because I have 2 versions of each program on my system. I could see how it might be better to take them out, but I'll hold off on that until I (hopefully) get more feedback. You clearly know how to change them already, but I should state here for the less experienced that the script expects to find mencoder and mplayer in the directory /usr/local/bin. If (like rwreed) they're elsewhere, say in /usr/bin, the paths can be changed easily in the script. Just open the movieToD2 program in a text editor and change these global paths at the top to match the location in your system:

Code:
MENCODER = "/usr/local/bin/mencoder"
MPLAYER = "/usr/local/bin/mplayer"
So did you try encoding any of those longer files you mentioned? If so, how did it work?
Attached Files
File Type: zip movieToD2.zip (3.9 KB, 0 views)
scipero is offline View scipero's Photo Album   Reply With Quote
Old 07-27-2008, 14:33   #7
scipero
Junior Member
 
Join Date: Jun 2008
Posts: 9
Default Version 1.3: paths fixed

I just discovered a standard method to avoid the hardwired paths (i.e. /usr/bin/env, for those who care). It's now fixed.

The new version number isn't really significant; I've just started using a version control system. Besides, I think the script is now working well enough to merit a 1.X number.
Attached Files
File Type: zip movieToD2.zip (3.9 KB, 0 views)
scipero is offline View scipero's Photo Album   Reply With Quote
Old 08-16-2008, 11:22   #8
scipero
Junior Member
 
Join Date: Jun 2008
Posts: 9
Default Version 1.4: better sync, flash handling

I've finally given up on mplayer sync. It usually works, but not always. The script has been heavily edited now to transcode the video and audio separately, then mux them with ffmpeg. As an additional benefit the program now handles flash video better, though there are still some sync issues with .flv format.

The only significant change in usage is that you will now have to have ffmpeg and lame as well as mplayer. Most people who have mplayer will already have them installed; if not, all distributions have packages for them.

The file is attached, as always.
Attached Files
File Type: zip movieToD2.zip (4.3 KB, 0 views)
scipero is offline View scipero's Photo Album   Reply With Quote
Old 09-06-2008, 09:53   #9
scipero
Junior Member
 
Join Date: Jun 2008
Posts: 9
Default Version 1.51: more minor improvements

The main change this time is to adopt a good idea that linuxnutzer put into his recent bash script. If the program detects mp3 audio in the source file it simply copies it into the destination file without transcoding it. Saves time and produces a higher quality D2 file.

As before you need only type:
Code:
movieToD2 <sourcefile>
The source file will be automatically scanned by the program and good defaults chosen. If you want to override the defaults you can see the various options by typing:
Code:
movieToD2 -h
Attached Files
File Type: zip movieToD2.zip (4.5 KB, 0 views)
scipero is offline View scipero's Photo Album   Reply With Quote
Thanks from:
Old 09-06-2008, 15:06   #10
linuxnutzer
Junior Member
 
Join Date: Dec 2007
Posts: 23
Default

Quote:
Originally Posted by scipero View Post
The main change this time is to adopt a good idea that linuxnutzer put into his recent bash script. If the program detects mp3 audio in the source file it simply copies it into the destination file without transcoding it. Saves time and produces a higher quality D2 file.
A little note to your latest change. Mplayer reports ID_AUDIO_CODEC=mp3 also for mp2 audio, that can be used for DVD video. But the D2 will not play a video with mp2 audio. Therefore I use the tag ID_AUDIO_FORMAT to identify the audio format which is 80 for mp2 and 85 for mp3.

Have fun

linuxnutzer
linuxnutzer is offline View linuxnutzer's Photo Album   Reply With Quote
Old 09-06-2008, 20:02   #11
scipero
Junior Member
 
Join Date: Jun 2008
Posts: 9
Default OK, version 1.52 attached

Thanks for the note; I've altered the autoscan parameter in the program and attached it again. Usage is identical to 1.51.
Attached Files
File Type: zip movieToD2.zip (4.6 KB, 0 views)
scipero is offline View scipero's Photo Album   Reply With Quote
Reply

Thread Tools
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 -5. The time now is 07:21.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.


Copyright © 2006-2011 CrowdGather |  About iAudiophile |  Advertisers | Investors | Legal | Contact