I need help to convert videos to Lagarith MP4!

If you have questions about compression/encoding/converting look here.
twindelphine
Joined: Sat Dec 19, 2009 10:02 pm
Org Profile

I need help to convert videos to Lagarith MP4!

Post by twindelphine » Fri Apr 02, 2010 3:08 am

I have been trying to convert several MP4 files into lagarith AVI format using the software SUPER Converter from eRightSoft, but I'm kind of stuck right now in several problems.

1. Where is the lagarith codec in Output Video Codec?
2. How can I properly choose the fps & bitrate for both video & audio?

Yes, I've searched online for related threads but the solutions' usually to download other software, or no conclusive answer at all. Hope someone would be able to help!

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Granarolo dell'Emilia (BO), Italy
Contact:
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by mirkosp » Fri Apr 02, 2010 3:15 am

SUPER is not the software you should use.
Read <a href=http://www.a-m-v.org/guides/avtech31/>ErMaC & AbsoluteDestiny's Friendly AMV Guides Lovingly Overhauled Largely by Zarxrax</a>. As you will realize, you can easily do that with avisynth+virtualdub.
Image

twindelphine
Joined: Sat Dec 19, 2009 10:02 pm
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by twindelphine » Fri Apr 02, 2010 5:47 am

Yes, I've looked at that guide for a very long time. But it's very complicated, I didn't know how to convert.

twindelphine
Joined: Sat Dec 19, 2009 10:02 pm
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by twindelphine » Fri Apr 02, 2010 5:58 am

My apologies for the double post, but I just want to mention that the videos are of H.264 codec.

twindelphine
Joined: Sat Dec 19, 2009 10:02 pm
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by twindelphine » Fri Apr 02, 2010 7:36 am

Talk about title error! Sorry it's meant to be Lagarith AVI not MP4.

Anyways I'm just starting to know a little more about the VirtualDub/AviSynth. But for the code, what about MP4 sources? What code do I use to appropriately use the source videos?

User avatar
mirkosp
The Absolute Mudman
Joined: Mon Apr 24, 2006 6:24 am
Status: (」・ワ・)」(⊃・ワ・)⊃
Location: Granarolo dell'Emilia (BO), Italy
Contact:
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by mirkosp » Fri Apr 02, 2010 12:24 pm

Code: Select all

ffvideosource("your file.mp4")
then you load the script into virtualdub. The guide puts it as easy as it gets, really...
Image

User avatar
Bakadeshi
Abuses Spellcheck
Joined: Mon Sep 29, 2003 9:49 am
Location: Atlanta, GA
Contact:
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by Bakadeshi » Fri Apr 02, 2010 3:53 pm

IFAIK, Super is based off ffmpeg/mencoder libraries which does not (yet) have lagarith support.
Only huffyuv and a few other lossless codecs specific to the ffmpeg library (wich are actually quite good, especially i like to use ffv1 for archives since its soo small) but if you want lagarith, you gotta go the virtualdub route

twindelphine
Joined: Sat Dec 19, 2009 10:02 pm
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by twindelphine » Fri Apr 02, 2010 11:21 pm

Get to know more about the virtualdub route. I'm using it at the moment to cut out certain scenes that I would want from the anime. Seems easier then I expected.

But I got one problem. When I attempt to sieve out the scenes, the input/output window in VirtualDub shows slight difference compared to the resultant AVI file. So I always get extra frames compared to what I actually see in VirtualDub. Is it because I used a not-so-powerful laptop to extract the scenes?

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by Qyot27 » Sat Apr 03, 2010 12:40 am

Bakadeshi wrote:IFAIK, Super is based off ffmpeg/mencoder libraries which does not (yet) have lagarith support.
'yet' being, the Lagarith decoder's git repo hasn't had a commit since October, and the discussion on the ffmpeg mailing list seems to have died around the same time. There is no encoder, AFAIK. And it can only decode Lagarith files that were encoded in YV12. I've whipped out a couple builds of it (also of the ordered-chapters branch, which is friggin' sweet, but looks just as dead in the water).

The only one I have access to at the moment is this one (which, due to the fact I compiled it with GCC 3.4.5, MJPEG is supposedly broken - ffvhuff and ffv1 both work fine, though; I later did one using GCC 4.4.x so the MJPEG warning disappeared). Includes both Windows and OS X builds (the OS X build was done on Tiger using Apple's GCC variant from Xcode, so it's something like 4.0.x or 4.1.x)
http://www.mediafire.com/?jo0ctjxqg5y
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by Mister Hatt » Sat Apr 03, 2010 6:39 am

Bakadeshi wrote:IFAIK, Super is based off ffmpeg/mencoder libraries which does not (yet) have lagarith support.
Only huffyuv and a few other lossless codecs specific to the ffmpeg library (wich are actually quite good, especially i like to use ffv1 for archives since its soo small) but if you want lagarith, you gotta go the virtualdub route
The ffmpeg developers refuse to code a lagarith encoder when ffvhuff is capable of RGBA and FFV1 can technically* do RGBA with much higher compression and far less speed. MEncoder generally just uses ffmpeg and nobody in the mplayer crowd really cares about lagarith in the first place.


*technically in that it can encode RGB with an alpha channel however during the encoding process everything is converted to YV12 and then to the target colourspace, thereby killing any alpha channels. I forget if you can even have YUV+A in FFV1 but it would be interesting to see.

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by Qyot27 » Sat Apr 03, 2010 10:24 am

Mister Hatt wrote:
Bakadeshi wrote:IFAIK, Super is based off ffmpeg/mencoder libraries which does not (yet) have lagarith support.
Only huffyuv and a few other lossless codecs specific to the ffmpeg library (wich are actually quite good, especially i like to use ffv1 for archives since its soo small) but if you want lagarith, you gotta go the virtualdub route
*technically in that it can encode RGB with an alpha channel however during the encoding process everything is converted to YV12 and then to the target colourspace, thereby killing any alpha channels. I forget if you can even have YUV+A in FFV1 but it would be interesting to see.
Explain this then, since it seems to completely blow that claim apart:
http://forum.doom9.org/showthread.php?p ... post612026
Akupenguin wrote:FFV1's RGB doesn't convert to YUV, it uses the same colorspace as in Huffyuv: G' = (2*G+B+R)/4, B' = B-G, R' = R-G.
And that was written back in February of 2005.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by Mister Hatt » Sat Apr 03, 2010 10:17 pm

That was written back in 2005. The FFV1 encoder has been changed quite a bit by astrange in the past few months, and it was he who mentioned the internal conversion as why it fails at preserving alpha channels. Additionally, while it supports various colourspaces, none of the FFV1 encoders themselves do. I forget exactly where the conversion to YV12->Target happens but iirc it was part of ffmpeg rather than the encoding process itself, and that's why it hasn't been fixed. ffmpeg goes through so many changes in a fortnight that any info about it from even a month ago is usually incorrect. I guess I could poke around and find out more but eh.

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by Qyot27 » Sun Apr 04, 2010 10:35 am

Well, going by some short tests I did, any colorspace conversions would produce a differing md5sum on the files. At least, from how I understand it.

AviSynth script containing ConvertToRGB32()
RGBA-mode HuffYUV file -> RGBA-mode FFV1 file -> RGBA-mode HuffYUV file

(actual commands:
ffmpeg -i testscript.avs -vcodec huffyuv huffyuv-control.avi
ffmpeg -i huffyuv-control.avi -vcodec ffv1 ffv1.avi
ffmpeg -i ffv1.avi -vcodec huffyuv huffyuv-final.avi)

md5sums on original and final HuffYUV files match, and the filesizes were the same. I would take this to mean that FFV1 or ffmpeg (I used ffmpeg-r22714) didn't do any internal conversion. But to double-check that the assumption was correct, I additionally did:

AviSynth script containing ConvertToRGB32()
RGBA-mode HuffYUV file -> YV12-mode FFV1 file -> RGBA-mode FFV1 file -> RGBA-mode HuffYUV file

(actual commands:
ffmpeg -i testscript.avs -vcodec huffyuv huffyuv-control.avi
ffmpeg -i huffyuv-control.avi -vcodec ffv1 -pix_fmt yuv420p ffv1-yv12.avi
ffmpeg -i ffv1-yv12 -vcodec ffv1 -pix_fmt bgra ffv1-bgra.avi
ffmpeg -i ffv1-bgra.avi -vcodec huffyuv huffyuv-final.avi)

In order to make sure a colorspace conversion happened. The original and final HuffYUV files' md5sums did not match, and the filesize was different.
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog

Mister Hatt
Joined: Tue Dec 25, 2007 8:26 am
Status: better than you
Contact:
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by Mister Hatt » Tue Apr 06, 2010 1:43 pm

Which version of ffmpeg? Did it uses astrange's updated FFV1 stuff? Is it from the general svn, ffmpeg-mt git, or a non-recent build? Stuff changes often there, and I DID get that info about colourspace conversion only a few days ago from the main FFV1 maintainer.

User avatar
Qyot27
Surreptitious fluffy bunny
Joined: Fri Aug 30, 2002 12:08 pm
Status: Creepin' between the bullfrogs
Location: St. Pete, FL
Contact:
Org Profile

Re: I need help to convert videos to Lagarith MP4!

Post by Qyot27 » Tue Apr 06, 2010 3:15 pm

It's a vanilla build that came from the general svn (svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk), and I built it the next day. r22714 is logged as having been committed on 2010-03-28 at 21:34:33 -0400, the build is Mar 29th at 10:53:49.
C:\dap\BT>svn log -r 22714 svn://svn.ffmpeg.org/ffmpeg/trunk
------------------------------------------------------------------------
r22714 | darkshikari | 2010-03-28 21:34:33 -0400 (Sun, 28 Mar 2010) | 4 lines

Update x264 presets in line with latest x264 changes.

Patch by Lou Logan.

------------------------------------------------------------------------

C:\dap\BT>ffmpeg
FFmpeg version SVN-r22714, Copyright (c) 2000-2010 the FFmpeg developers
built on Mar 29 2010 10:53:49 with gcc 4.4.3 (x86.generic.Komisar)
configuration: --prefix=/home/Stephen/ffms2_build --enable-gpl --enable-version3 --enable-postproc --enable-memalign-hack --enable-pthreads --enable-libxvid --disable-encoder=mpeg4 --enable-avisynth --extra-cflags='-I/home/Stephen/ffms2_build/include -march=pentium3' --extra-ldflags=-L/home/Stephen/ffms2_build/lib
libavutil 50.13. 0 / 50.13. 0
libavcodec 52.61. 0 / 52.61. 0
libavformat 52.58. 0 / 52.58. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.10. 0 / 0.10. 0
libpostproc 51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

C:\dap\BT>
I can't see anything in the git commit logs about FFV1-related stuff, though (at least, not since 2009). I couldn't really see how to navigate around the ffmpeg-mt gitweb log easily, but as my setup is too old to make using ffmpeg-mt worthwhile I only looked at it yesterday or the day before, and not for that long.



The only log entry I could find from the last few days referring to YV12 (or more precisely, 4:2:0) stuff was this one, committed a couple days after the build I was using. But it seems to be relevant only to ffserver.
------------------------------------------------------------------------
r22751 | rbultje | 2010-03-31 17:02:34 -0400 (Wed, 31 Mar 2010) | 9 lines

Fix FFM-based streaming from ffmpeg to ffserver. The basic problem is that
we'd memset() the codec context to zero, thereby setting audio input to U8
and video to YUV420P
. For most video encoders, that actually works, but for
most audio codecs, it doesn't. This patch changes defaults to those set by
avcodec_context_get_defaults() and have ffmpeg figure out the optimal encoding
format itself if not set explicitely (as it does for the non-ffserver-cases
also).
My profile on MyAnimeList | Quasistatic Regret: yeah, yeah, I finally got a blog

Locked

Return to “Conversion / Encoding Help”