View Full Version : .H264 Video to xvid
pacman99
20th August 2005, 23:58
Hi,
I was trying to transcode a mp4 file I had to avi (xvid) so it would play on my network media player. This mp4 file plays perfectly on WMP 6.4. However I ran into a LOT of problems heh. First of all, I tried converting the mp4 to AVI using MP4cam2AVI. At first I kept on getting an error in virtualdub, but after enabling .h264 support in ffdshow, I was able to open up the file BUT it wouldn't decode! I kept on getting "error: cannot decode frame 1" errors. I tried playing this AVI file (generated by the program) in WMP6.4 and for some reason, it just kept crashing. Same w/ VLC. So I assumed the program didn't change the container from MP4 to AVI properly.
SO I used YAMB along with MP4Box and demuxed the video and audio. Video ended up giving me a .h264 file and the audio gave me an .aac file. The video (.h264 file) header has the following in it:
#..x264 - core 29 svn-255M - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html
The video plays fine on WMP 6.4.
Anyways so my question was, how can I get this .h264 file to convert to xvid, wmv9, or divx? I can't seem to open it in virtualdub as it won't recognize the header i'm assuming (it gives me an unsupported file error instead of 'need video codec' error). TMPGEnc Xpress/Plus2.5 won't open the file either. I'd like to keep the audio as AAC as my player can play that ^_^
Thanks~
Doom9
21st August 2005, 00:36
I'm surprised you can play raw streams at all in WMP.
I suggest you use AviSynth for the job. Create an AviSynth script as follows:
DirectShowSource("yourmp4.mp4", fps=23.976)
replace the 23.976 with the actual fps of your video
Load that into VirtualDub and you'll be good to go.
Last but not least the mandatory warning: you should always use your original source as starting point, never an already converted file (DVD, or digiTV broadcast are already compressed using lossy compression and any subsequent recompression degrades the result.. the more generations of conversions you add, the more you degrade the picture.
pacman99
21st August 2005, 06:56
I get an "AVI import filter" error :(
MeteorRain
21st August 2005, 09:13
DirectShowSource() will cause an "AVI import filter" error?
can't imagine :|
try open it in graphedit and see if it works....
bond
21st August 2005, 11:17
try exporting from .mp4 to .avi with yamb
than try to load the .avi in virtualdub, but make sure that you enable h.264 decoding in ffdshow in the vfw decoder config not in the normal dshow config, these are two different things
once you see the video in vd you can encode to xvid as normally done
pacman99
21st August 2005, 16:10
try exporting from .mp4 to .avi with yamb
Yes I tried that and it loaded, but when I start the comrpession (file/save AVI), then I get an error saying "cannot decompress frame 1"
Note that I can't play the AVI outputted by YAMB in WMP6.4. It just crashes, whereas I can play the mp4 just fine :confused:
This is how my ffdshow settings look like:
http://img378.imageshack.us/img378/4884/ffdshow3ou.png
try open it in graphedit and see if it works....
It doesn't work. Only the mp4 can generate a graph in graphedit. Hmmm maybe my AVS is wrong. I don't know much about it that's probably why.
Basically this is what my AVS says:
DirectShowSource("Sonu Nigam Concert.mp4", fps=25)
That's it. I didn't put anything else. Am I supposed to? Sorry I haven't really used avisynth that much but it is installed and I recall using it properly once...long time ago heh. Oh and the AVS file is in the same directory as Sonu Nigam Concert.mp4.
stephanV
21st August 2005, 16:29
your script is missing the path, try
DirectShowSource("c:\mypath\to\Sonu Nigam Concert.mp4", fps=25)"
(replace with correct path of course)
pacman99
21st August 2005, 16:47
k now it's
DirectShowSource("Z:\d-temp\Misc\Sonu Nigam - Chanda Ki Doli Concert\Sonu Nigam Concert.mp4", fps=25)
I still get the following error:
http://img394.imageshack.us/img394/4425/avierror5pf.png
bond
21st August 2005, 17:27
Yes I tried that and it loaded, but when I start the comrpession (file/save AVI), then I get an error saying "cannot decompress frame 1"
Note that I can't play the AVI outputted by YAMB in WMP6.4. It just crashes, whereas I can play the mp4 just fine :confused: if its not playing in directshow than try to change the fourcc to for example H264
a fourcc changer is coming with xvid for example
pacman99
21st August 2005, 17:44
I changed to MP43 and xvid and a few others and I still get the same error msg when I try to play the AVI:
"The instruction at '0x027649b8' referenced memory at '0x0aeee67e'. The memory could not be 'written'. Click on OK to terminate the program, Click on CANCEL to debug the program.
MeteorRain
21st August 2005, 18:00
well, pacman99: convert the h264 raw file into mp4 (use mp4box or mp4creator? i can't remember it very well, sorry:o)
and then, open the mp4 in graphedit to see if it works.
as soon as it works, you can use directshowsource to open it in avs.
stephanV
21st August 2005, 18:02
seems like AVISynth is not installed though. If directshowsource cant construct a graph you'd get a whole different message. theres a tool called AVC2AVI, which i believe you can use to mux raw AVC into AVI, you might give it a go, you should be able to find a link here somewhere.
bond
21st August 2005, 18:15
I changed to MP43 and xvid and a few others and I still get the same error msg when I try to play the AVI:
"The instruction at '0x027649b8' referenced memory at '0x0aeee67e'. The memory could not be 'written'. Click on OK to terminate the program, Click on CANCEL to debug the program.i am talking about the .avi that got created via exporting from .mp4 to .avi in yamb
set the fourcc to H264 and than try opening that .avi in virtualdub without an .avs script
of course you have to enable h.264 decoding in ffdshow VFW as i wrote already
pacman99
21st August 2005, 18:49
thanks guys...it appears to be working now. I had to reinstall avisynth >_<
actually one last question. How would I go about muxing the AAC audio into the recompressed AVI stream that i'll be doing from virtualdub? Virtualdub won't let me add AAC audio >_< Any programs I should look for?
bond
21st August 2005, 19:07
aac-in-avi is not really widely supported, better use a container like .mp4 or .mkv for storing aac audio
stephanV
21st August 2005, 19:12
thanks guys...it appears to be working now. I had to reinstall avisynth >_<
actually one last question. How would I go about muxing the AAC audio into the recompressed AVI stream that i'll be doing from virtualdub? Virtualdub won't let me add AAC audio >_< Any programs I should look for?
AVIMUx GUI
pacman99
21st August 2005, 19:33
thanks alot!
SeeMoreDigital
21st August 2005, 19:45
try exporting from .mp4 to .avi with yambI've tried this on a number of occasions with different versions of MP4Box.exe and the resulting file is not playable, even after changing the 4CC code (with Nic's 4CC Changer) to H264/H264 :(
I'm surprised you can play raw streams at all in WMP.I must admit I was quite surprised when I managed to get RAW .H264 streams to play in WMP10.... using Nero's filters.
Cheers
bond
21st August 2005, 19:53
I've tried this on a number of occasions with different versions of MP4Box.exe and the resulting file is not playable, even after changing the 4CC code (with Nic's 4CC Changer) to H264/H264 :( good to know, thx
I must admit I was quite surprised when I managed to get RAW .H264 streams to play in WMP10.... using Nero's filters.i think moonlights and mainconcepts parser can also parse raw avc
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.