View Full Version : avc2avi mod (build: 2006-11-12) released
crypto
14th November 2006, 22:26
avc2avi converts raw avc/h.264 streams to the avi format without reencoding.
Changes:
- Support for BBC HD streams added
- High profile fixed
Download here (http://sourceforge.net/projects/avc2avi)
Enjoy!
Kurtnoise
14th November 2006, 22:56
Hi,
Can we have also the sources please ? Thank you...
crypto
15th November 2006, 00:18
Hi Kurt,
the mod is based on rev=267 at videolan (https://trac.videolan.org/x264/browser/trunk/tools/avc2avi.c?rev=267)
For my changes see this post (http://dvbportal.dyn1.de/forum/index.php?topic=722.msg3922#msg3922)
mitsubishi
15th November 2006, 00:23
Tried it with a 6.94GB file I hacked out of a BBC TS earlier which plays in MPC, but crashes mp4box. It took about 27 mins, using 1 full core on my E63000.
C:\Documents and Settings\Administrator\Desktop\avc2avi_mod-20061112>avc2avi -i L:\test.264 -o G:\test.avi
avi file written
- codec: h264
- size: 1440x1088
- fps: 25.000
- frames: 79328
G&L being on different drives.
Problem is file won't play, MPC says no AVI index. VLC says AVI is broken fix yes/no, choosing no gives a few mangled frames before crashing (ffdshow can't handle these streams anyway).
264 - 7,455,414,939 bytes
avi - 7,457,358,732 bytes
crypto
15th November 2006, 01:15
You need to add the split option (-s 2000) for streams larger than 2 GB.
I have several hours of BBC HD Footage. It all converted ok. The AVIs load into VDub without rekeying.
The latest ffdshow handles the MBAFF interlacing of the BBC streams.
mitsubishi
15th November 2006, 01:21
You need to add the split option (-s 2000) for streams larger than 2 GB. Ah OK, will have another go, yeah I remember reading in avisynth docs about a 2GB thing.
The latest ffdshow handles the MBAFF interlacing of the BBC streams.Thanks, I didn't realise that, I'll update my July copy later. Its not in VLC yet though is it, thats upto date already.
crypto
15th November 2006, 07:55
Ah OK, will have another go, yeah I remember reading in avisynth docs about a 2GB thing.
mitsubishi:
Sorry for not mentioning the need of the -s switch. This project is/was kind of dead, but if I do another update, I will add code to enter the segmented mode automatically when dealing with large input files.
It took about 27 mins, using 1 full core on my E63000.
avc2avi is slow because it is a simple single threaded command line program. To be efficient it needs a total multithreaded reimplementation. I am thinking of a similar tool which uses the ultra-fast parser of hdtvpump. Conversion should not be slower than 1 GB/min.
Thanks, I didn't realise that, I'll update my July copy later. Its not in VLC yet though is it, thats upto date already.
For latest ffdshow builds see this thread New ffdshow build (?) (http://forum.doom9.org/showthread.php?t=98600)
I use the ffdshow SVN builds (http://www.ffdshow.info/) by clsid
killerhex
21st November 2006, 19:12
does it work on vfr encoded h264
crypto
21st November 2006, 22:38
Sorry no way, as avi does not support vfr. You should use the mkv container for that.
CHP
22nd November 2006, 19:05
thanks very much ~crypto~~!!!
try again later
Fulcanelli123
23rd November 2006, 00:37
I have several hours of BBC HD Footage. It all converted ok. The AVIs load into VDub without rekeying.
The latest ffdshow handles the MBAFF interlacing of the BBC streams.
Do you mind telling me exactly how you do this? When I tried it still wouldn't go into Vdub and the 'avi' wanted an H264 codec. Said it needed a VFW codec and DirectShow are not suitable. On the plus side it didn't try rekeying.
Neither WMP nor MPC will play the files whereas they played the TS files. I got the raw file via TSConverter
My syntax was:
D:\avc2avi\avc2avi.exe -i D:\avc2avi\mydemuxedvideo.RAW -o D:\myconvertedavifile.avi -c H264 -s 2000
Think I got that syntax off another thread. When I saw it had still kept the h264 (which is what VDub/Avisynth seem to be having problems with) I tried it without the '-c H264' switch. Still got an h264 avi.
None of the segments will even load via AviSynth using DirectShow now - just crashes. (Not that I want to use avisynth and direcshow as that combi seems to screw up the frames). Avisource and OpenDML also won't work. And of course it won't go in VDub directly. :(
Do I actually need to have have ffdshow installed? I've always avoided that, as I've heard it can interfere with other codecs, so if it's not going to solve things I won't install it.
Thanks for any help
crypto
23rd November 2006, 00:50
Hi Fulcanelli123,
the syntax is ok, but use h264 as fourcc, at least for vdub. And yes, you need to install ffdshow. Don't worry, it allows to be configured very granular, when to use which codec and you can disable it completly.
When installed, make sure there is the ff_vfw.dll in the the system32 folder and the following registry entry is present:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]
vidc.h264 = ff_vfw.dll
Fulcanelli123
23rd November 2006, 01:29
Hi Fulcanelli123,
the syntax is ok, but use h264 as fourcc, at least for vdub. And yes, you need to install ffdshow. Don't worry, it allows to be configured very granular, when to use which codec and you can disable it completly.
When installed, make sure there is the ff_vfw.dll in the the system32 folder and the following registry entry is present:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]
vidc.h264 = ff_vfw.dll
Hi Crypto
When I finished writing that I installed ffdshow - figured I could always uninstall if it buggered things up. Progress! The segments went into Vdub okay. Looked a bit crap mind, and Vdub seemed to give an error on the first frame when they were all appended. Then it crashed.
So I saved the first segment out as avi (direct stream copy) and input it via Avisynth (using AVIsource) that seemed to go alright except I got a green frame at the beginning. I guess I could input the segments individually via Avisynth and get Procoder to stich the files together (I'm encoding as svcd), but I'm worried if it's gonna insert green frames in other places. Should it be doing that?
Be better if I could append properly in Vdub and direct stream copy the complete file for reinput via Avisynth. Then I could mux in the wave audio that TS converter output and whip it into Procoder.
Gawd there's gotta be an easier way than this!! :)
Fulcanelli123
23rd November 2006, 03:36
Ooh I'm so very nearly there, I can feel it in my water....
If I don't mess around with the slider in VDub I can append the segments avc2avi output and save as one big avi without it crashing. Yay! Reload it and everything fine. Still uses ffdshow to decompress.
The problem comes when I load that avi file in via AviSynth - which I have to if I want to frameserve to Procoder.
It uses Helix Y12 to decompress not ffdshow, so I'm wondering if that is the problem. Get a green frame at 0, 2,3,4 before it shows a normal frame again. Hard to tell if there is any more further along, as seeking is quite slow even though it's drastically resized and it usually ends up crashing.
I figured as ffdshow decompressing in Vdub didn't have this problem, I'd get avisynth to try and use that. I've ticked the avisynth bit in ffdshow and the 'ffavinsynth.dll' is in the plugin folder, but whenever I call it:
avisource("D:newfile.avi")
ffdshow("default")
it just says there is no function called ffdshow.
Thanks for your help, I'm finally beginning to get somewhere with these wretched files!
ETA: The ff_vfw.dll is in the system32 folder, but the only entry for that file in the registry is VIDC.FFDS
Would that affect anything? Can/should I add the h264 entry in manually?
crypto
23rd November 2006, 08:23
ETA: The ff_vfw.dll is in the system32 folder, but the only entry for that file in the registry is VIDC.FFDS
Would that affect anything? Can/should I add the h264 entry in manually?
No, leave it as it is. You can also block ffdshow for H.264 playback. During frame serving it won't kick in anymore and the filter you are expecting will be used. Select the codec setting from the options and set H.264 playback to disabled (from libavcodec)
I agree, H.264 stuff is still very experimental. But at least we get some results until better / easier tools appear.
One more word on AVI.
AVI is not the container of choice for H.264 material, this should be MP4. Newer MP4Box builds work on short BBC HD samples, but on feature-length material it crashes. In this experimental phase it is worth to check on newer builds as MP4Box is continuously improving.
Fulcanelli123
23rd November 2006, 12:33
No, leave it as it is. You can also block ffdshow for H.264 playback. During frame serving it won't kick in anymore and the filter you are expecting will be used. Select the codec setting from the options and set H.264 playback to disabled (from libavcodec)
I agree, H.264 stuff is still very experimental. But at least we get some results until better / easier tools appear.
One more word on AVI.
AVI is not the container of choice for H.264 material, this should be MP4. Newer MP4Box builds work on short BBC HD samples, but on feature-length material it crashes. In this experimental phase it is worth to check on newer builds as MP4Box is continuously improving.
Yeah I did try mp4box but didn't have much luck.
I'm still at an impasse unless I can use ffdshow in avisynth as avisource gives me green frames. I'm assuming because ffdshow doesn't when input in vdub directly, it might not via avisynth. But how to call it??
Of course if that also gives green frames then the problem is avisynth.
Fulcanelli123
23rd November 2006, 18:22
Ack, I'm throwing in the towel on this.
I just encoded 30 minutes svcd and it's clear this ain't gonna work. The green frames I could cut out from the front, but it appears to be doing exactly what DirectShow did - inserting grey frames in the middle. Procoder said it was using the ffdshow codec so I can't blame DirectShow. Tmpgenc had previously given grey frames too so it's not the encoder. It has to be avisynth.
This sucks!
Ah well no encoding HD caps for me then. :((
oddball
26th November 2006, 03:58
Use Avisynth with the DirectShowSource("name.ts") command. You get to see what the output is etc.
Fulcanelli123
29th November 2006, 00:14
Use Avisynth with the DirectShowSource("name.ts") command. You get to see what the output is etc.
I started out doing that but DirectShow in combination with AviSynth and AVC H.264 files screwed up the frames. I didn't get the grey frames at the beginning and end like other people, I got them randomly and frames appearing in the wrong place. The fix that's just been put up never solved it.
The avi segments output by avc2avi were fine when input directly into VDub using ffdshow, but when used with AviSynth I got green frames at the beginning and randomly throughout the file using both AviSource and DirectShow.
I've managed to sort it though - finally. I append the avi segments from avc2avi and save as avi with Huffy lossless codec. This gives me a 78gig file, but what the heck!
I then put that file into VDub using AviSynth/Avisource and everything is peachy. Test my filters, resize and put the avs into Procoder. Encoded fine and I just had to match up the audio afterwards which has gotten easier with practice.
So sorted out at last, thanks to Crypto's fab programs. :)
crypto
29th November 2006, 08:00
Cool, finally a way to use avisynth.
I always used Vdub to encode into the destination format and did not face the avisynth problems.
So one more thing is worth a try. It could be the segmented file or the original h.264 encoding which confuses Avisynth. Instead of using huffy save the segments to one big OpenDML avi using direct stream copy and see if avisynth likes it.
Fulcanelli123
29th November 2006, 16:47
Cool, finally a way to use avisynth.
I always used Vdub to encode into the destination format and did not face the avisynth problems.
So one more thing is worth a try. It could be the segmented file or the original h.264 encoding which confuses Avisynth. Instead of using huffy save the segments to one big OpenDML avi using direct stream copy and see if avisynth likes it.
Tried that originally when I was having probs with the TS. That inserted grey frames - but that of course was used with AviSynth. Then saved out the segmented avis directly with VDub but that gave green frames when using with Avisynth calling either Avisource, OpenDML or DirectShowSource. I could have encoded the avi segments directly with VDub but I'm used to Procoder and don't want to change unless I'm forced into it.
I think I have an idea what is causing the screw ups though, because whenever I tried the sample clips from the BBC they were fine...the problem came with the full 50 minute programmes.
If there is any glitch in the broadcast that's where the problems tend to occur. I did a sample of Robin Hood from Saturday and a certain part there was an obvious 'jump' as if it had dropped a couple of frames. I can't tell this from the original file as it's such a high resolution and seeking is so slow on my machine, so I downloaded an xvid which had used the HD source, and sure enough in the same frame they had a pixel break up in an area of the screen. On mine the encode drops the frames, inserts grey frames or even duplicates...which of course buggers up the audio.
This week there was obviously a glitch somewhere because no matter what I did I got dropped frames at the same point each time, which buggered up the audio big time. Using Huffy with AviSynth, it seemed to ignore any glitches and carry on encoding. Examining the encoded frame later in VDub showed a weird flash at that point, where the pixels were all blurred at the bottom of the screen. Not noticeble in playback though, and once the audio was matched up it stayed so.
So yeah, I think problems are possibly caused by any glitches in the actual broadcast which the H.264 codec in combi with DirectShowSource/Avisource and/or Avisynth can't deal with. Bypassing the H.264 and using Huffy seems to have done the trick for me. Whether it'll work for anyone else though I don't know.
I'm just glad I had enough hard drive space for the Huffy file!!
BTW...anyone struggling with aligning the audio might want to try these values - it's usually one of them (but I've only really been capping Torchwood so whether it'll work on other caps I don't know) -1000ms; -1200ms; -1500ms; -1700ms. The first and last I've used most frequently and they are usually spot on.
crypto
10th December 2006, 15:40
The project avc2avi is now on SourceForge.net:
http://sourceforge.net/projects/avc2avi
Joniii
27th January 2008, 11:58
I tried this with some Blu-ray h.264 releases. Did this:
avc2avi -i video.avc -o video.avi -f 23.976 -s 2000
When I load the video in VirtualDubMod, it says framerate is 23.975. This happens with all movies I've tried.
Moitah
29th May 2009, 19:53
I made it run quite a bit faster, here it is if anyone wants to try:
avc2avi_fast.zip (http://www.moitah.net/misc/avc2avi_fast.zip)
I only tried it on one video but the AVI came out bit-identical to the original code's output.
Basically, memmoving almost a full ~3MB buffer for each NALU* is really slow :).
* EDIT: I thought it was for each frame at first, but I realized this video has 9 NALUs per frame (a SEI and 8 slices).
SeeMoreDigital
29th May 2009, 22:29
Just tried your build.... It's certainly "much" faster ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.