Log in

View Full Version : .MP4 Good news! There is transcoding...


Gawen
21st April 2002, 21:39
...with ffmpeg CVS of today. And the bad: It works only on linux, the win32 compile path is broken. Tried the cross compile with i386-mingW-cross-gcc 2.92 and 2.93.
Nogo, sorry, i am definitely no c programmer and happy if a configure/make works! Volunteers here?

[root@od filme]# ffmpeg -y -an -i bbb.avi -vcodec mpeg4 -hq -4mv -b 600 bbb2.avi
libavcodec: CPU flags: mmx
Input #0, avi, from 'bbb.avi':
Stream #0.0: Video: msmpeg4, 624x336, 25.00 fps, q=0-0
Stream #0.1: Audio: mp3, 44100 Hz, stereo, 95 kb/s
Output #0, avi, to 'bbb2.avi':
Stream #0.0: Video: mpeg4 (hq), 624x336, 25.00 fps, q=3-15, 600 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 664 q= 3 size= 1569kB time=26.6 bitrate= 483.9kbits/s

And afterwards the normal
F:\>mp4creator60 -r 25 -c bbb2.avi bbb.mp4
F:\>wmp4player

Video quality looks promising in wmp4player and transcoding feels fast, 15-20 FPS on my good old PII 266 HP Server, video only.
Video on QT/Envivio works, but looks like DX50 on DIVX codec output. Outlook: There is already .mp4 format support for import, lets hope output will follow.

Chibi Jasmin
21st April 2002, 23:08
Sorry, I never worked with ffmpeg before, so I have to ask:

Are you converting (not reencoding) an ms-mpeg4-avi (v3? "iso"-v1?) to an iso-mpeg4-avi? That would indeed be GREAT NEWS!!!

Or is it a reencode you are doing?

Gawen
21st April 2002, 23:30
Looks like very fast reencoding on a high quality level. Imho there is no way to "convert" mp4v3 by stripping, adding or changing headers or frame info till somebody shows me one. Maybe more luck with MS-MPEG4 V1, but where is the big amount of content available in that format? Until that "great" moment when "converting" works and that will come or not i will keep on looking for the fastest way that gives me the quality, filesize and compatibility i want for my content. I will not sit and wait for a wonder, but will be happy when it happens. Till that day you are invited to share with me what i find. If you prefer waiting then wait. I knew no other way yet to generate .mp4 files playable in multiple players than dumping to raw and reencoding with divxenc. Ffmpeg works better for me, than what i had before. Good news from my point of view.

Chibi Jasmin
21st April 2002, 23:36
I understand...at least a bit...would you also share your divxenc (it's the mpeg4ip-one, right? What about mp4venc?) and raw dumping method with us? I read a bit about itin the other thread about ms-mpeg4-codec, but didn't really get it.

You mean you are more successful with different codecs/players than most people including me are with encoding to xvid/divx5 and using mp4creator? Sorry, I don't get exactly what you are doing...

My apologies, but I seem to be a bit off the path...is your work only about converting/transcoding from ms-mpeg4 to iso-mpeg4 or is it also about creating iso-mpeg4-streams directly (let's say from mpeg2-/dvd-source)?

As far as I understood, divxenc and now ffmpeg create mp4-streams that work better on a wider range of players than divx5/xvid? Can we feed an avs-script or maybe even an d2v-project or something similar into ffmpeg/divxenc?

Gawen
22nd April 2002, 00:07
My actual standard Test is: Does it play without major problems (no sound/no video) in mp4player (static linked), wmp4player (pluggable) and QT.502/Enivio1.0.23.00 Win.
I also test with the Philips Player, but just to see if a wonder happens, it seems to be just compatible to itself.
Thats my test field. Playing in the one most compatible app only is not enough for what i have in mind about how it should be.
Next is: How much time does it take, how many resources does it eat. Well dumping to raw takes min. 1 Gig for a 2.24 min. trailer and that is way too much. The result is the most compatible, but the price too high. Also quality could be better. Ffmpeg plays fine in mp4layer and wmp4player, there is video with heavy errors (like dx50 played with dx4.x) in QT/Env., but they are known to hang behind. I never made a .mp4 with dx5 or xvid that showed audio and video in all test players, even not with errors. Blackouts. A blackout is not acceptable for me. But for what i heared they are all working on interoperability.

3 Points for ffmpeg from my view: No blackouts, batchable, maximum space needed for film conversion < 3 Gig (+- 1,5 for PCM Wav + some space for aac + a second copy of the mpeg-4 stream). This seems the most acceptable yet for me.

If you want to try a dump, i will attach a batch that needs some work with Vdub before. The divxenc60.exe is in the same zip file you downloaded to get mp4creator. Get the latest zip from rarewares, everwicked has put faac60.exe in again. You need it.

My reference batch for compatibility, call it without options for a short instruction :-):

@echo off
cls
if not exist rawepisode2.avi goto error
if not exist rawepisode2.wav goto error
del episode2.*
avi2raw60 -v rawepisode2.avi episode2.raw
rgb2yuv60 episode2.raw episode2.yuv
faac60 -r 24 rawepisode2.wav episode2.aac
divxenc60 -r 24 episode2.yuv episode2.divx
mp4creator60 -c episode2.divx -H episode2.mp4
mp4creator60 -c episode2.aac -O -H episode2.mp4
mp4creator60 -list episode2.mp4
start mp4player60 episode2.mp4
pause
goto end
:error
echo Get the episode2 DivX 5 trailer from
echo http://www.pocketmatrix.com/multimedia/downloads/episode2-clone-war.avi
echo Open it in Vdub, set A/V to FPM, filters rotate left 90 deg, crop to 320*240
echo Set audio conversion to 44100 KHz, 16 Bit, Stereo, Integral
echo Save Audio as uncompressed PCM rawepisode2.wav, set audio to "none" in vdub,
echo save Video as uncomressed RGB rawepisode2.avi, then start this batch again.
echo **********************************************
echo Have at least 2 Gig free space on your hd :-)
echo and the mp4ip tools and mplayer in this path.
echo Take care that faac60.exe is in your toolkit.
echo **********************************************
pause
:end
exit

Chibi Jasmin
22nd April 2002, 00:18
I start to understand... :-)

The RAW avi is an avi containing uncompressed RGB. This you put into avi2raw for converting from avi to RAW (another raw this time) video (what is this? only fourcc stripped?). This is put into a converter to yuv, then into divxenc (btw: mpeg4ip also mention iso-encoder called mp4venc, what about that?) for encoding.

What I would be interested in is the possible options for avi2raw and divxenc (they don't output something on '/?').

And even more...is it somehow possible to frameserve to avi2raw [EDIT, maybe directly to divxenc60? will try] ? I tried an avs-script and vdub-frameserver, but they got rejected...that would skip the step of having gigabytes of raw data on the drive. See, my goal is not to reencode existing clips, but to encode dvd-content into iso-mpeg4. Of course I can dump the mpeg-2 to uncompressed rgb (maybe yuv, even huffyuv...!?!? Still lotsa stuff to try), but that's not really usable...maybe ffmpeg can directly accept mpeg2-input? Well, as it is usable only on linux at the moment, it is not an option, but maybe later...

Gawen
22nd April 2002, 00:52
The mpeg4ip tools dont even pipe to each other and they dont know about the M$ video subsystem. For tools coming from unices it is strange to see that you cant even do a pipe chain like avi2raw | rgb2yuv | divxenc or even better ffmpeg -i infile -vcodec rawvideo -f pgmyuvpipe - | divxenc, which would take no more space than the new .mp4. There is a ffmpeg.exe available from http://ffmpeg.sourceforge.net but the codecs are a little outdated. Get it for testing. As soon as i am successful to push somebody fixing the win32 compile chain in the cvs version you will find it here. Promised. If you want more info about the options of the mpeg4ip tools, have a look into their public cvs at http://mpeg4ip.sourceforge.net . The info you want is in the doc directory of the sources and you can browse the sources there via web.

My idea of what could be? Hmm...

Toolchain: A Gtk Gui working in win32 and linux, managing a patched ffmpeg that can read multiple .vob files from DVD, converting them on the fly to someting like a DivxVCD or DVCD, containing data and a players for several os flavors and metainformation about the content in MPEG-7 XML. This would become autoimaged to an ISO file and archived / burned on demand. The same for already existing AVI files.

How far away: There is the mp4Player for win32, linux, OSX, freebsd. There are guys here working on ISO Level 2 tools. The XML format is known and there is a free tagger at alphaworks. Ask all those great c hackers here. I wished i could do it myself and i would. With combined power a prototype could be done in ... 4 weeks? I dont know. If the people here want to do it it can be done.

Our own "Homevideo" DVCD format could be earlier ready to market than a yet to come official mp4DVD.

Just dreaming! Good night! Time to go to bed in europe.

Chibi Jasmin
22nd April 2002, 01:04
Well, first an idea for saving at least a bit of hd-space...

AviSynth script:

avisource("test.avi")
converttoyuy2()

open in vdub save with direct stream copy, you got an yuv-avi instead of the larger rgb-one and save the rgb2yuv-step.

you should be able to do avi2raw and then divxenc.

also in Europe, so it's getting late here, too...quick check didn't find the sources with the docs on mpeg4ip...do you give me a hint?

this is getting quite complicated...mpeg-4 stuff seems not to be that mature at the moment...including the players...for example, who knows how compliant wmp4player really is? It does not support b-frames, that is one point...but if it fails (mainly on xvid/divx5), is it the codecs or the players fault? Lots of questions here...

And as I am also not into programming, I will probably have to wait for some people to develop working encoders (well, maybe they are there and the players are bad!) and/or players...

I will give this a break for now...thanx for your very detailed explanations.

Gawen
22nd April 2002, 01:23
Youre welcome. You find the docs here:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mpeg4ip/mpeg4ip/doc/

Good night!
(And cheers, i am sitting here watching a film that wouldnt exist without mpeg4 and p2p, having a glass of red wine for coming down and smile about a holiday video from somalia that changes from divx to mp4. Batches are great and live is wonderful!)

Chibi Jasmin
22nd April 2002, 11:04
Will play around with it a bit, but probably focus on getting xvid to work, there currently seems to be a problem, when using MPEG-quant matrix. Maybe I'll also play with divx5...I'm just more faithful in the quality...don't think divxenc/ffmpeg will do that good. Main thing I started this was I first took this thread to be a div3/msmpeg4v3->mpeg4-iso conversion thing...but anyway, as it developped I learned a lot of interesting things...thanx for your information.

Gawen
22nd April 2002, 11:22
Focussing on xvid makes sense because divxenc uses an older release of the xvid engine patched to compatibility. I saw a thread on the mpeg4ip forum yesterday, where the xvid cracks offered support for enhancing that old engine. Ffmpeg is the engine behind mpeg4ips realtime transmission grabber.

The hole opensource community cooks with the same water in this arena and they are talking to each others. Thats the great thing in it, not to invent the wheel again and again but to bundle knowledge. This will break M$s overpower somewhen. Just a question of time.

Chibi Jasmin
22nd April 2002, 11:45
You're a true believer :-)

Well, XVID with H263 matrix and DivX5 without any MEPG-Tools activated work so far in MPEG4IP WMP4Player, also with AAC-Audio. They do not work in Envivio/RealOne Player (for some reason it doesn't install as QT Plugin, although I have QT installed). I never got my hands on the Philips player, maybe you can tell me, where to get it?

But people treat MPEG4IPs player as reference anyway, although it does still not support a wide range of mpeg4-features. BTW: Why does it only work, when Debug/Use ISO Decoder is NOT activated? ISO-Decoder always gives me choppy video...

Gawen
22nd April 2002, 23:04
Just PM me an email address. Its actually not downloadable from Philips site for whatever reason, even if the links are still there.

Chibi Jasmin
22nd April 2002, 23:17
Done :-) Thanx...