View Full Version : h264enc for Linux
Pages :
[
1]
2
3
4
5
6
7
8
9
10
11
12
13
14
15
microchip8
9th February 2008, 10:03
h264enc is a rather advanced shell script which can help you to encode video files or DVDs to the H.264 video format. It has built-in quality presets (34 so far), supports a lot of video (pre/postprocessing) filters and a few audio filters as well. Further it supports 9 different audio codecs and has a (limited) batch encoding capability. Muxing is also supported for the MKV, MP4 and OGM containers. h264enc by default outputs to AVI and then remuxes it to the chosen container. h264enc heavely relies on MEncoder and MPlayer as it uses both to do the whole setup/encoding
at http://h264enc.sourceforge.net is a FAQ about h264enc, so if anyone is interested, just go put up some coffee and read it through
h264enc is also available from my openSUSE build service repo
http://download.opensuse.org/repositories/home:/microchip8
Henrikx
9th February 2008, 16:35
Cool.
THX.
Simple translation and presentation.
http://www.movie2digital.de/thread.php?postid=467704&sid=7db8761c8b3c46967c45f34e48cede7d#post467704
microchip8
9th February 2008, 16:38
thanks for the German translation ;)
Henrikx
9th February 2008, 17:51
Presentation by Ubuntuusers.de too...:)
http://forum.ubuntuusers.de/topic/151475/?p=1220571#1220571
Adub
9th February 2008, 20:38
The only problem is, if you make one mistake, you have to start all over again.
microchip8
9th February 2008, 20:45
The only problem is, if you make one mistake, you have to start all over again.
then don't make a mistake and keep awake :P ... seriously, i've never made a mistake with it, especially when using the presets
Adub
10th February 2008, 05:43
No, I mean when entering the values. If you are not experienced with the script, and you enter a wrong value, you end up having to start all over again.
microchip8
10th February 2008, 06:15
yes this is true, but after some time one gets used to it. I think this is the same with all scripts that operate like h264enc, especially those that offer a variety of options
microchip8
16th February 2008, 10:54
ChangeLog for version 8.1.8
- Export testing condition to the batch file for the output of MEncoder
and for the output directory as well
- Changed FPS naming for Silent Speed to Silent Film
- Added support for automatic brightness/contrast control
- Bugfix: Only ask for deletion of the AVI file if the user has chosen
to remux it to one of the supported containers
- Removed duplicate $quiet variable in the video_deinterlace_func()
function when deinterlacing with a frame doubler
- Modified the -iso option to use 'pv' for DVD ISO dumping instead of
'dd'. 'pv' provides us with a nice progress bar which is useful as
it takes a long time to dump a DVD, so the user can follow the
progress. 'dd' provides no such thing.
- Updated the -iso option to support dual-layer DVD discs (~8.54 GB)
- Added support for setting the subtitle alignment
- Added support for setting the subtitle Gaussian variance strength
when hardcoding subtitles into the movie
- Use $IDXFILE variable for the MP4SUB and MKVSUB variables
- Tweaks to the HD presets. Increased VBV buffer size to 14475 and
set keyint to 14 and keyint_min to 2 for the SD/HD presets. Also
increased b-frames usage from 3 to 6
- Various small code improvements
- Updated the man page
microchip8
18th February 2008, 14:39
ChangeLog for version 8.1.9
- Updated the DVD chapters code to support the latest SVN version
of MPlayer/MEncoder
- Small improvements to the cropping code
- Fall back to 'dd' for ISO dumps if 'pv' is not available on
the user's system
- Set default noise pattern to be Luma + temporal instead of Luma & Chroma + temporal
- Added support for the lossless format of the Sonic audio codec
- Added the X-Men 3 matrix, Q matrix, Q2 matrix, Soulhunter V1
matrix, Soulhunter V2 matrix, MP4Guy's low bitrate matrix, Audionut
high bitrate matrix and Audionut general matrix to the package.
Thanks to Audionut, MP4Guy and Soulhunter
- Bugfix: the ivtc/telecine process should check for the $deintfilter
variable instead of the $deintfps one. ivtc/telecine is mutually
exclusive with deinterlacing
- Improvements to the MP4 muxing part when exporting the options to
the batch file. From now on, the FPS needed for MP4Box is directly
taken from the AVI file. This approach is much more reliable and the
user no longer needs to edit the FPS value for MP4Box when exporting
the options of NTSC content to the batch file.
- Added one Anime high-quality preset (anihq)
- Updated the presets_keyint_func() function
- Added support for the Tfields deinterlacer @ original frame speed
and Tfields + fast/medium/slow/slowest Mcdeint @ original frame speed
- Replaced a few 'if' conditionals with 'case' conditionals
- Updated the README.matrices file
- Typo fixes
- Updated the man page
Henrikx
18th February 2008, 14:59
Good news!
microchip8
20th February 2008, 10:16
Mainly a bugfix/code clean up release. ChangeLog for 8.2.0
- Fixed a bug in the deint_custom_fps_func() function. Variable
deintfsp for NTSC @ 59.94 fps should be deintfps
- Fixed a bug in option 8 of the $dfilter variable which was
using a invalid underscore. Should be -field-dominance 1
instead of -field_dominance 1
- Clean ups of old commented out code
- Reordered the deinterlacing menu. Separated the normal
deinterlacers from the frame doubling ones
- Small improvements to the audio_channels_func() function
- Renamed variable $ss to $softscale
- Added two iPod Classic presets for iPods that support
only H.264 @ Level 1.3 (icvp and ichqvp)
- Updated the README.h264enc file
- Updated the man page
microchip8
24th February 2008, 11:45
ChangeLog for version 8.2.1
- Removed the 'user defined' option from the deint_custom_fps_func()
function as it can confuse users who don't really know what to
enter there
- Added support for different audio resampling modes
- Added support for the 'lavcresample' audio resample filter
- Made the audio_resample_func() function to be menu driven
- Converted the MKV/MP4/OGM code to base its decision on
variable $audiocodec instead of variable $audcodec. Makes
the code less complicated
- Updated the 'preset.cfg' file. Custom presets now support
the following additional options: ratetol, vbv_maxrate, vbv_bufsize,
vbv_init and cqm and me_prepass
- Preparations for the motion estimation prepass patch
- Added support for automatic detection of the video aspect
- Don't continue if MEncoder exits with a non-zero status
- Added two Black & White/Gray presets for BW movies (bw and bwhq)
- Small improvements to the custom_matrix_func() function
- Small improvements to the DVD titles scanning code
- Small improvements to the check_diskspace_func() function. Patch
by Gunter Ohrner
- Updated the -sc option
- Variable renamings and clean ups
- Updated the man page
microchip8
27th February 2008, 10:44
ChangeLog for version 8.2.2
- Added support for calculating the video bitrate when encoding with
the NOSOUND audio option
- Added support for calculating the video bitrate when using the
PCM audio codec
- Converted the code for the bicubic software scaler parameters to
be menu driven
- Added one 'Insane High Quality' preset (ihq) which uses the
Hadamard-based motion estimation algorithm
- Enabled AAC audio support for the Matroska container. Please
upgrade your mkvtoolnix to the latest SVN version!
- Notify the user that the frame rate will change when using the
inverse telecine/telecine filters
- Clean ups in the MP4 muxing code
- Improvements to the batch exporting code
- Updated the man page
Henrikx
27th February 2008, 11:37
:thanks:
redirected automatically :)
microchip8
29th February 2008, 10:47
ChangeLog for version 8.2.3
- Added support for doing 60p -> 30p, 60p -> 24p and 50p -> 25p
FPS conversion. Useful for HD content that runs at 59.94 or 50 fps.
This option is mutually exclusive with interlacing and frame doubling
deinterlacing filters
- Added two Nokia S60 presets (nkvp and nkhqvp). Thanks to Matteo
Croce (mp4tools) for the device info
- Colorized automatic actions/info/menus
- Fixed a small bug in the manual codec configuration where calculating
of the keyint_min value fails
- Updated the man page
microchip8
1st March 2008, 10:41
ChangeLog for version 8.2.4
- Bugfix: forgot to add tinterlace before the detc filter for
60p -> 24p FPS conversion
- Removed the '-p help' option as it is not very useful. --help
displays everything one needs to know
- Added more 60p -> 24p FPS conversion filters and set default
filter to framestep=2,filmdint=fast=0 which gives the best
results
- Disabled colorspace conversion when interlacing, telecining or
when doing FPS conversion as some of the filters (most?) don't
like it. Also disabled colorspace conversion for the Nokia S60
presets
- Made the script to use unique temporary directories to store
the config/parsing files. That way, one can run multiple
instances of h264enc at the same time without interference
- Modified the batch exporting code to work with unique
directories
- Updated the man page
buzzqw
1st March 2008, 10:51
i will greedly study these scripts (just to start making some other guis :p )when i will move to linux!
and i hope to move soon!
thanks froggy1
BHH
microchip8
1st March 2008, 10:56
i will greedly study these scripts (just to start making some other guis :p )when i will move to linux!
and i hope to move soon!
thanks froggy1
BHH
you don't have to completely move to Linux, just dual-boot with Windows or run Linux inside a virtual machine in Windows... but it's true, if you want to get the full potential of Linux, then run it on its own :)
Henrikx
1st March 2008, 13:40
i will greedly study these scripts (just to start making some other guis :p )when i will move to linux!
and i hope to move soon!
Good news!! Very good news.
microchip8
2nd March 2008, 10:48
ChangeLog for version 8.2.5
- Added support for 30p -> 24p FPS conversion
- Added support for the decimate filter when doing 60p -> 24p
FPS conversion
- Small improvements to the crop preview code. Should come after
the user has entered the crop values
- Video file encodings: Use unique default output file based on
process ID
- Fixed a small bug where h264enc assumes that the $HOME/.h264enc
directory already exists but that might not be the case, so it
will fail at making an unique temporary directory. Reported by
Nathaniel Gray
- Added support for setting the quantization parameter for the
spp, uspp and fspp postprocessing filters
microchip8
3rd March 2008, 10:55
ChangeLog for version 8.2.6
- Removed option 2, 3, 4 and 5 of the 60p -> 24p FPS conversion menu
as these filter chains are not very reliable and often fail at doing
the conversion. Also removed support for the decimate filter so now
only framestep and filmdint are supported which give the best results
- Refined the filmdint filter parameters for 60p -> 24p FPS conversion
and set default filter to filmdint=fast=0/io=60:24
- Bugfix: missing ':' in the vbv_bufsize variable of the psphqvp preset.
Reported by Harry Gunnarsson
microchip8
4th March 2008, 11:47
A small release this time. ChangeLog for version 8.2.7
- Added two Flash Player 9 presets (f9 and f9hq)
- Remove config directory on non-zero exit status
- Implemented -sv option which scans an input video file and displays
information about it
- Some small code improvements
- Updated the man page
microchip8
5th March 2008, 14:05
ChangeLog for version 8.2.8
- Merged the -sv option with -scan
- Fixed an issue when scanning video files, especially TS ones, where
printing the video resolution could get misaligned
- Remove pointless removing of temp files. Since h264enc now uses
unique temporary directories to store temp files, there's no
point in removing them anymore as the unique directory will
be removed upon user interrupt or user fault
- Added support for the HE-AAC (aka AAC+) audio codec. This requires
neroAacEnc. When encoding to this codec, the AVI will be first encoded
with PCM audio. Then both the video and audio will be extracted from
the AVI, the audio will be encoded to AAC+ and will be muxed together
with the video to the mp4 and/or mkv container. Multichannel AAC+
audio is not supported yet as neroAacEnc for Linux doesn't seem to
support it at the moment
- Added support for the Vorbis audio codec. This requires oggenc.
Multichannel audio is supported
- Updated the batch code to support AAC+ and Vorbis audio
- Updated the README.h264enc file
- Updated the man page
microchip8
6th March 2008, 14:03
ChangeLog for version 8.2.9
- Video bitrate calculation: fixed the PCM part. It needs different
bitrates for different audio channels. Resampling is not taken into
account at the moment
- Added support for multichannel AAC+. Note that in VBR mode, you
must use a value of 0.37 or lower or else neroAacEnc will error out
with invalid SBR configuration!
- Added support for bitrate based ABR AAC+
- Added support for video bitrate calculation when using ABR AAC+
- Simplified the batch exporting code of the AAC+/Vorbis audio codecs.
This removes code duplication
- Removed the MP4SBR variable in the batch code of the AAC+ audio
codec. The value of this variable is now carried by the
AUDIOFILE variable. Also did a few small simplifications to this part
- Added support for exporting the MP4 muxing commands to the batch file
when using the NOSOUND audio option
- Updated the signal traps
- Replaced an 'if' conditional by a 'case' one in the video bitrate
calculation code
- Random clean ups
microchip8
7th March 2008, 10:52
Think I need a break :) - ChangeLog for version 8.3.0
- Simplifications and clean ups in the audio codecs code
- More simplifications to the video bitrate calculation code
- Fixed identification of AAC+ in the matroska muxing code. Should be
--aac-is-sbr 1:1 and not --aac-is-sbr 1
- Disable accurate rounding of the software scaler on 64-bit systems
since MEncoder has issues with it
- Simplifications to the Matroska batch exporting code. This removes
a lot of code duplication
- Only extract audio and video if we deal with the AAC+ or Vorbis
audio codec
- Simplifications to the Matroska muxing code
- Major simplifications to the MP4 muxing code. A lot of code duplication
is removed
Henrikx
7th March 2008, 13:33
Think I need a break
More than two/three/four/five days?
......don't make me afraid...:)
THX for your work!!
microchip8
7th March 2008, 13:52
More than two/three/four/five days?
......don't make me afraid...:)
THX for your work!!
maybe. I think the script is complete so you'll probably see only small changes over time and less frequent releases
buzzqw
7th March 2008, 14:46
hoe about to "auto" download needed package? (mencoder/mplayer...)
.. something like a "check update" .. both for script and dependencies
BHH
microchip8
7th March 2008, 14:54
hoe about to "auto" download needed package? (mencoder/mplayer...)
.. something like a "check update" .. both for script and dependencies
BHH
the script already checks for these things. It doesn't download and compile them as you'll need root permissions to install everything. h264enc has a -sc option (sanity check) and displays in a menu what is has found/no found on the user's system. It's up to the user to install the needed packages
buzzqw
7th March 2008, 20:10
... i need to pass to linux.. (just waiting q9450 cpu before buing new pc...)
BHH
microchip8
7th March 2008, 20:17
... i need to pass to linux.. (just waiting q9450 cpu before buing new pc...)
BHH
which distro are you going to choose? I'm on openSUSE (very slick and user friendly) but Ubuntu is very popular among ex-Windows fanboys. Its popularity comes mainly from Canonical's excellent marketing
buzzqw
7th March 2008, 20:50
i have actually downloaded
kubuntu, ubuntu 7.10
opensuse 10.3
mandrivia
debian 4.03 (etch ?)
freebsd and beos
... don't know .. i will try for some weeks with varius distro.. (mainly for compatibility and software usage) then decide...
as i already know *buntu (and don't like it).. my first try will be mandrivia, then opensuse
i have big aspectation from opensuse...
BHH
microchip8
7th March 2008, 20:55
excellent, you should definitely try out a few distros and pick the one you like the most. I started out with Mandrake (now Mandriva) back in the days, then switched over to SUSE... been on SUSE for 4 years now :)
Henrikx
7th March 2008, 20:59
@buzzqw
Good luck, and donīt forget
PcLinuxOS
Fedora
microchip8
8th March 2008, 20:07
ChangeLog for version 8.3.1
- Added checking for oggenc and neroAacEnc to the -sc option
- Disabled the scalable sample rate option of the FAAC menu
since it does not work. FAAC doesn't support HE-AAC
- Color optimizations
- Some minor code improvements
- Use named pipes (fifo) to encode to AAC+ or Vorbis audio. This
eliminates the audio dumping step and the required disk space
- Updated the batch code to support named pipes
microchip8
10th March 2008, 17:26
ChangeLog for version 8.3.2
- Pre/Postprocessing video filters are now grouped in one question
- Fixed a small bug. The Nokia S60 presets are not allowed in
fixed-quant mode since they have maximum allowed bitrate
restrictions
- Added autocompletion support. Patch by Nicolas Di Pietro
- Added a skip option to most of the menus
- Added support for AAC+ audio to the f9 and f9hq presets
- Clean ups in the audio codecs code
microchip8
13th March 2008, 10:58
ChangeLog for version 8.3.3
* Minor clean ups and code improvements
* Set default QP parameter to 0 for the spp, fspp and uspp postprocessing filters
* Added support for CBR AAC+ audio
* Made the CBR part of the audio codecs to be menu driven
* Fixed a bug where the FPS conversion menu and the Telecine/IVTC don't show
up due to missing interlaced variable. Bug was introduced during the grouping of
the pre/postprocessing video filters
microchip8
15th March 2008, 20:58
ChangeLog for version 8.3.4
* Removed niceness from the muxing commands
* Clean ups to the batch exporting code
* Added -nocache mplayer option to the AAC+/Vorbis muxing/exporting code
* Disabled muxing to MKV if the user is using the AAC+ or Vorbis audio codec.
The reason for this is that mkvmerge doesn't seem to honor the --default-duration
flag when importing RAW h264 streams and will because of this generate files
with major A/V sync issues. I've already filed a bug report. Until this is resolved
I will not enable MKV muxing when using the AAC+ or Vorbis audio codec!
* Replaced an 'if' conditional with a 'case' one in the AAC+/Vorbis batch exporting code
* Updated the AUTHORS file. Added Harry Gunnarsson as bug reporter/testing
microchip8
18th March 2008, 09:42
Small bugfix release. ChangeLog for version 8.3.4.1
* Bugfix for the PSP presets. Multi-threading was not enabled
microchip8
23rd March 2008, 10:49
ChangeLog for version 8.3.5
* Use -vf rectangle=<crop_values> when previewing the crop values. Will give us a nice outline of the crop values
* Removed accurate rounding of the software scaler since it does not work on a lot of systems
* Updated the VAQ code to support the final version of the variance adaptive quantization patch -> replaced aq_sensitivity with aq_mode
* Updated the preset.cfg file to support the new VAQ
* Changed sample rate of the f9 and f9hq presets from 48000 Hz to 22050 Hz
* Be silent when doing FPS conversion
microchip8
27th March 2008, 19:35
ChangeLog for version 8.3.6
* Use awk to get the current device when exporting DVD chapters information
* When encoding specific chapters, append the chapters info at the end of the output file
* Changed the nkvp and nkhqvp presets to nks60vp and nks60hqvp
* Removed support for manual video codec configuration. This reduces the code and
makes it less bloated. If a user wants to configure something manually, he can write his
own custom preset and load it in h264enc
* Removed support for MP3 high- and lowpass frequency settings. I'm sure many
people don't use these options and accept the defaults
* The threads option is now hard coded into the mencoder_opts() function
* Removed keyint and keyint_min from the HW compatible presets. Use the default
detected values for those
* Updated the preset.cfg file
* Updated the README.h264enc file. Added links for neroAacEnc and Vorbis
* Removed SD/HD Extended presets. They are useless
* Updated the man page
microchip8
8th April 2008, 11:50
ChangeLog for version 8.3.7
* Integrated the exit command into the rmconf() function
* Added aq_metric for those who want to test the VAQ2 patch
* Updated the preset.cfg file. Added aq_metric
* Small clean ups
microchip8
9th April 2008, 12:24
ChangeLog for version 8.3.8
* Updated the cropping code to support the latest SVN version of MEncoder
* Replace underscores from DVD title names with spaces
microchip8
15th April 2008, 02:22
ChangeLog for version 8.3.9
* Fixed the cropping code. NTSC content was problematic
* Added support for NTSC Double @ 60 fps
blaz
20th April 2008, 18:45
Just noticed that 5.1 AC3 audio gets reduced to just stereo aac in PS3 presets.
Ouch.
Can copy over the 5.1 -> 5.1 settings from the output of another preset, but am just not sure why you would want to do this as practically every PS3 is hitched up to some home theatre system.
microchip8
20th April 2008, 18:49
Just noticed that 5.1 AC3 audio gets reduced to just stereo aac in PS3 presets.
Ouch.
Can copy over the 5.1 -> 5.1 settings from the output of another preset, but am just not sure why you would want to do this as practically every PS3 is hitched up to some home theatre system.
I'm not sure if the PS3 supports AAC 5.1 and I don't have one here to test with, that's why I went for Stereo AAC audio. If you have one, then you can test and report if the PS3 plays MP4s with 5.1 AAC audio
blaz
20th April 2008, 19:00
OK, I'll see what I can do.
Sony *claims* that it supports AAC LC in mp4 and mpeg-2 PS video files, but I can't find anything specific about the # of channels.
microchip8
20th April 2008, 19:05
OK, I'll see what I can do.
Sony *claims* that it supports AAC LC in mp4 and mpeg-2 PS video files, but I can't find anything specific about the # of channels.
Sony claims a lot of things :) The PS3 presets in h264enc are directly taken from RipBot264 for Windows, I only modified a few things in them to get a bit higher quality
blaz
21st April 2008, 02:04
We can forget this as I can't test whether the PS3 decodes 5.1 aac anyway. And I can't play it even if it does.
My amp is not hdmi, so I use optical audio from the PS3. And under optical the PS3 can just send 2 channel pcm, or bitstream the Dolby Digital, DTS or aac (!) to the amp. But my amp cannot decode aac, just DD or DTS.
If I lie to the ps3 and tell it that the amp can decode aac, I get no sound from an mp4 that is supposed to have 5.1 aac audio, so the PS3 *may* be sending un-decoded 5.1 aac to the amp.
If I don't lie, the PS3 sends stereo which it must have decoded from the 5.1 aac, no? Theoretically, if I had an hdmi connection, the ps3 can send out up to 7.1 channels pcm, maybe including 5.1 channels of decoded aac!
But all that won't do me any good until I get a new amp, which isn't going to happen for a long time. So I'm back to converting my dvd's with subtitles to avi+divx+ac3, somehow.
Whew, what a journey.:rolleyes:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.