View Full Version : divxenc for Linux
microchip8
19th February 2010, 23:58
WAVE_FORMAT_EXTENSIBLE is something that indicates an extension to the format chunk. It's used to indicate stuff like more than 16-bits in WAV, more than 2 chans, etc. I'm not expert on that, and I didn't test with more than 2 chans on my samples, but I'll see if it can be "fixed" or worked around in the script. If not, then you may need to stick to 2chans for now, or modify the batchfile and make it dump the audio to a real WAV file (with 6chans) and encode it to flac, bypassing the pipe thing
microchip8
20th February 2010, 00:17
Well, I just did a small test here, dumping the audio to a real WAV file (6chans) with mplayer and trying to encode it with flac. It still reports the same thing so I guess it's mplayer that doesn't add the WAVE_FORMAT_EXTENSIBLE to WAVs, regardless if one uses a pipe or physical file to encode from. All one can do is report this to mplayer-dev-eng mailing list and hope someone makes a patch
EDIT: I've reported this to the list, will wait and see what answers I'll get, if any
microchip8
21st February 2010, 02:48
@mousemurder
Here's a patch for that which fixes stuff (tested and works here). After my post on the mplayer ML, Jason picked it up and decided to hack something together.
How to patch:
1) download patch, extract and place it in the libao2 directory inside the mplayer's one
2) cd to libao2 and issue following cmd: patch -p0 < ao_pcm-waveformatextensible.diff
3) compile mplayer
4) .....
5) PROFIT!!! :p
Link: http://www.mediafire.com/?gjmeitg52a4
mousemurder
22nd February 2010, 17:47
^thanks, i'll test it out when i got some time (at work now).
fyi, for the time being i was using 6 channel ac3 sound which worked well.
microchip8
22nd February 2010, 18:25
^thanks, i'll test it out when i got some time (at work now).
fyi, for the time being i was using 6 channel ac3 sound which worked well.
Note that the patch was committed yesterday so the above is no longer needed, provided you pull latest mplayer from SVN
microchip8
27th February 2010, 14:46
ChangeLog for version 1.5.3
* Small bugfix: wrong variable used when exporting from the send_email_func() function to the batchfile
* Added new variable DEFOUTPUT to the config where user can set a default output directory. This updates the config version to 13
* Updated the set_output_filename_func() function to support the above change
* Use one variable in the presets (divxparams) for all MEncoder lavc mpeg4 encoding options. Reduces some code and simplifies things a bit
* Updated the preset.cfg file to support the "one variable for all lavc mpeg4 encoder opts"
Note: those using custom preset files for encoding should read the preset.cfg file in the doc dir and
adapt their existing preset files to be compatible with the changes. Previous older custom presets written by users will not work with this and future versions of divxenc!
microchip8
12th March 2010, 15:29
ChangeLog for version 1.5.4
* Small bugfix: the $ildctme interlace variable wasn't passed on to mencoder
* Space escaped some previously missed variables
microchip8
5th May 2010, 15:58
ChangeLog for version 1.5.5
* Reworked a bit the audio channels decode/output function. This function also got renamed from
audio_channels_func() to audio_channels_decode_func()
* Added support for the audio channels filter which can be used to add/remove/route channels. This updates
the config file to version 14 and adds variable ALLOW_AUD_CHANNELS
* Some various small improvements
microchip8
15th May 2010, 17:35
ChangeLog for version 1.5.6
* Small bugfix in the get_devices_func() function; script exits when user hits enter to accept default device
* Updated the man page
microchip8
27th June 2010, 08:05
ChangeLog for version 1.5.7
* Bugfix for the ps3 preset: autoapsect -> autoaspect. Reported by Thomas Troeger
microchip8
7th August 2010, 08:52
ChangeLog for version 1.5.8
* Add -nosub to prevent auto-loading of subs
microchip8
22nd September 2010, 09:25
ChangeLog for version 1.5.9
* Workaround mencoder stupidity. With recent versions of mencoder that have subs enabled by default
(who came up with that great idea?), in case the user selects to dump a sub for importing into mkv/mp4, during
multipass encoding the first sub will always get hardcoded due to missing -nosub option in the 2nd/3rd pass code.
This is only valid for multipass encodes so people using one pass modes (-1p or -fq) are safe.
* Small update to the -scan option. Just check if input file is there, regardless if user provides the full path or not
microchip8
29th October 2010, 10:24
ChangeLog for version 1.6.0
* Added support for setting subtitle codepage during hardcoding of external subs
* Added support for the audio equalizer filter. This updates the config file version to 15
* Removed 'time' requirement
* Fixed a bug: removed a double semicolon in the hq preset which causes mencoder to exit
contador
5th November 2010, 23:39
Thanks Froggy :)
microchip8
26th November 2010, 09:53
ChangeLog for version 1.6.1
* Remove double $HOME variable in the -scan option
tolostoi
6th December 2010, 12:31
Hi, it's look like great app :) But I can't convert my video, it is blu-ray .m2ts file, failing when trying to calculate bit rate for 700 mb output file (with me gui option 0). I guess, if set custom bit rate will work, but I want exactly 700 mb :D.
P. S. Would be great if there was an option that offers different resolution for output file :p
Thanks for the script!
P.S. 2 I forgot to put the error output
Which formula to use? [default is 0]:
-> Detecting video length...
Runtime error (func=(main), adr=69): Divide by zero
(standard_in) 1: syntax error
(standard_in) 1: syntax error
-> Video length is 0 minutes or 0.00 seconds
-> Number of frames: 0
-> Chosen/detected audio bitrate is 230 kbps
-> Estimated video bitrate for 700 MiB: kbps
-> Bits Per Pixel value: bpp
-> Bits Per Block value: bpb
Specify the new video bitrate in kbps [default is ]: 946
Would you like to inspect the MEncoder options? [y/N]: y
+===========================+
| MEncoder encoding options |
+===========================+
First pass options
~~~~~~~~~~~~~~~~~~
nice -n 10 /store/1/storage/temp/mplayer/mplayer/mencoder "00000.m2ts" -o /dev/null -passlogfile "/home/tolostoi/.divxenc/job17096/DivX-17096.log" -nosub -ffourcc DX50 -vf crop=1920:1072:0:4,softskip,scale=624:352:0,unsharp=l5x5:0.2:c5x5:0.2,harddup -sws 10 -aid 4354 -oac mp3lame -lameopts q=0:aq=5:vol=2.2:mode=1 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:turbo:vbitrate=946:vmax_b_frames=2:vme=4:mbd=2:v4mv:bidir_refine=4:precmp=6:cmp=6:subcmp=6:dia=-1:trell:cbp:mv0:last_pred=8:preme=2:qns=2:vlelim=-4:vcelim=9:autoaspect:threads=2
Second pass options
~~~~~~~~~~~~~~~~~~~
nice -n 10 /store/1/storage/temp/mplayer/mplayer/mencoder "00000.m2ts" -o /dev/null -passlogfile "/home/tolostoi/.divxenc/job17096/DivX-17096.log" -nosub -ffourcc DX50 -vf crop=1920:1072:0:4,softskip,scale=624:352:0,unsharp=l5x5:0.2:c5x5:0.2,harddup -sws 10 -aid 4354 -oac mp3lame -lameopts q=0:aq=5:vol=2.2:mode=1 -ovc lavc -lavcopts vcodec=mpeg4:vpass=3:vbitrate=946:vmax_b_frames=2:vme=4:mbd=2:v4mv:bidir_refine=4:precmp=6:cmp=6:subcmp=6:dia=-1:trell:cbp:mv0:last_pred=8:preme=2:qns=2:vlelim=-4:vcelim=9:autoaspect:threads=2
Third pass options
~~~~~~~~~~~~~~~~~~
nice -n 10 /store/1/storage/temp/mplayer/mplayer/mencoder "00000.m2ts" -o "/home/tolostoi/DivX-17096.avi" -passlogfile "/home/tolostoi/.divxenc/job17096/DivX-17096.log" -nosub -ffourcc DX50 -vf crop=1920:1072:0:4,softskip,scale=624:352:0,unsharp=l5x5:0.2:c5x5:0.2,harddup -sws 10 -aid 4354 -oac mp3lame -lameopts q=0:aq=5:vol=2.2:mode=1 -ovc lavc -lavcopts vcodec=mpeg4:vpass=3:vbitrate=946:vmax_b_frames=2:vme=4:mbd=2:v4mv:bidir_refine=4:precmp=6:cmp=6:subcmp=6:dia=-1:trell:cbp:mv0:last_pred=8:preme=2:qns=2:vlelim=-4:vcelim=9:autoaspect:threads=2
Would you like to encode a Sample? [y/N]: y
Specify the start position in hour:min:sec [default is 0:02:00]:
Specify the duration in seconds for the sample [default is 30]:
-> Encoding sample, please wait...
-> Running pass 1...
-> Done
-> Running pass 2...
Using Ubuntu 10.04 but mplayer is from another repo (because of VDPAU) I compile mplayer from svn without installing and set paths to mplayer and mencoder in dixenc's config, but error still here.
microchip8
6th December 2010, 16:45
Hi, it's look like great app :) But I can't convert my video, it is blu-ray .m2ts file, failing when trying to calculate bit rate for 700 mb output file (with me gui option 0). I guess, if set custom bit rate will work, but I want exactly 700 mb :D.
Sorry, m2ts/ts could be problematic in both divxenc and mencoder.
P. S. Would be great if there was an option that offers different resolution for output file :p
Eh? Scaling is very much supported by the script
Thanks for the script!
P.S. 2 I forgot to put the error output
<snip>
Using Ubuntu 10.04 but mplayer is from another repo (because of VDPAU) I compile mplayer from svn without installing and set paths to mplayer and mencoder in dixenc's config, but error still here.
Can you provide a small sample from that file?
tolostoi
6th December 2010, 22:35
Eh? Scaling is very much supported by the script
Yeah, but I'm nooby :confused: and somthing like
640x480
720x400
... or whatever. I mean to offer a resolutions that match on aspect ratio, because for me is hard to calculate and divide / 16.
I know, with this info
-> Detecting FPS value...
-> Detected 25.000 FPS
-> Number of frames: 132762
Would you like to set/force the Output Frame Rate (FPS)? [y/N]:
Would you like to do Frame Rate Conversion? [y/N]:
-> Detecting cropped resolution...
-> Cropped resolution is: 720x560
-> Detected Aspect Ratio (AR): 1.7778:1
-> Storage Aspect Ratio (SAR): 1.2857:1
-> Pixel Aspect Ratio (PAR): 1.3827:1
-> Total pixels: 403200
can calculate the resolution, but is hard for me. If it can be set the width manualy and the script offer rest will be good.
Can you provide a small sample from that file?I don't know how to cut piece, can cut a part with avidemux, but output wil be another container.
Edit: I found how to cut a piece (with tsmuxer) I wil sent link on PM
microchip8
7th December 2010, 06:42
@tolostoi
Sorry, I don't think I'll add this for the resolution. But you can already let mencoder do it for you as the 'scale' filter supports it. From the man page of mplayer...
0: scaled d_width/d_height
-1: original width/height
-2: Calculate w/h using the other dimension and the prescaled aspect ratio.
-3: Calculate w/h using the other dimension and the original aspect ratio.
-(n+8): Like -n above, but rounding the dimension to the closest multiple of 16.
So, for example if you want to scale the width to 720 and let the height be auto-calculated and be divisible by 16, you can provide to divxenc 720:-10. It will calculate the height taking into account the prescaled aspect ratio (which is the -2 from above) and if you add 8 to it (the -n+8, thus resulting in -10) it will give you a height divisible by 16. Note that if you use that in divxenc, you'll get errors in some of the informative functions that print stuff but you can safely ignore that. They're not critical, just print information
About the target file size calculation. I did a few testings here and it seems the default TS demuxer of mplayer does not report correctly the length (ID_LENGTH appears to always be 0.00). So I can fix that by switching over to -demuxer lavf
microchip8
7th March 2011, 23:32
ChangeLog for version 1.6.3
* Fixed a bug in directory batch mode were wrong conditional was used to check for the DEFOUTPUT variable
* Display which file is currently being processed in batch mode
* Check only for files while in batch mode
* Fixed the video_deblock_func() function. Wrong vars used for some of the filters
microchip8
29th March 2011, 09:28
ChangeLog for version 1.6.4
* Added support for setting the crop rounding value
microchip8
2nd January 2012, 21:52
ChangeLog for version 1.6.5
* Added support for setting the default video bitrate/quantizer and default audio codec in the config file, which introduces three new variables; DEFAULT_VID_BITRATE,
DEFAULT_VID_QTZR and DEFAULT_AUD_CODEC. This bumps the config file version to 17
* Renamed variables DEFOUTPUT, DEFPATH and DEFBATCHDIR to DEFAULT_OUTPUT, DEFAULT_PATH and DEFAULT_BATCHDIR
* Replaced some if conditionals in the -sc option by using 'test' directly
* Added an option to pass additional parameters to MEncoder. Useful if user wants to pass options such as -mc 0 -noskip
* Added support for encoding to DTS audio through the dcaenc encoder which can be found at: http://aepatrakov.narod.ru/dcaenc/
* Minor changes to the video_delogo_func() function. Use $sourcetype, $device, $vid and $MPLAYEROPTS variables. Also use -nosound in MPlayer
* Improved the mkvtags file. Escape special characters like &, <, > and " in the Title field
* Use -vo dummy in MPlayer in the audio code. Seems to work better for some files
microchip8
27th September 2012, 11:47
ChangeLog for version 1.6.6
* Don't append '- chapter [id]' to output filename when user encodes only specific DVD chapters
* Change bad default bitrate value in DTS audio encoding to 384kbps
mousemurder
10th April 2013, 15:55
hi froggy, i get a a segfault with xvidenc-8.8.4 on both fedora-18 and xbmcbuntu-12.1
if i take out this parameter it runs fine:
-vc mpeg12mite be an upstream change from mencoder ?
regards,
microchip8
10th April 2013, 16:00
Hi mousemurder,
Yeah this is possible. I think I'll remove -vc mpeg12 from future versions as MPlayer heads to ffmpeg's native implementation for mpeg decoding. The reason I used -vc mpeg12 in the past is because it produced less errors
EDIT: I'll release a new version without it tomorrow
microchip8
11th April 2013, 15:05
ChangeLog for version 1.6.7
* Use ffmpeg's MPEG12 decoder instead of the libmpeg12 one
* Updated the man page
microchip8
22nd May 2013, 18:07
ChangeLog for version 1.6.8
* Bugfix: add missing 384 kbps option for AC3 audio
* Notify the user when we first create the config file
* SAR is Sample Aspect Ratio, not Storage Aspect Ratio. Corrected this mistake
microchip8
28th May 2013, 11:37
ChangeLog for version 1.6.9
* Use aften for AC3 audio encoding as MEncoder is currently broken. This updates the config file version to 18
microchip8
29th May 2013, 08:47
ChangeLog for version 1.7.0
* Removed workarounds for older MP4Box versions. As of this release, only gpac 0.5.0 and higher are supported.
SVN version is highly recommended, though
* Use o=mpv_flags=+cbp_rd instead of cbp
* When using AC3 audio, language TID for MKV was set to 1. It should be 0
microchip8
2nd September 2013, 18:44
ChangeLog for version 1.7.1
* Fix audio TID for MKV when using neroAacEnc as encoder
microchip8
24th October 2013, 22:45
ChangeLog for version 1.7.2
* Allow encoding of 640 kbps AC-3 audio
* Detect and display audio codec info when input is file
* Added support for setting the Dynamic Range Compression (DRC) profile for AC-3 audio
* Fixed AC-3 audio encoding by adding -readtoeof 1 which ignores WAV header signaling
* Renamed aften $AC3 var to $AC3ENC
* Use AC-3 instead of AC3 in metadata info
microchip8
28th October 2013, 11:17
ChangeLog for version 1.7.3
* Bugfix: codec detection for 2nd and 3rd audio track from DVDs did not work correctly
* Updated the man page
microchip8
29th October 2013, 05:49
ChangeLog for version 1.7.4
* Added support for the Opus audio codec. Requires opusenc and a recent version of mkvtoolnix with support for Opus
* Renamed track_echo_func() to audio_track_echo_func() for consistency
* Added support for setting the AC-3 Exponent strategy search size
* Allow applying an LFE low-pass filter for AC-3 audio
* Improved aften options passing
* Updated the man page
microchip8
30th October 2013, 15:02
ChangeLog for version 1.7.5
* Added -demuxer lavf for more reliable detection of audio streams in file input mode
* Implemented virtually infinite support for the amount of audio tracks. This introduces a new variable in the
config file, MAX_AMOUNT_AUD_TRACKS, where the user can specify how many audio tracks he/she wants the script to support.
* Enabled multi-channel support for Opus audio
* Moved the MKV audio filters metadata after the audio codec/language metadata
* Fixed copy and pcm audio encoding
* If user chooses PCM for subsequent audio tracks, don't error out but just skip the track
* Some minor clean-ups
microchip8
31st October 2013, 13:05
ChangeLog for version 1.7.6
* Implemented support for virtually an infinite amount of subtitles. This introduces a new variable,
MAX_AMOUNT_SUBS, to the config file where the user can set the amount of subtitles he/she wants the script to support
* Added output name to the message of the mail notification feature
* Fixed the nosound audio option
* renamed the rmtemp() function to exit_func()
* Return proper exit codes. 0 on success, 1 on error and 2 on user interrupt
microchip8
1st November 2013, 18:45
ChangeLog for version 1.7.7
* Merged the file and dvd audio detection/selection code
* Merged the audio code for the first track with the code for subsequent tracks
* Set a default audio ID based on input (ie, 0 for file and 128 for DVD)
* Small improvements to the subtitles code
* Updated the presets to support recent SVN MPlayer versions
* Use -demuxer lavf for file and dir encodings
* Renamed the -help switch to -h
* Improved the way audio tracks information is presented to the user
* Make destination dir if it doesn't exist for saving to the batchfile
* Updated the man page
microchip8
3rd November 2013, 12:35
ChangeLog for version 1.7.8
* Placed the $demuxer variable higher. Fixes audio detection for file input
* Moved some audio selection code into a new set_audio_codec_func() function.
Reduces some code duplication and removes the default_audio_codec_func() function
microchip8
11th November 2013, 18:16
ChangeLog for version 1.7.9
* Allow importing of PGS subtitles into the MKV container
* Added support for importing a chapters file for MKV/MP4/OGM when input is file
* Added support for setting the audio language code for MKV/MP4/OGM when input is file
* Added support for setting the subtitle language code when importing subs into MKV/MP4/OGM
microchip8
5th May 2014, 19:18
ChangeLog for version 1.8.0
* Add -nosub option to prevent auto-loading of embedded subs
* Use -mc 0 -msglevel demuxer=-1 to work around the copy issue of MEncoder
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.