Jump to content

H.264 High profile video that _plays_


Guest SilentMobius
 Share

Recommended Posts

Guest SilentMobius

So I was watching logcat while messing with the built in youtube app and noticed the following lines:

I/OMXCodec(   88): [OMX.Nvidia.h264.decode] AVC profile = 100 (High), level = 31

I/OMXCodec(   88): [OMX.Nvidia.h264.decode] allocating 10 buffers of size 1566720 on input port

I/OMXCodec(   88): [OMX.Nvidia.h264.decode] allocating 9 buffers from a native window of size 1382400 on output port

And I thought "High profile? the Transformer just refuses to play that, surely"

The video stream was also listed to I grabbed it and lo and behold it does indeed look like it thinks it's high profile

The data is from here http://v24.lscache3.googlevideo.com/videop...p=youtube_gdata

And here is the video I grabbed: http://dl.dropbox.com/u/6553908/tst.mp4

* Movie Info *

Timescale 600 - Duration 00:00:36.458

Fragmented File no - 2 track(s)

File Brand mp42 - version 0

Created: GMT Wed May 19 20:58:57 2010

File has root IOD

Scene PL 0xff - Graphics PL 0xff - OD PL 0xff

Visual PL: AVC/H264 Profile (0x15)

Audio PL: AAC Profile @ Level 2 (0x29)

No streams included in root OD

iTunes Info:

Track # 1 Info - TrackID 1 - TimeScale 44100 - Duration 00:00:36.455

Media Info: Language "Undetermined" - Type "soun:mp4a" - 1570 samples

MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40

MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 44100

Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 24000 - Duration 00:00:36.458

Media Info: Language "Undetermined" - Type "vide:avc1" - 875 samples

MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21

AVC/H264 Video - Visual Size 1280 x 720 - Profile High @ Level 3.1

NAL Unit length bits: 16

Pixel Aspect Ratio 1:1 - Indicated track size 1280 x 720

Synchronized on stream 1

The file is 10,190,549B for 36 sec of footage so that's roughly 2MB/s for audio and video.

What I wan't to know is why this just plays when the default player chokes on most high profile files, I thought the player was checking the profile but it would seem not anyone know of any tools that are better than MP4Box that can tell us more about the options used to create this?

Edited by SilentMobius
Link to comment
Share on other sites

Guest Deus_ex11

High profile does play ok but at 3.1 and at a lower bitrate with the stock player. The Youtube 720p video is the same high 3.1 but it doesn't play without dropping frames probably because the Youtube app is using a streaming decoder.

I'm beginning to think the codecs used are not using acceleration at all, as the cpu is running higher than if it was. If the codecs were optimised it could probably play high 4.0.

Link to comment
Share on other sites

Guest SilentMobius
High profile does play ok but at 3.1 and at a lower bitrate with the stock player. The Youtube 720p video is the same high 3.1 but it doesn't play without dropping frames probably because the Youtube app is using a streaming decoder.

I'm beginning to think the codecs used are not using acceleration at all, as the cpu is running higher than if it was. If the codecs were optimised it could probably play high 4.0.

The killer appears to be the number of reference frames. Content with 4 or 6 reference frames completely fails to play

Link to comment
Share on other sites

  • 2 weeks later...
Guest SilentMobius

F.Y.I the 3.1 update seems to have worked wonders, while I haven't tested [email protected](.1) I can now play the low bandwidth HD streams from iPlayer which are [email protected] that is 6 reference frames, CABAC, B-frames, the works.

Still no AVI/MKV container, but that was never going to happen in 3.1.

This means that it should be easy for the BBC to do a proper iPlayer app for android that doesn't need flash!

Link to comment
Share on other sites

Guest keef319

So what program works best for converting MKV files to a format that plays perfectly on the stock player?

Handbrake?

And which profile/preset?

Link to comment
Share on other sites

Guest KaCeX
So what program works best for converting MKV files to a format that plays perfectly on the stock player?

Handbrake?

And which profile/preset?

+1

I tried recoding MKV to AVI (AVI xvid or divx seems to play just fine on the Transformer), but there are high losses on quality when recoding, I used SUPER c but Im a noob in these kind of things, some suggestions for best 720p encoding would be nice.

Link to comment
Share on other sites

Guest SilentMobius
+1

I tried recoding MKV to AVI (AVI xvid or divx seems to play just fine on the Transformer), but there are high losses on quality when recoding, I used SUPER c but Im a noob in these kind of things, some suggestions for best 720p encoding would be nice.

You don't need to re-encode just re-mux I use ffmpeg with the following:

ffmpeg -i inputfile.mkv -acodec copy -vcodec copy outputfile.mp4

Although.... I'm seeing matroska handling code in AOSP... mediascanner doesn't recognise the file extension but I wonder if the container parser works...

Hmmm, interesting, video in a matroska container that is only renamed seem to still be parsed. Try renaming your files when you transfer them to something like video_file.mkv.mp4 (so you don't forget what they really are) so the mediascanner can actually see them. Hmmm the gallery app seems to object for some reason, but if I launch the native mediaplayer from a file manager it seems to work just fine.

I wonder if this is a full matroska parser of just the limited version they need for WebM

Edited by SilentMobius
Link to comment
Share on other sites

Guest SilentMobius
Wow most of that went right over my head!! LMAO!!

Ok re-encode is when you flatten out a piece of video or audio back out into raw frames and the encode what you get out in a different way.

This assumes you're talking about a video stream (E.G. h.264/AVC) and/or an audio stream (E.G AAC).

Muxing (Multiplexing) is the action of combining some streams (often just 1 audio and 1 video) into a container (E.G. AVI,MP4,MKV) this doesn't change the streams just the way the streams are reprisented. The command-line options for ffmpeg are just:

ffmpeg -i inputfile.mkv (read this file) -acodec copy (copy the audio stream) -vcodec copy (copy the video stream) outputfile.mp4 (write it out into this file and use the file extension to decide which container to use)

The rest is me speculating on Honeycomb already having partial MKV(matroska) container support

Edited by SilentMobius
Link to comment
Share on other sites

Guest SilentMobius

Whoa, yeah looks like MKV support is in, but the gallery and mediascanner aren't plumbed in to recognise file with the .mkv file extension.

I just tested 2 [email protected]/AAC MKV clips and both played file when the filename had +".mp4" tacked on the end

Link to comment
Share on other sites

Guest keef319

I can't even seem to copy an MKV file across to my TF. It kills windows explorer.

Tried copying to the TF itself and the microSD card...

:D

EDIT: It works if you MOVE it, rather than COPY.

I tried an mkv file with .mp4 tacked on the end, still wouldn't play...

Edited by keef319
Link to comment
Share on other sites

Guest SilentMobius
I can't even seem to copy an MKV file across to my TF. It kills windows explorer.

Tried copying to the TF itself and the microSD card...

:D

EDIT: It works if you MOVE it, rather than COPY.

I tried an mkv file with .mp4 tacked on the end, still wouldn't play...

I don't use MTP (the protocol windows uses by default to transfer files via USB on Honeycomb)

I use rsync over wi-fi or "adb push" so I never suffer from transfer problems.

After that, what app did you use to try and play the file? as I said the stock gallery has issues. I use a file manager (I have several installed it doesn't matter which) navigate to the file and tap it. This brings up the "Complete action using:" dialogue and I select "Video player" (Which is the stock player)

Maybe I can finish modifying the old gallery to just be a video browser, seeing as we don't have the Honeycomb source.

Link to comment
Share on other sites

Guest keef319
After that, what app did you use to try and play the file? as I said the stock gallery has issues. I use a file manager (I have several installed it doesn't matter which) navigate to the file and tap it. This brings up the "Complete action using:" dialogue and I select "Video player" (Which is the stock player)

Tried various methods including file manager. With stock player it says " Sorry, this video can't be played".

Moboplayer will only play it in soft decode mode which is awful.

I've played some 1280x720 mp4's with no issues. It's just a pain having to wait for a huge file to convert with Handbrake

Link to comment
Share on other sites

Guest SilentMobius
Tried various methods including file manager. With stock player it says " Sorry, this video can't be played".

Moboplayer will only play it in soft decode mode which is awful.

I've played some 1280x720 mp4's with no issues. It's just a pain having to wait for a huge file to convert with Handbrake

Could you run mediainfo on the file and post the results. A windows binary of mediainfo is available here http://mediainfo.sourceforge.net/en/Download/Windows

Link to comment
Share on other sites

Guest dj dvant
Could you run mediainfo on the file and post the results. A windows binary of mediainfo is available here http://mediainfo.sourceforge.net/en/Download/Windows

I seem to have struck gold (for me at least). I have created a script which converts my m2ts (h.264/ac3) files to mp4 (h.264/aac). The key setting when muxing using MP4Box (gpac) is to change the interleaving settings to 50msec. Tools required: linux, ffmpeg, libfaac, gpac, tsMuxeR.

run the script in the directory with the m2ts file like this:

m2ts2mp4.sh video.m2ts

The output will be video.mp4

Use the script at your own peril... Hope this helps

Script is now attached. While interleaving seems to make a big improvement, there is still the problem of the video skipping forward and pausing while the audio continues to play... although the frequency seems to be much reduced.

m2ts2mp4.sh.tar.gz

Edited by dj dvant
Link to comment
Share on other sites

Guest SilentMobius
I seem to have struck gold (for me at least). I have created a script which converts my m2ts (h.264/ac3) files to mp4 (h.264/aac). The key setting when muxing using MP4Box (gpac) is to change the interleaving settings to 50msec. Tools required: linux, ffmpeg, libfaac, gpac, tsMuxeR.

run the script in the directory with the m2ts file like this:

m2ts2mp4.sh video.m2ts

The output will be video.mp4

Use the script at your own peril... Hope this helps

Very interesting, I didn't know about interleaving, I'll have to experement with that. Could you attach your script? I don't see it on your post

Link to comment
Share on other sites

Guest SilentMobius
What do I do with that MediaInfo program? :D (n00b)

Well if you downloac the command line version and run

mediainfo MY_VIDEO_FILE.mp4

I can't help you with the GUI version as I don't use GUI's if I can avoid it.

Edited by SilentMobius
Link to comment
Share on other sites

Guest keef319
Could you run mediainfo on the file and post the results. A windows binary of mediainfo is available here http://mediainfo.sourceforge.net/en/Download/Windows

Lots of info but here's the media file info of a sample mkv file. Won't play as mkv or if I tag mp4 to the end.

Video

ID : 1

Format : AVC

Format/Info : Advanced Video Codec

Format profile : [email protected]

Format settings, CABAC : Yes

Format settings, ReFrames : 4 frames

Muxing mode : Header stripping

Codec ID : V_MPEG4/ISO/AVC

Duration : 29s 446ms

Bit rate : 6 661 Kbps

Width : 1 280 pixels

Height : 544 pixels

Display aspect ratio : 2.35:1

Frame rate : 23.976 fps

Color space : YUV

Chroma subsampling : 4:2:0

Bit depth : 8 bits

Scan type : Progressive

Bits/(Pixel*Frame) : 0.399

Stream size : 23.4 MiB (89%)

Language : English

Audio

ID : 2

Format : AC-3

Format/Info : Audio Coding 3

Mode extension : CM (complete main)

Muxing mode : Header stripping

Codec ID : A_AC3

Duration : 29s 453ms

Bit rate mode : Constant

Bit rate : 640 Kbps

Channel(s) : 6 channels

Channel positions : Front: L C R, Side: L R, LFE

Sampling rate : 48.0 KHz

Bit depth : 16 bits

Compression mode : Lossy

Delay relative to video : 13ms

Stream size : 2.25 MiB (9%)

Language : English

Link to comment
Share on other sites

Guest SilentMobius
Bit rate : 6 661 Kbps

Format : AC-3

High bit rate (for a mobile device) and AC3 audio (that Honeycomb/Tegra2 can't handle) That thing must be massive, it would be 3 times the size of the stuff I've been looking at: that that is ~900mb for a 1hr TV episode so yours would be 2.7G per hour?

Link to comment
Share on other sites

Guest keef319
High bit rate (for a mobile device) and AC3 audio (that Honeycomb/Tegra2 can't handle) That thing must be massive, it would be 3 times the size of the stuff I've been looking at: that that is ~900mb for a 1hr TV episode so yours would be 2.7G per hour?

Not quite. That movie was 2.35GB for 1hr 45mins.

Link to comment
Share on other sites

Guest SilentMobius
Not quite. That movie was 2.35GB for 1hr 45mins.

Fair enough, anyway I'm not sure if its the bitrate thats killing it or the AC3 audio, either way that is never going to play even if you change the container. You might be able to get away with just reencoding the audio (and you might as well change the container if you're doing that)

Link to comment
Share on other sites

Guest ryukent

The bitrate is too high for high profile to work.

Lots of info but here's the media file info of a sample mkv file. Won't play as mkv or if I tag mp4 to the end.

Video

ID : 1

Format : AVC

Format/Info : Advanced Video Codec

Format profile : [email protected]

Format settings, CABAC : Yes

Format settings, ReFrames : 4 frames

Muxing mode : Header stripping

Codec ID : V_MPEG4/ISO/AVC

Duration : 29s 446ms

Bit rate : 6 661 Kbps

Width : 1 280 pixels

Height : 544 pixels

Display aspect ratio : 2.35:1

Frame rate : 23.976 fps

Color space : YUV

Chroma subsampling : 4:2:0

Bit depth : 8 bits

Scan type : Progressive

Bits/(Pixel*Frame) : 0.399

Stream size : 23.4 MiB (89%)

Language : English

Link to comment
Share on other sites

Guest keef319

Ok, here's something I did earlier from MKV to MP4 with Handbrake using these settings here http://forum.xda-developers.com/showpost.php?p=13411527

Hasn't turned out as smooth as I'd have liked, bit rate the issue again?

Video

ID : 1

Format : AVC

Format/Info : Advanced Video Codec

Format profile : [email protected]

Format settings, CABAC : Yes

Format settings, ReFrames : 4 frames

Format settings, GOP : M=1, N=49

Codec ID : avc1

Codec ID/Info : Advanced Video Coding

Duration : 50mn 15s

Bit rate mode : Variable

Bit rate : 2 714 Kbps

Width : 1 280 pixels

Height : 720 pixels

Display aspect ratio : 16:9

Frame rate mode : Variable

Frame rate : 23.976 fps

Minimum frame rate : 23.438 fps

Maximum frame rate : 24.390 fps

Color space : YUV

Chroma subsampling : 4:2:0

Bit depth : 8 bits

Scan type : Progressive

Bits/(Pixel*Frame) : 0.123

Stream size : 976 MiB (95%)

Writing library : x264 core 112

Encoding settings : cabac=1 / ref=4 / deblock=1:-2:-1 / analyse=0x3:0 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=0 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=3 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

Encoded date : UTC 2011-06-06 10:26:17

Tagged date : UTC 2011-06-06 11:48:06

Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177

Transfer characteristics : BT.709-5, BT.1361

Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.