Log in

View Full Version : h264enc for Linux


Pages : 1 2 3 4 5 6 7 8 9 [10] 11 12 13 14 15

WalterK
1st February 2010, 00:33
yes make sure your version of libx264 and mplayer/mencoder are uptodate

microchip8
18th February 2010, 17:30
ChangeLog for version 9.1.6


* Added new veriable 'DEFOUTPUT' to the config file which can be used to set a default
output directory. This updates the config to version 15
* Modified the set_output_filename_func() function to support the above variable.
- If the DEFOUTPUT variable is empty, user can either provide just the output
name for the encode (in this case the script assumes $HOME as output dir), or
the full path and output name, which in this case the script will create the
output dir if it's not present or will do a write test when the dir is present
to see if it's writable by the user. If creation of output dir or the write test
fails, the script exits with a notice.
- If the DEFOUTPUT variable contains a custom output dir, the script will test for
it and create it if it's not present. If creation fails, the script exits with a
notice. If the dir is present, the script will do a write test to see if the
custom dir is writable. If not, the script exits with a notice.
- The DEFOUTPUT variable can be overwritten on the command line. This means that if
user has set a custom output dir in the DEFOUTPUT variable but provides a path when
asked on the command line, that path will be used instead of the one in the DEFOUTPUT
variable. The script then will either check and create the provided output dir on
the command line (if that dir is not present) or will do a write test if the dir
is present. Upon failure of creation or write test, the script exits with a notice.
If no path is provided on the command line but only the output name for the encode,
the script will use the one set in the DEFOUTPUT variable.

dbg0
10th March 2010, 23:29
@froggy1,

h264enc is a nice script, thank you. I agree that GUI is almost useless. However, I am just a beginner user of h264, and it frustrates me a bit. Let us consider an example:

$ h264enc -3p ehq
...
Select the Input type [file/dir/dvd/vcd]: filr # It is just a typo, I wanted to enter "file".
-> You have to specify the input type (file/dir/dvd/vcd)

That's all, program finished, so I have to restart it and be more careful. It this particular case my mistake is not a big problem, because h264enc terminates at the first question. But in reality I made a few mistakes no so close to the beginning, so I had to restart h264enc again and again.

Once I entered a relative path to file (I believe it is rather natural for a person working with command line), but h264enc said I should enter an absolute one and terminated again.

I did not like it. I believe (1) some more amount of interactivity would not hurt, it would be better if h264enc would check user input, and if it is wrong, let user a chance to fix it and continue, (2) h264enc should not stop if an absolute path is required -- h264enc should convert relative path to absolute and continue.

I wrote few functions for getting user input. They allows user correct a mistake and continue. For example:

$ h264enc -3p -p ehq
...
Available input types
~~~~~~~~~~~~~~~~~~~~~
1 --> File
2 --> Directory
3 --> DVD
4 --> VCD

Select the input type [1, 2, 3, 4]: 6
Invalid choice, try again.
Select the input type [1, 2, 3, 4]:

Here is the code of functions:


bold() { echo -e "\e[1m$1\e[0m"; }

function ask_choice() {
local _ac_prompt=$1 # Prompt string.
local _ac_choices=$2 # Choices string.
local _ac_var=$3 # Name of variable to save answer to.
local _ac_default=$4 # Default answer.
local _ac_n=0 # Index variable.
local _ac_choice # Array of choices.
local _ac_answer # User's answer.
# Parse $2, fill in array of valid choices.
while [[ $_ac_choices == *\,* ]]; do
_ac_n=$(( _ac_n + 1 ))
_ac_choice[ $_ac_n ]=${_ac_choices%%,*}
_ac_choices=${_ac_choices#*,}
done
_ac_n=$(( _ac_n + 1 ))
_ac_choice[ $_ac_n ]=$_ac_choices
# Reconstruct _ac_choices (it was destroyed during parsing).
_ac_choices=
for (( _ac_n = 1; _ac_n <= ${#_ac_choice[@]}; _ac_n = _ac_n + 1 )); do
if [[ $_ac_n -gt 1 ]]; then
_ac_choices="$_ac_choices, "
fi
if [[ ${_ac_choice[ $_ac_n ]} == "$_ac_default" ]]; then
# Highligh default choice.
_ac_choices="$_ac_choices$(bold "${_ac_choice[ $_ac_n ]}")"
else
_ac_choices="$_ac_choices${_ac_choice[ $_ac_n ]}"
fi
done
# Now ask user.
while true; do
read -e -p "$_ac_prompt [$_ac_choices]: " _ac_answer
if [[ $_ac_answer == "" ]]; then
_ac_answer=$_ac_default
fi
for (( _ac_n = 1; _ac_n <= ${#_ac_choice[@]}; _ac_n = _ac_n + 1 )); do
if [[ $_ac_answer == "${_ac_choice[ $_ac_n ]}" ]]; then
eval $_ac_var=\$_ac_answer
return $_ac_n
fi
done
printf "Invalid choice, try again.\n"
done
} # function ask

function ask_yn() {
local _ay_prompt=$1 # Prompt string.
local _ay_var=$2 # Name of variable to save answer to.
local _ay_default=$3 # Default answer.
if [[ -z $_ay_default ]]; then
_ay_default="n"
fi
# Ask user.
ask_choice "$_ay_prompt" "y,n" "$_ay_var" "$_ay_default"
} # function ask_yn

function ask_file() {
local _af_prompt=$1 # Prompt string.
local _af_tests=$2 # File tests.
local _af_var=$3 # Name of variable to save answer to.
local _af_default=$4 # Default answer.
local _af_n=0 # Index variable.
local _af_test
local _af_answer=
# Parse $2, fill in array of tests.
while [[ $_af_tests == *,* ]]; do
_af_n=$(( _af_n + 1 ))
_af_test[ $_af_n ]=${_af_tests%%,*}
_af_tests=${_af_tests#*,}
done
_af_n=$(( _af_n + 1 ))
_af_test[ $_af_n ]=$_af_tests
# Prepare prompt.
if [[ -n $_af_default ]]; then
_af_prompt="$_af_prompt [default is $(bold "$_af_default")]"
fi
# Ask user.
while true; do
read -e -p "$_af_prompt: " -i "$_af_answer" _af_answer
if [[ $_af_answer == "" ]]; then
_af_answer=$_af_default
fi
for (( _af_n = 1; _af_n <= ${#_af_test[@]}; _af_n = _af_n + 1 )); do
if [[ ${_af_test[ $_af_n ]} == "-e" && ! -e $_af_answer ]]; then
echo "\`$_af_answer' does not exist."
continue 2
fi
if [[ ${_af_test[ $_af_n ]} == "-d" && ! -d $_af_answer ]]; then
echo "\`$_af_answer' not a directory."
continue 2
fi
if [[ ${_af_test[ $_af_n ]} == "-f" && ! -f $_af_answer ]]; then
echo "\`$_af_answer' not a file."
continue 2
fi
if [[ ${_af_test[ $_af_n ]} == "-b" && ! -b $_af_answer ]]; then
echo "\`$_af_answer' not a block device."
continue 2
fi
if [[ ${_af_test[ $_af_n ]} == "-A" ]]; then
rel2abs "$_af_answer" _af_answer
fi
done
eval $_af_var=\$_af_answer
return 0
done
} # function ask_file

function rel2abs() {
local _rel2abs_path=$1
local _rel2abs_var=$2
local _rel2abs_dir
local _rel2abs_file
if [[ ! $_rel2abs_path == "/" ]]; then
_rel2abs_dir=$(dirname "$_rel2abs_path")
_rel2abs_file=$(basename "$_rel2abs_path")
_rel2abs_dir=$(cd "$_rel2abs_dir" && pwd -P)
if [[ $_rel2abs_dir == "" ]]; then
echo "??????????"
fi
if [[ $_rel2abs_dir == */ ]]; then
_rel2abs_path=$_rel2abs_dir$_rel2abs_file
else
_rel2abs_path=$_rel2abs_dir/$_rel2abs_file
fi
fi
eval $_rel2abs_var=\"\$_rel2abs_path\"
} # function rel2abs

Function ask_choice asks user for a choice one of allowed options, e. g.:

ask_choice "In which format to export" "text,perl,python,ruby,xml" format

or

echo ""
brown "Deinterlace Methods"
brown "~~~~~~~~~~~~~~~~~~~"
echo "0 -> Deinterlace at half frame rate"
echo "1 -> Deinterlace at original frame rate"
echo "2 -> Deinterlace at double frame rate (bobbing)"
echo "3 -> Skip deinterlacing"
echo ""
ask_choice "Select the deinterlacing method" "0,1,2,3" deintmethod "1"

ask_yn is an adaptation of ask_choice to yes/no questions.

ask_file asks for a file or directory name, e. g.:

ask_file "Provide the input video file: " "-e,-f,-A" infile

"-e,-f,-A" means that file should exist, be a plain file, and function will convert relative path to absolute one.

Another example, asking for a DVD device:

ask_file "Specify the DVD device" "-e,-b,-A" dvd_dev "/dev/dvd"

Here is an example of work:

Specify the DVD device [default is /dev/dvd]: /home/
`/home/' not a block device.
Specify the DVD device [default is /dev/dvd]:

Do you think you could incorporate these functions into h264enc?

Thanks.

microchip8
11th March 2010, 00:07
if you provide a decent real unified patch against the latest version, then I just might. Otherwise, no.

microchip8
16th March 2010, 22:10
ChangeLog for version 9.1.7
* Space escaped some previously missed variables
* Use one variable in the presets (x264params) for all MEncoder x264 encoding options. Reduces some code and simplifies things a bit
* Updated the preset.cfg file to support the "one variable for all x264 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 h264enc!

microchip8
18th March 2010, 16:51
ChangeLog for version 9.1.8
* Small bugfix: keyint and keyint_min weren't passed on to MEncoder when using some presets

ennob
22nd March 2010, 17:02
Hi froggy1

Nice tool. I especially like the presets, it can be a pain to figure out what all the different platforms support.

I attached a patch to replace some sed(1) commands with awk(1) commands since the '-r' switch for sed(1) is not university supported. E.g., my FreeBSD box didn't like them.

Hope you can use it and thanks for a great tool.

/ennob

ennob
22nd March 2010, 21:49
Btw froggy1, any plans of putting this under version control, say Git?

It would make it a bit easier to update and you might get more community support/development.

/ennob

microchip8
22nd March 2010, 22:26
@ennob

No plan for version control. Project's too small and it's already easy

Also, upload the patch somewhere else as on here it can take some time before a mod approves the attachment

ennob
23rd March 2010, 11:55
here is the diff:


--- h264enc.orig 2010-03-17 15:30:11.000000000 +0100
+++ h264enc 2010-03-17 15:38:49.000000000 +0100
@@ -1099,7 +1099,7 @@
}
trap 'interrupt_iso_func' SIGHUP SIGTSTP SIGINT SIGQUIT SIGKILL SIGABRT SIGFPE SIGSEGV SIGTERM SIGPIPE SIGIO
check_space_func() {
- HDSPACE="$(df -m "$(dirname "$OUTPUT")" | tail -n 1 | sed -r 's/^.*\s+[0-9]+\s+[0-9]+\s+([0-9]+)\s+[0-9]+%.*/\1/')"
+ HDSPACE="$(df -m "$(dirname "$OUTPUT")" | tail -n 1 | awk '{print $4}')"
if [ $HDSPACE -le 9216 ]; then
echo ""
error "-> You are running out of disk space in '$(dirname "$OUTPUT")'"
@@ -2961,8 +2961,8 @@
}

check_diskspace_func() {
- HDOUT="$(df -m "$(dirname "$OUTPUT")" | tail -n 1 | sed -r 's/^.*\s+[0-9]+\s+[0-9]+\s+([0-9]+)\s+[0-9]+%.*/\1/')"
- HDCONF="$(df -m "$TEMPDIR" | tail -n 1 | sed -r 's/^.*\s+[0-9]+\s+[0-9]+\s+([0-9]+)\s+[0-9]+%.*/\1/')"
+ HDOUT="$(df -m "$(dirname "$OUTPUT")" | tail -n 1 | awk '{print $4}')"
+ HDCONF="$(df -m "$TEMPDIR" | tail -n 1 | awk '{print $4}')"
if [ $HDOUT -le 4096 -o $HDCONF -le 4096 ]; then
echo ""
echo "Note that you are running out of disk space in"

microchip8
23rd March 2010, 12:05
Yeah, it's already applied. I downloaded it earlier. Thanks anyways

microchip8
28th March 2010, 13:21
ChangeLog for version 9.1.9
* Replaced sed with awk for checking available disk space. Should work better on FreeBSD systems.
Patch by ennob from doom9
* Updated interlace options and presets to support the latest x264 from git. Note that due to these changes,
h264enc's presets are incompatible with older x264 versions so please upgrade to latest x264 from git!
* Small update to the preset.cfg file

microchip8
24th April 2010, 03:05
ChangeLog for version 9.2.0
* Switch to using external FAAC encoder to work around an issue in mkvmerge where it flags AAC
audio taken from an AVI as being Main profile regardless if LC profile is used for encoding or not. Problem
noticed & reported by benpro. This updates the config file to version 16 and requires FAAC to be installed.
* Same small cleanups
* Updated the man page

microchip8
29th April 2010, 15:54
ChangeLog for version 9.2.1
* 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 17 and adds variable ALLOW_AUD_CHANNELS
* Bugfix: audio filters were not inserted when doing 1-pass encodes

microchip8
15th May 2010, 17:34
ChangeLog for version 9.2.2

* Small bugfix in the get_devices_func() function; script exits when user hits enter to accept default device
* Remove AVI menu entry as supported container when using FAAC for audio encoding

microchip8
25th June 2010, 17:39
ChangeLog for version 9.2.3
* Added support for x264's preset, tune and profile options. This adds two additional optional args
[-t (for tune) and -pf (for profile)] which can only be used with an x264 preset, not with the built-in script
presets. If used with those, these args will be ignored.
Examples on how to use x264 presets (which is also explained in the -help option)
h264enc -crf -p slow
h264enc -crf -p slow -t film
h264enc -crf -p slow -pf main
h264enc -crf -p slow -t film -pf high
One can also switch the -t and -pf options, eg: h264enc -crf -p slow -pf high -t film
* Updated the man page

swk
18th July 2010, 02:23
While looking for x264 cli tutorials (and not finding much) I came across h264enc today. I was hopeful but it doesn't work for me. I did a simple test (choosing all defaults). I started with:
h264enc -1p -p fast


and got the following command:

nice -n 10 /usr/bin/mencoder "dvd://2" -o "/p3/mebo - chapter 1-2.avi" -vc mpeg12 -dvd-device mebo.iso -chapter 1-2 -vf \
softskip,harddup -aid 128 -oac pcm -ovc x264 -x264encopts bitrate=1000:nointerlaced:preset=fast:keyint=300:keyint_min=30:force_cfr


with resulting:
MPlayer SVN-r31309 (C) 2000-2010 MPlayer Team
Option x264encopts: Unknown suboption preset
libdvdread: Encrypted DVD support unavailable.
There are 5 titles on this DVD.
There are 1 angles in this DVD title.
audio stream: 0 format: ac3 (stereo) language: ja aid: 128.
number of audio channels on disk: 1.
number of subtitles on disk: 0
success: format: 2 data: 0x5EDF000 - 0x5ede800
MPEG-PS file format detected.
VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 9800.0 kbps (1225.0 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:720x480 fps:29.970 ftime:=0.0334
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [harddup]
Opening video filter: [softskip]
==========================================================================
Forced video codec: mpeg12
Opening video decoder: [libmpeg2] libmpeg2 MPEG 1/2 Video decoder
Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
==========================================================================
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[swscaler @ 0x328be40]using unscaled yuv420p -> yuv420p special converter
FATAL: Cannot initialize video driver.

Exiting...


Looking around, it seems mencoder passed x264 options to libx264 but libx264 doesn't recognize the preset option. Removing the preset=fast option from the menconder command does work. Since h264enc requires a preset, I'm confused as to how anyone gets it to work.

I'm using (all from Debian repos):
Package: libx264-98
Version: 1:0.svn20100620-0.1

Package: mencoder
Version: 2:1.0~rc3+svn20100603-0.0

Package: h264enc
Version: 9.2.3-0.0

Redsandro
18th July 2010, 02:29
I use h264enc for encoding series for my nokia phone using h264enc -1p -p nks60 and there's no problem.

Could it be that h264enc doesn't handle non-specific profiles well (anymore)?

microchip8
18th July 2010, 07:49
@swk

you're trying to use the native x264 presets but your x264 or mencoder version is too old and doesn't support them. Either upgrade these programs or use the script presets instead (eg, the hq, vhq, ehq, etc presets, not the x264 ones as shown in -help). The x264 presets work here in mencoder (and in h264enc) without a problem so it must be something on your side

I recommend using mplayer from svn and x264 from git, compiled yourself

swk
18th July 2010, 16:52
I use a svn checkout from June 3, 2010. That can't be that old can it?

Anyway, I did use the script presets and it did work. I'll contact the Debian package maintainer to find out what is going on. I used to compile svn mplayer all the time but this is a new comp and I haven't had time to hunt down all needed libs. Looks like I may have to though.

Thanks to both of you for helping.

microchip8
18th July 2010, 17:22
I'm not exactly sure when they pushed the patch to mencoder to support x264 presets, so I can't tell you if yours supports it or not. But mine does here. If mencoder didn't support these x264 presets, I wouldn't add them to the script ;)

nm
21st July 2010, 08:19
I use a svn checkout from June 3, 2010. That can't be that old can it?
It's a new feature:
r31363 | tack | 2010-06-11 00:45:20 +0300 (pe, 11 kesä** 2010) | 11 lines

ve_x264: rewrite option parsing and add support for x264's presets,
profiles, and tuning system.

No longer explicitly disable 'psnr' and 'ssim' options (they are off by
default); deprecate the 'turbo' option, enable fast first pass by
default, and introduce slow_firstpass option to disable it (provides
parity with x264).

Some ideas taken from patch submitted by Micha (mk spline de).

microchip8
21st July 2010, 09:39
ChangeLog for version 9.2.4
* Typo fix in the display_quality_preset_func(); verslow -> veryslow. As this is an informative function,
it does not affect the encoding configuration
* Force -nosub option in case subtitles are skipped. This is to prevent auto-loading of subs

Goga777
10th August 2010, 20:00
thanks for you great job
does it possible to implement the possibility to power off computer after finishing of encoding ?

microchip8
10th August 2010, 20:07
thanks for you great job
does it possible to implement the possibility to power off computer after finishing of encoding ?

halting requires root privileges so if you run the script as normal user (which you should), it can't be done afaik

Goga777
11th August 2010, 20:10
with sudo it's possible to find solution

microchip8
11th August 2010, 20:16
with sudo it's possible to find solution

I don't like sudo and I don't use it. Not to mention many distros are not as fanatic sudo pushers as Ubuntu/Debian

what you can do is just see how much time is remaining for the encode to finish, add 10-15 minutes on top and in another console as root do;

sleep <remaining-time-in-min-or-hrs> && halt -p

example, if mencoder says your encoding will finish in 100 minutes, add to those 5 or 10 on top just to be sure and then

sleep 110m && halt -p

Goga777
11th August 2010, 20:22
yes, I have already used such solution :)


shutdown -P -h -time 04:00

microchip8
11th August 2010, 20:32
well, there you go :)

and make sure to account for audio encoding (if you use an external encoder like Nero) and for muxing, hence why I said to add 5-10 minutes (or a bit more) on top of the estimated encoding time by mencoder :)

Goga777
11th August 2010, 20:51
in which cases do you recommend to use deringing/deblocking filters ?

microchip8
11th August 2010, 20:52
in which cases do you recommend to use deringing/deblocking filters ?

in case the input has clearly visible ringing and/or blocking effects :)

Goga777
15th August 2010, 17:42
after encoding with h264enc I tried to open output mkv file with avidemux and received a lot of warnings like

[MKV] Tracks analyzed
[MKV] Indexing clusters
[MKV] Found 1367 clusters
[MKV]Found 1367 clusters
[MKV] Indexing video
??0x7
Warning , incomplete nal (196709/101010),(30065/18a92)
Warning , incomplete nal (5/63499),(5/f80b)
Warning , incomplete nal (5/14872),(5/3a18)
Warning , incomplete nal (5/56106),(5/db2a)
Warning , incomplete nal (5/28184),(5/6e18)
Warning , incomplete nal (5/13975),(5/3697)
Warning , incomplete nal (5/13185),(5/3381)
Warning , incomplete nal (5/12916),(5/3274)
Warning , incomplete nal (5/13771),(5/35cb)

is it normal to have such warnings ? how can I test my file ?



with ffmpeg -i Турция\ 2010.06.mkv
FFmpeg version SVN-r24334, Copyright (c) 2000-2010 the FFmpeg developers
built on Jul 19 2010 23:07:34 with gcc 4.3.3
configuration: --enable-shared --enable-libx264 --enable-libfaac --enable-gpl --enable-nonfree
libavutil 50.22. 0 / 50.22. 0
libavcodec 52.84. 0 / 52.84. 0
libavformat 52.75. 0 / 52.75. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.25. 1 / 1.25. 1
libswscale 0.11. 0 / 0.11. 0
[matroska @ 0x9e29470] Estimating duration from bitrate, this may be inaccurate
Input #0, matroska, from 'Турция 2010.06.mkv':
Metadata:
title : Турция 2010.06
Source : Video file
Title : Турция 2010.06
Release Date : 2010
Genre : home video
Video Filters : softskip,ilpack=1,scale=::1,harddup
Audio Filters (Track 1): lavcresample=48000:16:1
Audio Codec (Track 1): LC-AAC Stereo
Encoder : MEncoder SVN-r31567-4.4.4 (C) 2000-2010 MPlayer Team
x264 parameters : crf=19:bff:pic_struct:force_cfr:frameref=5:mixed_refs:bframes=6:b_adapt=2:b_pyramid=normal:weight_b:weightp=2:direct_pred=auto:aq_mode=1:me=umh:me_range=32:subq=8:mbtree:rc_lookahead=50:psy_rd=0.8,0.2:chroma_me:trellis=1:cabac:deblock:8x8dct:partitions=p8x8,b8x8,i8x8,i4x4:nofast_pskip:nodct_decimate:threads=auto:ssim:psnr:keyint=250:keyint_min=25
x264 version : 0.104.1677
mkvmerge version: 2.7.0
h264enc parameters: h264enc -crf -p ehq
Comment : Tagged by h264enc 9.2.4 on 2010/08/13
Duration: 00:37:52.61, start: 0.000000, bitrate: N/A
Stream #0.0: Video: h264, yuv420p, 720x576 [PAR 131:90 DAR 131:72], 25 fps, 25 tbr, 1k tbn, 50 tbc
Metadata:
title : Турция 2010.06
Stream #0.1: Audio: aac, 48000 Hz, stereo, s16
Metadata:
title : LC-AAC Stereo
At least one output file must be specified

microchip8
16th August 2010, 12:11
that's probably avidemux screwing up. No idea really

microchip8
21st August 2010, 11:26
ChangeLog for version 9.2.5
* Update QuickTime & iPhone presets. Patch by gongloo

microchip8
23rd August 2010, 12:20
ChangeLog for version 9.2.6
* Fixed a syntax error in the iphq preset

contador
12th September 2010, 15:51
Hi froggy1,

I have started to use your xvidenc script and its perfect for my needs, thankyou.


I was hoping I could get your opnion on something (Im a total noob), I have a dvd of an old black and white comedy which I think is interlaced because when I encode without that option I get lines when there is fast movement on the screen.

I have tried using interlacing with option 39, its very slow, but it works to stop the lines, but I was wondering about your prefered interlacing options?

microchip8
12th September 2010, 16:58
@contador

it's very slow because it uses the slowest mode in mcdeint. You better stick to the yadif deinterlacer or if you really need motion compensated deinterlacing, yadif with a faster mode of mcdeint.

contador
12th September 2010, 17:44
Thanks froggy1 :)

esthon
12th September 2010, 19:24
Hi,

this is a very good tool, thank you for the great work.

I am using it to encoding videos that will be streamed by a mediatomb mediacenter running in a Linux to a PS3 that is (HDMI) connected to a HD TV. My question is: should I use the PS3 preset or this doesn't matter as I am streaming it by network?

microchip8
14th September 2010, 18:28
@esthon,

doesn't matter. If it works currently, stick to it :)

microchip8
15th September 2010, 09:51
ChangeLog for version 9.2.7
* Small update to the -scan option. Just check if input file is there, regardless if user provides the full path or not
* Enable trellis in some presets that use CAVLC

crazee_canuck
15th September 2010, 19:20
Using 9.2.7 with "h264enc -2p -p fast" I end up with hardcoded subtitles in the final file.

If I select to have the subtitles imported into the matroska container, and then select subtitle #2, subtitle #0 is hardcoded into the file and #2 is imported into the MKV file.

One pass encoding works as one would expect (the quality looks very good, so 1-pass looks like it'll be sufficient for my needs).

Unfortunately I do not know when this behaviour changed.

I'm using Debian sid, x64, with the following packages:
ii ffmpeg 5:0.6~svn20100726-0.0 audio/video encoder, streaming server & audio/video file converter
ii libavcodec52 5:0.6~svn20100726-0.0 library to encode decode multimedia streams - runtime files
ii libx264-104 1:0.svn20100902-0.0 x264 video coding library
ii mencoder 2:1.0~rc3++svn20100804-0.0 MPlayer's Movie Encoder
ii mplayer-nogui 2:1.0~rc3++svn20100804-0.0 The Ultimate Movie Player For Linux
ii x264 1:0.svn20100902-0.0 video encoder for the H.264/MPEG-4 AVC standard

microchip8
15th September 2010, 20:30
Will look into it... it's because the wonderful idiots over at mplayer decided sometime ago to enable subtitles by default so I have to work around their BS constantly

microchip8
15th September 2010, 21:02
hmmm, I cannot reproduce that here. I just encoded one chapter from a DVD, selected to dump & import the 7th sub on it (which was in dutch language) into MKV. Playing the file shows by default the subtitle in the MKV. Adding -nosub to mplayer's params, makes it go away and no other subtitle is shown during speech so nothing can be hardcoded or else it'll show up regardless if one uses -nosub or not

Did you save the options to the batchfile? if so, can you pastebin them?

My mencoder rev is: MEncoder SVN-r32153-4.5, which is newer than yours. Maybe it's a problem with your mencoder?

microchip8
15th September 2010, 21:12
wait, i think I made a mistake. I ran a 1 pass encode, you did a 2 pass one. The subs code for 2 pass is slightly different. Will test now, will report soon..

microchip8
15th September 2010, 21:17
Yup, looks you're right. Will fix :)

Thanks for reporting!

microchip8
16th September 2010, 10:16
ChangeLog for version 9.2.8
* 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 and 3rd pass code. This is only valid for multipass encodes so people using one pass
modes (-1p, -qp or -crf) are safe.

contador
24th September 2010, 16:23
Froggy,

Would it be possible to have Xvidenc encode to/from a ram disk?

I have asked a question regarding speeding up dvd encodes, on a different forum, and some suggest that If I can do all the encoding via a ram disk then that might avoid bottlenecks on the system. Is that possible with the Xvidenc script?

microchip8
24th September 2010, 16:40
Froggy,

Would it be possible to have Xvidenc encode to/from a ram disk?

I have asked a question regarding speeding up dvd encodes, on a different forum, and some suggest that If I can do all the encoding via a ram disk then that might avoid bottlenecks on the system. Is that possible with the Xvidenc script?

I don't see why it wouldn't be possible, but you do realize a ramdisk is a temporary thing? So why would you encode content you want to keep to a ramdisk? When you're finished, you'd have to put it on a real disk anyways if you want to keep it and this will involve moving the data so what's the point?

And what bottlenecks are you having? Even with ridiculously big resolutions, a modern HDD shouldn't have any problems feeding the encoder with data. I don't really see the point in using a ramdisk for that

contador
24th September 2010, 17:44
Froggy,

Im not facing any bottlenecks yet, Im still deciding on the hardware, and Im just trying to find out the fastest way of encoding because I've got 500+ 30 minute comedy episodes that need to be encoded with interlaced slowest mcdient.