Log in

View Full Version : How to encode high definition raw h.264


Guest
25th April 2005, 20:55
I'm an MP4 noob. My boss has tasked me with encoding a 1080i HD MPEG2 stream into raw h.264.

I can handle the decoding of the MPEG2 with DGMPGDec. :)

What tools can I use to produce 1080i raw H.264 (interlaced encoding with no B frames)?

Thank you.

Doom9
25th April 2005, 21:38
the only AVC codec I know of that offers interlaced encoding is NeroDigital AVC. But, that doesn't offer raw output. So you'd have to load your AviSynth script into Recode / NeroVision Express, encode to MP4, then using mp4box/mp4creator to extract the raw video stream from the mp4.

slavickas
25th April 2005, 22:14
Originally posted by Doom9
the only AVC codec I know of that offers interlaced encoding is NeroDigital AVC. But, that doesn't offer raw output. So you'd have to load your AviSynth script into Recode / NeroVision Express, encode to MP4, then using mp4box/mp4creator to extract the raw video stream from the mp4.

i thought that _current_public_ version of nero won't support interlaced _encoding_

moonlight oneclick encoder install filters which probably supports interlaced encding. with graph like source -> h264 -> dump is't possible to get raw h264 , other option proably hack in reference encoder like version with avs input

CyberGuy
25th April 2005, 22:21
Originally posted by neuron2
I'm an MP4 noob. My boss has tasked me with encoding a 1080i HD MPEG2 stream into raw h.264.

I can handle the decoding of the MPEG2 with DGMPGDec. :)

What tools can I use to produce 1080i raw H.264 (interlaced encoding with no B frames)?

Thank you.

How long, as in number of minutes and seconds, is the video?

Guest
25th April 2005, 22:25
Originally posted by CyberGuy
How long, as in number of minutes and seconds, is the video? He wanted less than 45MBytes. I don't know how much 1080i video you can encode in that size.

I understood that Nero doesn't do HD. Is that correct?

video
25th April 2005, 22:43
Originally posted by neuron2
I understood that Nero doesn't do HD. Is that correct?

Actually - it does, at least it did with my cinealta videos. I've directshowsourced them with the installed sony HDCAM codec.

CyberGuy
25th April 2005, 22:57
Originally posted by neuron2
I'm an MP4 noob. My boss has tasked me with encoding a 1080i HD MPEG2 stream into raw h.264.

I can handle the decoding of the MPEG2 with DGMPGDec. :)

What tools can I use to produce 1080i raw H.264 (interlaced encoding with no B frames)?

Thank you.
First, if Nero doesn’t do interlaced, then try the JM 9.5 Reference Encoder. You can download it at http://iphome.hhi.de/suehring/tml. I haven’t used it to do interlace video but according to the documentation it will do interlaced video. To disable B frames, set NumberBFrames = 0. You will have to compile the LENCODE.EXE file using Visual Studio.

NumberBFrames = 0 # Number of B coded frames inserted (0=not used)

#########################################################################################
# Interlace Handling
#########################################################################################

PicInterlace = 0 # Picture AFF (0: frame coding, 1: field coding, 2:adaptive frame/field coding)
MbInterlace = 0 # Macroblock AFF (0: frame coding, 1: field coding, 2:adaptive frame/field coding)
IntraBottom = 0 # Force Intra Bottom at GOP Period


Use AviSynth and MEncoder covert your MPEG-2 video to raw YUV.

MENCODER.EXE VIDEO.AVS -nosound -ovc raw -vf format=i420 -of rawvideo -o VIDEO.YUV

Then edit the ENCODER.CFG file and make the appropriate changes and run LENCODE.EXE. It will take a very long time. One minute will take about six hours on a P4 3GHz computer.

I have LECODE.EXE compiled and all the necessary files and batch files to do everything above if you need then. Just PM me with your e-mail address and I will send them to you.

Guest
25th April 2005, 23:11
Originally posted by video
Actually - it does, at least it did with my cinealta videos. I've directshowsourced them with the installed sony HDCAM codec. Maybe I'm not looking at the same thing as you. The only "Nero codec" I know about is Recode 2 and the manual says it is limited to 720x576 output video size.

@CyberGuy

Thanks, will send PM.

Sagittaire
26th April 2005, 00:11
Nero recode compatibility:
- Nero High Def profil for size up to 1920*1088*30 or 1280*720*60.
- Don't support interlaced/telecine encoding

IMO you must use IVTC for your MPEG2 HD source ...

Guest
26th April 2005, 00:18
Originally posted by Sagittaire
Nero recode compatibility:
- Nero High Def profil for size up to 1920*1088*30 or 1280*720*60.
- Don't support interlaced/telecine encoding

IMO you must use IVTC for your MPEG2 HD source ... What is the name and link for this codec? Where did you find those specs? Thank you.

I can't IVTC, I have video. But I can deinterlace.

virus
26th April 2005, 00:42
Originally posted by neuron2
I can't IVTC, I have video. But I can deinterlace.
Oh well, if you can deinterlace and drop the interlaced encoding requirement then x264 comes into play.
The commandline encoder (latest build in Sharktooth's sticky (http://forum.doom9.org/showthread.php?s=&threadid=89979)) reads AVS scripts and outputs either to raw H.264 or MP4, depending on the output file extension you give.
Just type "x264 --help" (or "x264" alone) for a list of encoding options.

Guest
26th April 2005, 13:58
Thanks, virus, I will try that today.

bond
26th April 2005, 14:14
Originally posted by neuron2
[B]What is the name and link for this codec?thats nerodigital, in nero recode2 too.
simply set the "profile" in recode2 to maximum definition - avc, this should allow you to use the encoder without limitations

Latexxx
26th April 2005, 14:30
Another possibility instead of deinterlacing would be going to 720p60 with something like

separatefields()
bicubicresize(1280,720)

Doom9
26th April 2005, 15:26
hmm? no interlaced encoding in NeroDigital? Then they must've been working on it for a looooong time cos I remember something about interlaced encoding from a discussion with Ateme that took place back in December.

Guest
26th April 2005, 16:21
So, I used the x264 as suggested by virus. I made both a .264 and a .mp4.

Then I got MPlayer from SharkTooth's link. When I open either of the above using MPlayer, it says "Cannot render the file".

EDIT: Then I installed ffdshow as in the link. There are no instructions about how to use it, so I just tried to open the MP4 using Windows Media Player. Same thing. Won't play. And it won't play the sample that got uploaded to my server either.

Why does nothing work for me?

bill_baroud
26th April 2005, 16:41
very dumb question, but have you a mp4 splitter ? (nero one, haali one, whatever one).

also, i don't think ffdshow can play raw h264 content.

Guest
26th April 2005, 16:53
I don't know what an MP4 splitter is. Should I have one? If so, which one and where do I get it?

I tried playing both the .264 and the .mp4.

bond
26th April 2005, 17:08
that mplayer doesnt handle playing the .mp4 is strange, cause normally it handles avc in mp4 fine
are other files played fine?

for playing a file in directshow you need two things:
1) a parser/splitter filter which splits up the container and outputs the a/v streams to the
2) decoder filter (eg ffdshow), which actually does the decoding

as mp4 parser/splitter i would recommend using haali's media/matroska filter, which i link to in the mp4 faq sticky

Guest
26th April 2005, 17:09
OK, I installed the 3ivx splitter and now the players open the file but give me a black screen and no frames. I know the file is OK because I can play it on my hardware decoder platform.

Should I give up on this free stuff and buy Nero?

EDIT: Just saw your post, bond. I got scared off that by the Matroska reference. I don't use or want Matroska. But I'll try that.

video
26th April 2005, 18:03
Originally posted by Doom9
hmm? no interlaced encoding in NeroDigital? Then they must've been working on it for a looooong time cos I remember something about interlaced encoding from a discussion with Ateme that took place back in December.

actually deinterlacing worked in latest december/2004 build (3.0.0.14). after that the tool is fucked up, and since then deinterlacing is broken. NVE3 just getting worse - don't know why...

video
26th April 2005, 18:05
Originally posted by neuron2

EDIT: Then I installed ffdshow as in the link. There are no instructions about how to use it, so I just tried to open the MP4 using Windows Media Player. Same thing. Won't play. And it won't play the sample that got uploaded to my server either.

Why does nothing work for me?

you should have a mpeg4 directshow parser/splitter. FFDSHOW does video decoding only.

install NVE3, and try to play your mp4 with nero showtime. raw H264 video (*.264) is not so much playable (at least in my side)

a) nero plays back meg4 videos except ttxt subtitles, if the file has any

b) MAcOSX/Tiger plays mpeg4 ASp/AVC videos w/o any problen in quicktime7.

It's not a stable, proven technology atm at PC side

Guest
26th April 2005, 18:15
I installed Haali as per bond's suggestion and now I can "play" my MP4s. I say that in quotes because playing 1920x1088 on a slow laptop is rather a pointless thing, it turns out, as the frame rate is terrible. :(

But no matter, the files as encoded by virus's suggested x264 CLI encoder play wonderfully on our (STMicroelectronics) H.264 hardware decoder silicon. And since that is what the boss wanted, I have achieved success. Thank you, people, for your generous and patient support of this MP4 newb.

video
26th April 2005, 18:47
Originally posted by neuron2
I installed Haali as per bond's suggestion and now I can "play" my MP4s. I say that in quotes because playing 1920x1088 on a slow laptop is rather a pointless thing, it turns out, as the frame rate is terrible. :(


My banias 1.4GHz note can do at least 8-12fps in case of 1080p with mplayer/linux with frame drops. little bit jerky, but playable ;)

on the other hand it's great that you have finally succeded with one encoding tool.

russo121
26th April 2005, 19:00
Originally posted by neuron2
I installed Haali as per bond's suggestion and now I can "play" my MP4s. I say that in quotes because playing 1920x1088 on a slow laptop is rather a pointless thing, it turns out, as the frame rate is terrible. :(

But no matter, the files as encoded by virus's suggested x264 CLI encoder play wonderfully on our (STMicroelectronics) H.264 hardware decoder silicon. And since that is what the boss wanted, I have achieved success. Thank you, people, for your generous and patient support of this MP4 newb.

You can ask for a raise now :D

Guest
26th April 2005, 19:00
I'll try it on my AMD 64FX-55 when I get home. :)

Guest
26th April 2005, 19:01
Originally posted by russo121
You can ask for a raise now LOL. I already did that...successfully. ;)

virus
27th April 2005, 00:24
...I believe we have found a new x264 fan? ;)

Originally posted by neuron2
But no matter, the files as encoded by virus's suggested x264 CLI encoder play wonderfully on our (STMicroelectronics) H.264 hardware decoder silicon.
I was expecting you had to decode your stream on a hardware platform... currently there's probably no processor out there that can decode 1080p @ 30 fps without framedropping (or maybe just the most powerful ones, but I sincerely doubt that).

Originally posted by neuron2
Then I got MPlayer from SharkTooth's link. When I open either of the above using MPlayer, it says "Cannot render the file".
That's really strange.
Both raw H.264 and MP4 use to work ok with MPlayer. But that "cannot render" message for both formats makes me think that maybe the output subsystem failed to open an output window for some reason (too large for your configuration?). Not sure though.

Does MPlayer print out something like "H264-ES file format detected" (for raw) or "QuickTime/MOV file format detected" (for MP4)? Does it produce a line like:
VIDEO: [avc1] <resolution> 24bpp <framerate> fps ...?
If you're interested in getting MPlayer to work, maybe you can try with a smaller resolution to see what happens.

EDIT: I've just tried this: "mplayer foreman.mp4 -vf scale=1920:1570" and it worked. But the video before resize is just 352x288 so I'm definitely cheating :D
Maybe there are really some issues when decoding some specific HD streams with MPlayer... unfortunately there are not many people testing AVC at 1080p currently ;)

Guest
27th April 2005, 01:10
@virus

All my problems are resolved. It was lack of an MP4 splitter combined with an old beta of Avisynth on my laptop. I can "play" them now with MPlayer, etc., but at a low frame rate. Thanks again for your assistance.

Richard Berg
27th April 2005, 06:57
Congrats on the quick MP4 learning curve; had to experience it myself recently. Needless to say I can't wait until Avery supports it in Virtualdub...

Anyway, I'm still interested to hear what framerate your FX-55 is capable of.

stephanV
27th April 2005, 08:01
Originally posted by Richard Berg
Congrats on the quick MP4 learning curve; had to experience it myself recently. Needless to say I can't wait until Avery supports it in Virtualdub...

Hihi... that wont happen. :)

Guest
27th April 2005, 13:47
Originally posted by Richard Berg
Anyway, I'm still interested to hear what framerate your FX-55 is capable of. I haven't done the MP4 stuff on the FX yet but to give an idea, I can preview a standard NTSC VOB (MPEG2 decoding obviously) in DGIndex at 150 fps.

Needless to say I can't wait until Avery supports it [MP4] in Virtualdub... Aren't there VFW codecs available? I must be misunderstanding your point.

DeeGee
27th April 2005, 15:29
He's talking about the .mp4 container format, not mpeg4 encoding.

[edit] I Don't really believe any normal computer processor can still decode 1080p material without framedrops. My own machine has just enough power to decode some music videos I just encoded into 704x400x50fps avc. thats about ~14 Megapixels/second. 1080p at 25 fps is ~51 Megapixels/second...

So unless my "old" Athlon XP 3200+ is only 1/4 of the speed of newest processors there's no hope.

Richard Berg
27th April 2005, 19:11
Yes, I was referring to support for the MP4 container.

the files as encoded by virus's suggested x264 CLI encoder play wonderfully on our (STMicroelectronics) H.264 hardware decoder silicon.
If I wrote a VDub fork that made this process easy, would you send me some chips? :D

Guest
27th April 2005, 19:21
Be patient; they'll be in HD-DVD players pretty soon.

SeeMoreDigital
27th April 2005, 21:15
Originally posted by neuron2
Be patient; they'll be in HD-DVD players pretty soon. Agreed :)

Hopefully the AVC chip-sets in these HD-DVD players will support playback of 1080/88p content and not just the standard 1080/88i.

That said, if 1080/88p follows the same rule-of-thumb as 720p, one would assume it will have to support up to 60fps!


Cheers

video
27th April 2005, 22:16
Originally posted by SeeMoreDigital
Hopefully the AVC chip-sets in these HD-DVD players will support playback of 1080/88p content and not just the standard 1080/88i.

Let's see first fully standard compliant mpeg4 ASP chips :D

Richard Berg
28th April 2005, 01:09
Be patient; they'll be in HD-DVD players pretty soon.
Having hardware decoders in STBs is not good enough -- all of us HTPC folks will need them on PCI-E cards. Until you confirm that your FX-55 is able to play back the stream without dropped frames, anyway ;)

Guest
28th April 2005, 04:43
We have devices on our roadmap that will be ideal for that application. If there is a demand someone will make the cards.

ivan_alias
29th April 2005, 18:13
We have devices on our roadmap that will be ideal for that application. If there is a demand someone will make the cards.

Well Sigma's Xcard was in my opinion a couple of years too late to really do well, most PCs were already capable of playing back ASP by the time it was released.

AVC is another matter, especially HD AVC. So a PCI based enc/dec card would be a really nice thing to have :) Put one of those in a Epia SP type box and you have a prety neat STB or ultra silent low power video encoding machine. Very nice :)

lexor
30th April 2005, 00:53
Originally posted by neuron2
Be patient; they'll be in HD-DVD players pretty soon.

last I heard those are gonna enter market at about $900 USD, it's doubtfull wide public access will become reality sooner than in a year or more (I'm thinking more).