AcidRip Fails to properly work with x264 (includes patch).

Bug #182999 reported by Brian Neltner
16
Affects Status Importance Assigned to Milestone
acidrip (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

Binary package hint: acidrip

I submitted this patch over a year ago to AcidRip directly, but I believe there is no longer an actual developer on the project. I made some modifications to allow me to use the x264 codec.

I have attached the new acidrip.pm and signals.pm files which work properly for x264 video.

Revision history for this message
Brian Neltner (neltnerb) wrote :

I think I made more modifications than I report in acidrip.pm (I made it record to a temporary file, improved support for xvid, and made other changes which I've honestly forgotten the reason for, but it all works fine on my computer.)

Here are the patches.

Revision history for this message
Brian Neltner (neltnerb) wrote :
Revision history for this message
John Dong (jdong) wrote :

Hi,

Can you please explain the changes made to xvid encode settings?

Changed in acidrip:
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
Brian Neltner (neltnerb) wrote : Re: [Bug 182999] Re: AcidRip Fails to properly work with x264 (includes patch).

Not anymore, it's been years since I used xvid. I'd suggest removing any
changes to the xvid code. I highly recommend that everyone switch to
x264 at this stage.

Additionally, the default setting for the x264 code should be changed as
the mencoder interface has changed. The recommended setting now is:

subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b:threads=auto

Personally, I recommend doing only 1-pass encoding with no included
bitrate, and using the crf switch to control quality. I've found it to
be much faster, and nearly equal in quality to two-pass encoding.
However, my perl-fu is too weak to add additional interface options to
the encode box. I think the ideal setup would be to allow the user to
select either encode with bitrate or encode with quality, and then have
a numerical entry box for bitrate, or crf value. I've found that at
crf=18, the quality is indistinguishable from the actual data from my
video camera.

However, if it is desired to do two-pass encoding, the option turbo=1
should probably also be included in the default options list.

Sorry I can't be of more help, I'm very busy right now and don't have
time to do much clean up work. In a few weeks I might be able to look
into taking the current acidrip source files and re-modifying them to
effect up-to-date changes.

There's also a bug in the scaling code that I've yet to track down. At
this point I'm doing manual modification of the output scripts to fix
it. The issue is that when you encode from a DVD with cropping, it ends
up encoding at a funny resolution (probably because the DVD has
rectangular boxes). You'll notice when you play a DVD that mplayer shows
something like 720x386 -> 720x480 or whatever (I made up numbers). After
cropping, you should play the movie again and see what the output size
is. That's the actual aspect ratio that should be scaled in accordance
with. For some reason, acidrip defaults to scaling in accordance with
the original rectangular pixels instead of the actual screen appearance,
which uses a lot more data for effectively no gain.

-Brian

On Thu, 2008-01-24 at 19:58 +0000, John Dong wrote:
> Hi,
>
> Can you please explain the changes made to xvid encode settings?
>
> ** Changed in: acidrip (Ubuntu)
> Importance: Undecided => Wishlist
> Status: New => Incomplete
>

Brandon Kruger (bmk789)
Changed in acidrip:
assignee: nobody → bmk789
status: Incomplete → In Progress
Revision history for this message
apmetcalfe (apmetcalfe) wrote :

Hi there. Excuse my noobiness, but how do you actually install these patches?

Revision history for this message
xtknight (xt-knight) wrote :

Here is a debdiff that should fix the problem.

apmetcalfe: you can try my patch by going to this URL, and downloading the ~ppa1 deb.

Then install it with $ sudo dpkg -i acidrip_0.14-0.2ubuntu5~ppa1_all.deb

https://launchpad.net/~xt-knight/+archive

Revision history for this message
xtknight (xt-knight) wrote :

Note my debdiff simply encapsulates Brian Neltner's patch in Debian form. Thanks for the original patch Brian.

Revision history for this message
xtknight (xt-knight) wrote :

subscribed to motu

Changed in acidrip:
assignee: bmk789 → nobody
status: In Progress → Confirmed
Revision history for this message
jacrider (andrew-thecallums) wrote :

xtknight: Tried the .deb file linked above. Installed no problem, but still getting the same error. Any suggestions?

Thanks for you help on this.

Revision history for this message
xtknight (xt-knight) wrote :

jacrider: what error are you talking about?

The deb package's AcidRip should have x264 support listed under the video codec tab. I have no means of testing if it works, however.

Revision history for this message
Kevin Oberle (kevin.oberle) wrote :
Download full text (3.5 KiB)

This patch doesn't work for me.

I get the same symptoms before and after installing the patch. Upon starting the encode acidrip says it was interrupted by the user. Here is the debug output:

AcidRip message - Running mencoder dvd://1 -dvd-device /dev/dvd -alang English -info srcform="DVD ripped by acidrip.sf.net" -oac mp3lame -lameopts abr:br=128 -ovc x264 -x264encopts subq=6:me=3:frameref=5:bframes=3:weight_b:turbo=2:psnr:keyint=125:bitrate=869 -vf pp=de -of mpeg -o "/home/kevin/juno.mpg"
AcidRip message - Encoding film
MEncoder 2:1.0~rc2-0ubuntu13 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Celeron(R) M processor 1.50GHz (Family: 6, Model: 13, Stepping: 8)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Option x264encopts: Bad argument me=3
There are 32 titles on this DVD.
There are 29 chapters in this DVD title.
There are 1 angles in this DVD title.
audio stream: 0 format: ac3 (5.1) language: en aid: 128.
audio stream: 1 format: ac3 (stereo) language: es aid: 129.
audio stream: 2 format: ac3 (stereo) language: fr aid: 130.
audio stream: 3 format: ac3 (stereo) language: en aid: 131.
number of audio channels on disk: 4.
subtitle ( sid ): 4 language: en
subtitle ( sid ): 5 language: es
subtitle ( sid ): 6 language: es
subtitle ( sid ): 7 language: fr
number of subtitles on disk: 4
success: format: 2 data: 0x2800 - 0x2000
No matching DVD audio language found!
MPEG-PS file format detected.
VIDEO: MPEG2 720x480 (aspect 3) 29.970 fps 9801.6 kbps (1225.2 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:720x480 fps:29.97 ftime:=0.0334
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 448.0 kbit/29.17% (ratio: 56000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
==========================================================================
PACKET SIZE: 2048 bytes, deltascr: 245760
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [pp=de]
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 480 (preferred colorspace: Mpeg PES)
[PP] Using external postprocessing filter, max q = 6.
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
Try appending the scale filter to your filter list,
e.g. -vf spp,scale instead of -vf spp.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
==========================================================================
MP3 audio selected.
Limiting audio preload to 0.4s.
Increasing audio density to 4.
VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12)
[PP] Using external postprocessing filter, max q = 6.
Could not find matching colorspace - retryin...

Read more...

Revision history for this message
Brian Neltner (neltnerb) wrote :
Download full text (4.5 KiB)

It appears that the mencoder x264 options have changed since I wrote the
patch. The me=3 option has been replaced with me=umh. However, it
appears that using umh over hex has a negligible gain in encoding
quality anyway, so I would recommend deleting the me=3 bit in the
encoding command.

In fact, you can replace the entire option line for the encoding with:

subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b:threads=auto

for high quality encoding at reasonable speed, and with:

subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b:threads=auto

for ultra high quality encoding at slow speed.

These are the new "recommended" encoding options from the mencoder
homepage
(http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html#menc-feat-x264-encoding-options).

On Thu, 2008-04-17 at 20:35 +0000, Kevin Oberle wrote:
> This patch doesn't work for me.
>
> I get the same symptoms before and after installing the patch. Upon
> starting the encode acidrip says it was interrupted by the user. Here is
> the debug output:
>
> AcidRip message - Running mencoder dvd://1 -dvd-device /dev/dvd -alang English -info srcform="DVD ripped by acidrip.sf.net" -oac mp3lame -lameopts abr:br=128 -ovc x264 -x264encopts subq=6:me=3:frameref=5:bframes=3:weight_b:turbo=2:psnr:keyint=125:bitrate=869 -vf pp=de -of mpeg -o "/home/kevin/juno.mpg"
> AcidRip message - Encoding film
> MEncoder 2:1.0~rc2-0ubuntu13 (C) 2000-2007 MPlayer Team
> CPU: Intel(R) Celeron(R) M processor 1.50GHz (Family: 6, Model: 13, Stepping: 8)
> CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
> Compiled with runtime CPU detection.
> Option x264encopts: Bad argument me=3
> There are 32 titles on this DVD.
> There are 29 chapters in this DVD title.
> There are 1 angles in this DVD title.
> audio stream: 0 format: ac3 (5.1) language: en aid: 128.
> audio stream: 1 format: ac3 (stereo) language: es aid: 129.
> audio stream: 2 format: ac3 (stereo) language: fr aid: 130.
> audio stream: 3 format: ac3 (stereo) language: en aid: 131.
> number of audio channels on disk: 4.
> subtitle ( sid ): 4 language: en
> subtitle ( sid ): 5 language: es
> subtitle ( sid ): 6 language: es
> subtitle ( sid ): 7 language: fr
> number of subtitles on disk: 4
> success: format: 2 data: 0x2800 - 0x2000
> No matching DVD audio language found!
> MPEG-PS file format detected.
> VIDEO: MPEG2 720x480 (aspect 3) 29.970 fps 9801.6 kbps (1225.2 kbyte/s)
> [V] filefmt:2 fourcc:0x10000002 size:720x480 fps:29.97 ftime:=0.0334
> ==========================================================================
> Opening audio decoder: [liba52] AC3 decoding with liba52
> Using SSE optimized IMDCT transform
> Using MMX optimized resampler
> AUDIO: 48000 Hz, 2 ch, s16le, 448.0 kbit/29.17% (ratio: 56000->192000)
> Selected audio codec: [a52] afm: liba52 (AC3-liba52)
> ==========================================================================
> PACKET SIZE: 2048 bytes, deltascr: 245760
> Opening video filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
> Opening video filter: [pp=de]
> ==================================================================...

Read more...

Revision history for this message
Kevin Oberle (kevin.oberle) wrote :
Download full text (3.2 KiB)

Thanks!! I tried doing that in the terminal but it looks like I'm still getting the same results. Did i do something wrong still??

Terminal stuff:

mencoder dvd://1 -dvd-device /dev/dvd -alang English -info srcform="DVD ripped by acidrip.sf.net" -oac mp3lame -lameopts abr:br=128 -ovc x264 subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b:threads=auto -vf pp=de -of mpeg -o "/home/kevin/juno.mpg"
MEncoder 2:1.0~rc2-0ubuntu13 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Celeron(R) M processor 1.50GHz (Family: 6, Model: 13, Stepping: 8)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
There are 32 titles on this DVD.
There are 29 chapters in this DVD title.
There are 1 angles in this DVD title.
audio stream: 0 format: ac3 (5.1) language: en aid: 128.
audio stream: 1 format: ac3 (stereo) language: es aid: 129.
audio stream: 2 format: ac3 (stereo) language: fr aid: 130.
audio stream: 3 format: ac3 (stereo) language: en aid: 131.
number of audio channels on disk: 4.
subtitle ( sid ): 4 language: en
subtitle ( sid ): 5 language: es
subtitle ( sid ): 6 language: es
subtitle ( sid ): 7 language: fr
number of subtitles on disk: 4
success: format: 2 data: 0x2800 - 0x2000
No matching DVD audio language found!
MPEG-PS file format detected.
VIDEO: MPEG2 720x480 (aspect 3) 29.970 fps 9801.6 kbps (1225.2 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:720x480 fps:29.97 ftime:=0.0334
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 448.0 kbit/29.17% (ratio: 56000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
==========================================================================
PACKET SIZE: 2048 bytes, deltascr: 245760
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 480 (preferred colorspace: Mpeg PES)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
The selected video_out device is incompatible with this codec.
Try appending the scale filter to your filter list,
e.g. -vf spp,scale instead of -vf spp.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1 or 2 (libmpeg2))
==========================================================================
MP3 audio selected.
Limiting audio preload to 0.4s.
Increasing audio density to 4.
VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
[swscaler @ 0x880f730]SwScaler: using unscaled yuv420p -> yuv420p special converter
x264 [error]: no ratecontrol method spec...

Read more...

Revision history for this message
Brian Neltner (neltnerb) wrote :
Download full text (4.2 KiB)

The problem you are having now is that you no longer included a bitrate
to encode at. Acidrip will automatically append

:bitrate=<bitrate>:pass=[1,2]

to make it work.

You also neglected the -x264encopts switch before the line of options
for the x264 encoder, which is why mencoder was unable to find the
encoding options.

In your case, you no longer included the bitrate=869 which was in your
original command (that acidrip added for you). If you don't include the
pass=1/2, it will encode in one pass (bad). If you want to encode in one
pass, you can do it, but should use the option crf=<quality> to get
constant quality... I think a quality of 17-22 is fine, so I usually
just use that as it gets me pretty good much faster than two pass
encoding.

However, two-pass is the way to go for the highest quality.

On Thu, 2008-04-17 at 23:33 +0000, Kevin Oberle wrote:
> Thanks!! I tried doing that in the terminal but it looks like I'm still
> getting the same results. Did i do something wrong still??
>
> Terminal stuff:
>
> mencoder dvd://1 -dvd-device /dev/dvd -alang English -info srcform="DVD ripped by acidrip.sf.net" -oac mp3lame -lameopts abr:br=128 -ovc x264 subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b:threads=auto -vf pp=de -of mpeg -o "/home/kevin/juno.mpg"
> MEncoder 2:1.0~rc2-0ubuntu13 (C) 2000-2007 MPlayer Team
> CPU: Intel(R) Celeron(R) M processor 1.50GHz (Family: 6, Model: 13, Stepping: 8)
> CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
> Compiled with runtime CPU detection.
> There are 32 titles on this DVD.
> There are 29 chapters in this DVD title.
> There are 1 angles in this DVD title.
> audio stream: 0 format: ac3 (5.1) language: en aid: 128.
> audio stream: 1 format: ac3 (stereo) language: es aid: 129.
> audio stream: 2 format: ac3 (stereo) language: fr aid: 130.
> audio stream: 3 format: ac3 (stereo) language: en aid: 131.
> number of audio channels on disk: 4.
> subtitle ( sid ): 4 language: en
> subtitle ( sid ): 5 language: es
> subtitle ( sid ): 6 language: es
> subtitle ( sid ): 7 language: fr
> number of subtitles on disk: 4
> success: format: 2 data: 0x2800 - 0x2000
> No matching DVD audio language found!
> MPEG-PS file format detected.
> VIDEO: MPEG2 720x480 (aspect 3) 29.970 fps 9801.6 kbps (1225.2 kbyte/s)
> [V] filefmt:2 fourcc:0x10000002 size:720x480 fps:29.97 ftime:=0.0334
> ==========================================================================
> Opening audio decoder: [liba52] AC3 decoding with liba52
> Using SSE optimized IMDCT transform
> Using MMX optimized resampler
> AUDIO: 48000 Hz, 2 ch, s16le, 448.0 kbit/29.17% (ratio: 56000->192000)
> Selected audio codec: [a52] afm: liba52 (AC3-liba52)
> ==========================================================================
> PACKET SIZE: 2048 bytes, deltascr: 245760
> Opening video filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
> ==========================================================================
> Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
> VDec: vo config request - 720 x 480 (preferred colorspace: Mpeg PES)
> Could not fi...

Read more...

Revision history for this message
msp3k (peek-nimbios) wrote :

There is a workaround for this bug. The bug is caused by acidrip not passing the necessary command line parameters to mencoder for the new version of libx264-57 library. But the necessary options may be set as defaults in an mencoder.conf file.

Create an mencoder.conf file (I created mine in ~/.mplayer/menoder.conf, but according to the man page /etc/mplayer/mencoder.conf or /usr/local/etc/mplayer/mencoder.conf should work as well) and place inside it a line like this:

x264encopts=subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b:threads=auto:qp=20

I believe the only option that is /truely/ necessary in order for acidrip to work is the qp=XX option. The value for XX and the other options listed in the line above are merely taken from a previous post in this list as the 'optimal' settings for an 'ultra-high' quality encoding.

Attached is my mencoder.conf file.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Unsubscribing UUS as this needs more work. Please resubscribe when you're ready for sponsoring. If .conf file changes are needed, they should be dealt with in the patch too.

Revision history for this message
erik figura (emfigura) wrote :

unable to rip getting message "mencode inerupted by user"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.