View Full Version : H.264 support in OS2008. How ?
anidel
12-20-2007, 01:35 PM
I've tried a few searches about H264 on the forum, but wasn't able to find anything useful.
How this is supposed to be supported ?
I've just went to dl.tv and dowloaded an H.264 video from there (specifically episode 208, 172Mb).
It's a .mov file, so file manager doesn't know how to handle it. I've told it to use Media Player, but this one failed telling me that there is no codec for it.
I've also renamed the file from .MOV to .AVI but the problem was the same.
What kind of H.264 are supported ?
should I get the iPod/PSP format instead ?
keloid
12-20-2007, 01:38 PM
on a seperate but similar note, Im trying to find out whether the n800 supports h264 in a nsv container...
N770-Freak
12-20-2007, 01:48 PM
Isn't SIP Video transferred through H.264? Perhaps only the messenger application uses this codec. Someone should try that.
anidel
12-20-2007, 01:51 PM
Ok, the iPod/PSP format worked out of the box.
I am very confused about the codec naming here...
Moonshine
12-20-2007, 01:51 PM
Isn't SIP Video transferred through H.264? Perhaps only the messenger application uses this codec. Someone should try that.
Well OS2008 SIP supports H263 and H263+ which are very different from H264. H264 video is often HD which would be beyond what the tablets could handle.
anidel
12-20-2007, 01:54 PM
As for the few bits of info on codecs that I have, I would say that HD is encoded in H.264 at high settings.
N770-Freak
12-20-2007, 01:55 PM
Well OS2008 SIP supports H263 and H263+ which are very different from H264. H264 video is often HD which would be beyond what the tablets could handle.
Ok, thanks for this clarification!
keloid
12-20-2007, 02:02 PM
so is the general consensus that mplayer probably wont be able to play h264 in an nsv container due to lack of resources?
if this is true, this is a deal breaker for me (as to whether i purchase the n800 or not)!
anidel
12-20-2007, 02:04 PM
As soon as everything is up and working on the Maemo side, I'll try that too.. If I'll have time! Holidays are approaching.. remember me to do that test.
keloid
12-20-2007, 02:07 PM
thanks, would appreciate it greatly!
so is the general consensus that mplayer probably wont be able to play h264 in an nsv container due to lack of resources?
if this is true, this is a deal breaker for me (as to whether i purchase the n800 or not)!
As of now, mplayer certainly can't do DSP accelerated H.264 playback - and it won't any time soon unless the internal media player grows a shared OMAP DSP H.264 library. Writing your own takes time, and it is beyond the power of the mplayer authors or porters to purchase a OMAP DSP library, while Nokia can do so, if the rights aren't already included...
sjgadsby
12-20-2007, 03:41 PM
It's a .mov file, so file manager doesn't know how to handle it.
Well, that would be a QuickTime file. The video inside the QuickTime container may be MPEG-4 Part 10, but there's (sadly) not much support for the QuickTime container format in Linux, so the tablets don't know what to do with it.
Renaming it to AVI won't help, as that extension is for a completely different (and much less sophisticated) container format. It's like renaming a Word .doc file to .txt and expecting FBReader accept that.
What kind of H.264 are supported ?
I haven't played much with H.264 in OS2008 yet, but it should support H.264 in a program stream. (And in a transport stream for streaming purposes.) It certainly supports the MP4 container format. Very likely, it will also support H.264 inside an AVI, just because so many people refuse to let AVI's bloated corpse rest in piece.
Anyway, look for some .mp4 files. Apple-ish .m4v files will also work.
St00pidChicken
02-18-2008, 02:50 PM
I see that you said .m4v files are supported. While I agree they are supported from the standpoint the N800 opens them and tries to play them, it's not doing a very good job with the files I have. Some will play but are EXTREMELY choppy, while others will make it hang completely. The files I'm trying to use are either those which I encoded for my iPod, or those that are available as video podcasts like The Discovery Channel.
I guess it could be a problem with the encoding settings being too high, but it boggles my mind that the iPod can play them well while the N800 chokes.
For my personal movies, I *can* re-encode them to something that works well on the N800 (xvid, 560x330 @ 24fps, 700kbps, MP3 works VERY well), but I'd rather not have to go through that if I don't have to. For video podcasts, there is nothing I can do... it will be whatever they encode it for, and iPods are king right now, so that will be the de facto format for most I would think (hopefully that changes to something like xvid AVIs.
Any help in figuring this out would be GREATLY appreciated.
Edward IV
02-27-2008, 02:17 AM
I have some .mp4 files with H.264 video and AAC audio that was encoded for the PSP in mind. So rather than having a resolution equivalent to 480p, the resolution is 480x272. When I try to play it with the built-in media player, it refuses to play saying that the file format is not supported.
With MPlayer, the file could play but it was very choppy. Here's the file report from MPlayer:
MPlayer 1.0rc1-maemo.25.n8x0 (C) 2000-2006 MPlayer Team
CPU: ARM
Internet Tablet OS version: RX-34+RX-44_2008SE_2.2007.50-2_PR_MR0
Menu inited: /etc/mplayer/menu.conf
Playing /media/mmc1/Videos/[Conclave-Mendoi]_Mobile_Suit_Gundam_00_-_01_[480x272_H.264_AAC][D1326F04].mp4.
Quicktime/MOV file format detected.
VIDEO: [avc1] 480x272 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
[nokia770] Nokia N800 hardware detected
[***] auto-open
[***] Init
================================================== ========================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
================================================== ========================
================================================== ========================
Trying to force audio codec driver family dspmp3...
Trying to force audio codec driver family libmad...
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
AUDIO: 48000 Hz, 2 ch, s16le, 66.4 kbit/4.32% (ratio: 8297->192000)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder)
================================================== ========================
[AO ESD] latency: [server: 0.28s, net: 0.00s] (adjust 0.28s)
AO: [esd] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 480 x 272 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [nokia770] 480x272 => 480x272 Planar YV12 [fs] [zoom]
[nokia770] Using ARM JIT YUV420 scaler (quality=2) to scale 480x272 => 480x272
Exiting... (Quit)
dchao
02-27-2008, 04:31 AM
I am also playing with H264/AVC. As I don't want to go back to MPEG-4 ASP or Divx.
For certain, there is no way the N810 can keep up with PSP files encoded using level 3 main profile. You must re-encode.
I have some success with 400x240 resolution and let the LCD h/w scaler do the image doubling. For audio, HE-AAC at 64Kbps. You want to give all the processor power to handle the h264 decoding, which is most time consuming.
Right now I am encoding my movies using level 1.2 baseline profile, and doing a 2-pass encoding. But I have some problem with the 2-pass encoding, the max video bit rate produced is still too high for the N810 to handle, I tried to lower the level to 1.1, but the built-in player won't accept that profile.
From what I have observed so far. With audio set to 64Kbps. If the video bit rate reaches above 450Kbps, you are starting to drop frames, and the video will look choppy. So I need to play with my encoder and to put a constraint on the output bit rate. If I can do that, then I think I can produce very good quality AVC video, much better quality than MPEG-4 ASP.
Johnx
02-27-2008, 08:54 AM
Switching the audio to mp3 will probably give you a bit of headroom for video, as mp3 can be handled on the DSP or through a highly optimized decoder on the CPU.
dchao
02-28-2008, 04:02 AM
Switching the audio to mp3 will probably give you a bit of headroom for video, as mp3 can be handled on the DSP or through a highly optimized decoder on the CPU.
I thought that was a good idea. I remembered when I was playing with the different settings, a video with no audio track got the smoothest playback. And as soon as I added the AAC audio back, the video started to get choppy. Maybe AAC is taking too much decoding time away from the CPU?
So if the h/w can decode mp3, we should make the mp3 the default sound track.
So I used MP4BOX to mux a H264 video stream with an mp3 audio stream and output to a MP4 container. But the default media player did not like the audio stream. I checked .MP4 file with GSpot, it had a 4cc <mp4a:MPEG-1> audio codec (which I believe it is correct).
Looks like the OS2008 just doesn't support mp3 inside the .MP4 container.
Does anyone know how to play mp3 inside a MP4 container on the N810?
sjgadsby
02-28-2008, 08:32 AM
Looks like the OS2008 just doesn't support mp3 inside the .MP4 container.
Does anyone know how to play mp3 inside a MP4 container on the N810?
MPEG-1 Layer 3 isn't valid inside an MPEG-4 file. There are tools that will create such beasties, sure, and there are pleanty of them in the wild, but a player that follows specs won't grok them.
That said, have you tried MPlayer? It might play your files.
GeneralAntilles
02-28-2008, 08:36 AM
MPEG-2 Layer 3 isn't valid inside an MPEG-4 file. There are tools that will create such beasties, sure, and there are pleanty of them in the wild, but a player that follows specs won't grok them.
h.264 + mp3 = .avi
dchao
02-28-2008, 05:53 PM
Here is an wiki article on the container formats.
Comparison of container formats (http://en.wikipedia.org/wiki/Comparison_of_container_formats)
Highlights:
h264 + mp3 -> .avi = problematic
.mp4 should support mpeg1 layer3 audio, but I agree, many implementations do not (I think Xbox is one of them) (edit: just tried this beasty with QT and PS3, no go either! But VLC and MPlayers are fine)
I haven't tried mplayer yet, because my first attempt is to get the h264/avc to play on the out-of-box N810 media player. A few posts up, sevo said the mplayer did not support DSP accelerated H.264 playback yet. So I am trying not to use it fearing it will give me worse performance.
dchao
02-28-2008, 06:21 PM
My current settings (so far) for generating h264/avc videos that works pretty well.
I use 2-pass encoding.
Profile: Level 1.2 Baseline (No CABAC, No BFrames, Ref Frames=2, Mixed R-Frames)
(Note: If you are still having choppy video, you could try 1 Ref Frame with no mixed R-frames to trade image quality for faster decoding speed)
Resolution: For HD I use 400:224, for SD I use 360x240 (I crop to maintain AR)
Frame Rate: 24 fps (For 30 fps source, TDecimate to 24 fps)
Video Bitrate: Ave 128 Kbps
Audio: 64kb/s HE-AAC or AAC-LC (Can't get mp3 to play inside .mp4 container, otherwise, I think I can play 128kb/s mp3 audio with video, as mp3 is far simpler to decode)
sashabe
03-08-2008, 08:35 AM
On vixy.net/rawvideo you can download Youtube videos without converting at all. They come in H.264 format+AAC for audio, with resolution mostly 320x240 and bitrate ~320kbps. All you need then is to rename the file from getvideo.php to *.mp4. The quality is way better compared to "old" FLV videos. However, some are a bit choppy in default Mediaplayer (but playable anyway), and completely not watchable in Mplayer (though it tries to start playback). For now it's a comfortable method to get Youtube videos on N8*0 without additional players.
directore
03-17-2008, 12:05 AM
I have no problem converting videos for n800 on my mac. Used QTP for a while now switched to Visual Hub, nice, quick and relatively flexible. The quality is somewhat better than what Nokia PC converter generates, the advantage is much much smaller files. For example I'm watching now "No country for old men" 30fps, 380kbps h264, 400x174, AAC stereo 128k, 2+ hours, 450MB and it plays fine. Much nicer experience watching it here than on iPod Video. Don't know about Touch. Converting it further down to 24fps would obviously be a better option.
IME generally 380kbs is the max n800 will handle with 400h resolution. Minor note to Canola2 people, some of my h264 files will not play with your player, while Nokia player has no problem whatsoever. Can provide a sample on request.
dchao
03-19-2008, 04:41 AM
Yep, the N810 will start to get choppy when the bit rate goes higher than 400Kbps. So I have modified my encoding settings again. I am reducing to 1 ref-frame and no mixed ref-frame to speed up the decoding (on the N810) a little bit more, the quality hasn't suffer too much, so it's worth it. Audio is changed down to AAC-LC to speed up decoding as well.
Video:
x264 2-pass encoding
Framerate = 23.976 fps (I use avisynth TDecimate() to reducing the frame rate)
x264 settings:
Profile: Baseline Level 1.2
(No CABAC, No B-Frames, Ref Frames=1, No Mixed R-Frames)
(Partitions: i4x4,p4x4,p8x8,b8x8)
Max Bitrate = 384Kbps (try to constraint the bitrate to below 400kbps, N810 can deal with occassional peak to above 400 with this baseline profile)
Ave Bitrate = 192KBps (This will determine the final file size)
Audio:
AAC-LC 96/128 kbps
ben76
03-20-2008, 12:02 PM
dchao,
What tool are you using to do your h.264 coversions? thanks
directore
03-21-2008, 01:04 AM
After further experimenting I'm not longer so sure. Here is what I think the current limits are (n800, os2008) for h264 encoded video in mp4 enclosures.
Max size limits, 400 by 240.
(that means your 3:2 video should be encoded as 360x240, while 16:9 400x224 and 2.35:1 400x176). Whatever you do make sure that both dimensions are divisible by 16, any other number dramatically degrades codec performance). To be on the safe side you could use 32 but I have not tested it.
With 16-divisable media size, I see no stutter* on n800 even up to 600kbps. n810 should be the same I told below. Also with 600kbps your file will be smaller than what the best quality in Nokia PC converter generates (800kbps), but this being h264 (as opposed to MPEG4 in Nokia converter) will give you perceivably better video, don't expect miracles though.
600kbps above is for 2.35:1, 24/25fps media, 30fps or fuller aspect ratios will likely stutter like hell at 600kbps. Just throttle it down a bit and see. 300kbps should always work fine.
----
* with non-16-divisible media Nokia codec starts stumbling already above 300kbps regardless of anything and you will see some artifacts.
GeneralAntilles
03-21-2008, 01:07 AM
n810 should be even better.
Uh, why? :\
directore
03-21-2008, 01:16 AM
faster clock I understand.
GeneralAntilles
03-21-2008, 01:35 AM
faster clock I understand.
Yeah—no.
For all intents and purposes, the guts of the N800 and the N810 are identical.
dchao
03-21-2008, 06:45 PM
dchao,
What tool are you using to do your h.264 coversions? thanks
I use RipBot264, under the hood, it uses x264 encoder, ffdshow and avisynth.... Most files are included in the zip file, except ffdshow and avisynth
http://forum.doom9.org/showthread.php?t=127611
dchao
03-21-2008, 07:11 PM
With 16-divisable media size, I see no stutter* on n800 even up to 600kbps.
I can't get my N810 to play any h264 video with much higher than a video bit rate of 450Kbps. Is your 600Kbps a combined video + audio bit rate?
Have you turn off many settings in order to achieve the fast decoing speed? Mind you, if you turn off everything, you are getting Divx/Mpeg4ASP quality video, which is what the Nokia ITVC does anyway)
Another point, if you generate a h264 file with an average bit rate of 600Kbps, without any constraint on max bit rate, the video bitrate will peak well over 1000Kbps (with variable bitrate encoding). This type of bit rate is going to choke the Nokia N8x0 to death. If you are setting a constant bitrate of 600Kbps, then you are producing unneccessary large file size, you could have the same video at variable bitrate at half of the size and the same quality.
directore
03-21-2008, 11:48 PM
Download this http://rapidshare.com/files/101387677/No.mp4.html
and see how it plays on your n8x0. It's 600kbps.H264/96kbps44.1kstereoAAC that plays fine on my n800 (assuming nothing significant runs on it at the same time).
I'm using Visual Hub - see the screen dump below. The playback shows occasional glitches mostly on key frames when too many of them are too close to each other I believe (your peak rates I assume), but that doesn't bother me, good tradeoff quality, size vs occasional glitches. Note this is a 3rd generation copy so the quality is a tiny bit lower than usual.
As you can see in the attachment I have access to low level codec options but other than experimenting one day with anamorphic encoding I'm way too lazy to play with them.
In a way of explanation, I'm fooling with video on n800 despite the fact that UI and PC integration on iPods is far far superior simply because I find watching any video on iPod classic screen almost unacceptable - screen size issue.
---
Note added later - Here is another video for those wanting to test their video converting skills. http://rapidshare.com/files/101608397/Like_a_boy.mp4 See if you can convert it properly w/o losing too much in quality - the video (1st generation which shows) plays fine on n800 as is but glitches are evident. In any event this is one of the best music videos I've seen in recent times. Enjoy.
seiichiro0185
05-05-2008, 02:42 PM
Since the tools mentioned in this thread are for Win/Mac and I didn't find a easy to use tool for linux I wrote a short script for converting any (mplayer playable) video-source to h264/aac mp4 for the tablet. Have a look here: http://seiichiro0185.xen-host.de/doku.php/n800:mp4encoding (and thanks dchao for the codec settings)
den_lim
05-14-2008, 08:28 AM
I tried using ffmpegx to convert some anime to psp h.264 format (in the selection). It works well with mplayer but not the built-in player. Doesn't work in canola2 either.
benny1967
07-08-2008, 12:57 AM
I tried to encode h.264 before I read this thread; to do this, I changed video encoding options in an old script I had used for the 770, so basically the resulting file was an *.avi with h.264 video and MP3 audio. Plays well on the desktop.
Diablo's built-in media player says "file format not supported".
Reading here now that MP3+h.264 is problematic - what do you think (or know ;) ): Do I get this error because I used MP3 audio? (Even though it's avi, so we're not talking about a true mp4 container?) Or would you rather assume there's something else wrong? Any information about this? (Isn't it a shame we have to gather information about what plays and what doesn't this way?)
benny1967
07-15-2008, 04:09 AM
OK, just to share my wisdom: After some more experiments I ditched AVI, wrote a new script that encodes the video into an *.mp4 container and found that
a) you need to use the nocabac option in your encoder
b) you could - theoretically - use b-frames, but the playback quality at least in the built-in player is absolutely miserable then (it doesn't keep a constant speed.... gets sloooow and fast and sloooow and fast ...), so you better set number of b-frames to 0.
c) i use a video bitrate of 300, 352x208@25fps and an audio bitrate of 64 (aac) ATM. I think I could even reduce the bitrate, the quality is perfect for me.
tools: mencoder for encoding, mp4creator for muxing rsw .aac/.h264-files into an mp4.
EDIT: Works fine in built-in player, that is. MPlayer stutters like hell and uses much more CPU, even if I go further down with audio and video br.
benny1967
12-22-2008, 10:37 AM
Yep, the N810 will start to get choppy when the bit rate goes higher than 400Kbps. So I have modified my encoding settings again. I am reducing to 1 ref-frame and no mixed ref-frame to speed up the decoding (on the N810) a little bit more, the quality hasn't suffer too much, so it's worth it. Audio is changed down to AAC-LC to speed up decoding as well.
Video:
x264 2-pass encoding
Framerate = 23.976 fps (I use avisynth TDecimate() to reducing the frame rate)
x264 settings:
Profile: Baseline Level 1.2
(No CABAC, No B-Frames, Ref Frames=1, No Mixed R-Frames)
(Partitions: i4x4,p4x4,p8x8,b8x8)
Max Bitrate = 384Kbps (try to constraint the bitrate to below 400kbps, N810 can deal with occassional peak to above 400 with this baseline profile)
Ave Bitrate = 192KBps (This will determine the final file size)
Audio:
AAC-LC 96/128 kbps
I use mencoder and wondered how to translate this to -x264encopts on the command line. Recently I found a Finnish site (http://jari.ylimainen.fi/arkisto/2007/05/10/avidemux-ja-n95/) that deals with encoding for the N95. Among the comments was something I could copy&paste, so now my (working) mencoder setup is:
mencoder -dvd-device $DVDDEVICE dvd://$TITLE -aid $AID -vf crop=$WIDTH:$HEIGHT \
-nosound \
-vf dsize=15/9,scale=352:208,eq=2,harddup \
-ovc x264 -x264encopts bitrate=300:nocabac:partitions=p8×8,b8×8,i4×4:leve l_idc=12:frameref=2:me=umh:bframes=0:nodeblock:now eightb:nomixed_refs:pass=1:turbo \
-sid 0 \
-of rawvideo -o /dev/null
mencoder -dvd-device $DVDDEVICE dvd://$TITLE -aid $AID -vf crop=$WIDTH:$HEIGHT \
-nosound \
-vf dsize=15/9,scale=352:208,eq=2,harddup \
-ovc x264 -x264encopts bitrate=300:nocabac:partitions=p8×8,b8×8,i4×4:leve l_idc=12:frameref=2:me=umh:bframes=0:nodeblock:now eightb:nomixed_refs:pass=2 \
-sid 0 \
-of rawvideo -o N800.264
mencoder -dvd-device $DVDDEVICE dvd://$TITLE -aid $AID \
-ovc copy \
-oac faac -faacopts br=40:mpeg=4:object=2 \
-af resample=32000:0:2,volume=4:1 \
-of rawaudio -o N800.aac
rm N800.mp4
mp4creator -create=N800.aac -H N800.mp4
mp4creator -create=N800.264 -interleave -rate=25 -H -O N800.mp4
Plays very nicely on both the built in player and mplayer. Doesn't stress CPU a lot.
I used to have this before:
bitrate=300:nocabac:partitions=i4x4,p4x4,p8x8,i8x8 :level_idc=13:frameref=3:me=umh:bframes=0
Note that this does not include nomixed_refs (this seems to be important) and the partitions are different. I have no idea what all this is, but while the file size is almost exactly the same in both variants, the one I use now needs much less CPU power when decoding. (Scenes that used to consume ~70-75% CPU now play at ~45-50%.)
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.