dmencoder is an HTML frontend for the well-known movie encoder mencoder, what is part of the mplayer package. It's not really and individual audio/video processing software, but only an interface what uses mencoder for movie encoding/cutting.
dmencoder has 3 main goals:
For starting the job directly from your browser you will need a http server running that can handle CGI. You must copy the content of the cgi-bin directory in this package to your server's cgi-bin directory.
For operating with external audio file you may need sox (only if you want to use it not from the beginning of the audio data but with some offset). remark: this feature is not yet implemented
For OGM movies you will need oggenc and ogmmerge (OGM support is not yet in this package, but will be available soon).
You can download dmencoder from the Hungarian Unix Portal: www.hup.hu/old/dmencoder. Other way to get it is writing me an e-mail , and I will send you it. From me you can get the latest version, but it may take a little time.
Like in other softwares, dmencoder provides you fast help by yellow bubbles. Stop your mouse cursor over an element on the screen and you will get short help. You can reach this help file by clicking the Help button at the top of the page.
There is an other button to the right: Clear all. This will set all values to the default.
Before you convert or cut your movie, watch it. It is necessary if you want to cut it, and will help you to choose the best encoding parameters. For example, you can see need for noise reduction or deinterlacing for a bad quality movie, or if you have a really good movie, you may want to split it to 2 CDs to preserve the best possible quality.
After you've watched the movie, you should choose a size. Usually you will put the movie on 1 or 2 CDs. If the length is more than 90 or 100 minutes, use 2 CDs, otherwise it can fit on one. Of course if you use more space, you will get better quality. Don't write movies on 74 min CDs, always use 80 min ones. The difference is 50 Mbytes - 8 percent more space and quality!
After you've chosen the size, type the total length of the movie in the three Movie length boxes in HH:MM:SS format and the target size in the next field (Target movie size). For one CD that should be 700 Mbytes, for two CDs it's 1400.
Don't forget that the index will take additional space (a few MBs), so count with 690/695 MBs of space!
Usually the audio data is in the source movie file. Otherwise if it's in an external audio file, check External file and select that file.
At this moment dmencoder can produce audio only in MP3 format. There are three different kind of encoding: Constant, Average and Variable bitrate.
There is a fourth possibility, the Only copy mode. Selecting this option will cause mencoder not to process audio but to copy it from the original movie to the target. You will usually need this if you want to cut an already compressed movie.
After choosing bitrate type and quality or bitrate, you have only one thing to do: selecting number of channels. For mono audio of course you will need mono setting, for stereo sound you should select joint-stereo.
dmencoder will calculate the size of the audio track and write it in the Audio size box. This can help you to choose the best audio and video bitrate to fit the movie in the selected size. Encoding video bitrate is also calculated (see Video section).
Important! When using mono sound, divide the ABR/CBR bitrate by 2. For example if you would use 128 Kbit/sec for stereo ABR audio, in the case of mono sound, change 128 to 64!
mencoder will try to correct A/V sync, but in some cases it can cause A/V desync. To avoid this, check Maximum A/V correction box and set it to 0 seconds.
You can cut a range from the source movie and write it to a new file. To do this check the Range box, and enter startin/ending positions in HH:MM:SS format. When you enter Movie length, the ending position will be automatically set to end of the movie.
In some cases mencoder cannot seek in the file because of the missing or invalid index. If this happens, mencoder needs to rebuild the index. You can force this by checking Build index box.
After audio settings are done, dmencoder will fill the Encoding video bitrate field. This value is maybe the most important feature of the movie. This value means the amount of data used for storing a given length of video. Higher bitrate will cause larger files but better quality. You can change this value. It would be a good idea to decrease the calculated bitrate by 2 or 3 because encoding with the calculated value may cause slightly larger file than you want.
Other very important feature is the Resolution. With lower resolutions the movie will be very ugly and you will see many blocks. Higher resolutions require higher bitrate to be nice.
If resolution of source file is different than the target resolution, check Scaling needed box
To help you choose the best resolution for the given bitrate Bit Per Pixel value is calculated. This means the number of bits describing one pixel in the movie. Changing the bitrate of resolution changes the BPP. Try some resolutions until you find BPP value between 0.2 and 0.24, but don't go below 480x360 or 448x336.
FPS if the stored frames per second. Normally it's 25 in PAL movies, so rarely need to change it - and you shouldn't do it.
You can choose Video codec from a long list, but DivX 4/5 is most recommended. Sometimes you may need DivX 3 because of compatibility reasons, for example if you plan to play the movie on an older hardware DivX player.
A special mode is Only copy. With this setting the video won't be encoded, only copied. Together with this setting you can encode audio or copy it too - if you want only cut the movie, select Only copy for both audio and video.
In the Movie type selection box you can select some luma/chroma presets for different movie types.
You can change default FourCC - to do this, check the Set FOURCC to box and write the four character long descriptor in the textbox. I never used this, but sometimes it could be useful.
Store aspect ratio in AVI header:
This feature is useful if the original video aspect is different than the pixel width/height ratio. By checking it you can force the player to display the output file with the specified aspect ratio what can be given as a fraction or a floating point number (i.e.: 4/3 or 1.333) This feature is implemented in the OpenDML extension of AVI, so not all video player will handle it - but mplayer can, and who cares the others? :)
Automatic aspect correction:
libavcodec automatically calculates the necessary parameters to keep correct aspect ratio and stores it in AVI header. The drawback is that you will be able to play this file with a player that recognizes the OpenDML tag in the header - and I know no such player except mplayer :)
Cut part of image, for example for removing black lines above and below the image. You have to enter width and height of the rectangle you want to see, and the coordinate of the left upper corner. This rectangle is usually as wide as the whole image, so Pos X will be zero.
This parameters are relative to the source resolution!
mplayer can autodetect crop parameters with the following command:
mplayer movie.avi -vf cropdetect -vo null
With this filter you can remove logos from TV-recordings. It's not perfect, but give it a try!
How to modify delogo presets:
Open dmencoder.html with a text editor (I prefer vim), and search for the string "delogo". You will find delogo_preset function, where you can modify delogo parameters.
Removes interlacing effect in the movies recorded from TV
Flips the image upside down
Mirrors the image on the Y axis
Removes noise with the
hqdn3d filter. Be careful with this, use
noise reduction only if you really need it, because encoding algorithm will
smooth image and removes some noise.
If you need stronger noise reduction, increase the luma/chroma/time strength.
The encoder tries to find the best encoding for each frame - this takes long time, but can increase quality.
You shouldn't uncheck this option...
This feature can slightly improve quality, but requires a little stronger machine for playback.
This seems only useful for high bitrate encodings.
Selecting full motion estimation can make motions softer but this method is really slow.
With Keyframe interval you can set the distance between two keyframes. In dmencoder this is set in seconds. Default is 10 secs (usually 250 frames). Little distance will produce larger files and will make cutting harder (you can cut at keyframes), but will slightly improve quality.
If Don't skip frames box is checked, mencoder will not skip any frame.
The final step is selecting Source and Target file. None of them is required, but if no source file is specified, you have to write it manually in the script otherwise it won't work. If target file is missing, dmencoder will write the encoded file to ~/dmencoder_out.avi
If First pass to /dev/null box is checked, the output of first pass will be redirected to /dev/null instead of writing to a file. This will make encoding a little faster because mencoder won't have to write hundreds of MBs to the HDD. Of course you won't be able to check the output under the first pass.
When running the script through CGI, don't specify any PATH before the target filename; the movie will be placed in your cgi-bin directory (will be fixed soon)
The syntax of some options has changed in the CVS version of mplayer. One of these options is the '-vop' switch what is now '-vf'. To use the right syntax, select version of your mplayer.
You should always set 2 pass mode, unless you have really little time, or you don't care about quality.
If you want your machine to shutdown after encoding, check Shutdown after encoding box. To use the shutdown command you usually need to have root rights!
Finally, press the Generate script button. In the box below you will find the script that does the job. There are several ways to use it. At first select all text in the box, and then:
cat >encode; chmod +x encode
ENTER, middle mouse button and
CTRL-D. You will get an executable file named
!WARNING! This script is extremely insecure now, don't put it on a server connected to the Internet!!!
dmencoder is under hard development, so there may be bugs in it (but I hope you won't find any). But if something doesn't work, don't be sure it's my fault.
plans: movie from picture files, DivX native codec support, OGM support, cut multiple segments, merge files, preview and finally rewrite dmencoder in C :)