handbrake .mp4 not working in JW Player on iOS

JHendrix wrote on 6/2/2011, 11:39 AM
I was told by longtail :

Regarding the video not working on iOS, you need to not only use HandBrake, but iDevices require some special encoding.

You need to make sure you are using H.264 Baseline Profile Level 3.0 or lower with no more than three reference frames, AAC Low Complexity Profile, and an MP4 container.

---

any tips? I thought i had the perfect workflow using handbrake

Comments

musicvid10 wrote on 6/2/2011, 12:18 PM
It is true that iOS requires baseline profile, thus a number of HB presets for Apple devices.

It would be better to post your Handbrake / Apple question with JWPlayer on the Handbrake forums.
JHendrix wrote on 6/2/2011, 1:06 PM
yeah, i went through the same thing using Adobe Media Encoder, even though it renders an mp4 there is some flag or something for it to work on iOS. quite an annoyance. gotta pay to play though, i will post back what i come up with
musicvid10 wrote on 6/2/2011, 2:20 PM
Just use the Apple Universal preset in Handbrake and it should be just fine.
JHendrix wrote on 6/2/2011, 3:24 PM
tried that and when i tested it still nothing on IPhone
amendegw wrote on 6/2/2011, 3:32 PM
First, try this: http://www.jazzythedog.com/testing/browsertest.htm

Others have told me it works on the iPhone. As I recall, I used the Handbrake "iPhone Legacy" preset to encode the video.

...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

JHendrix wrote on 6/2/2011, 4:50 PM
total weirdness...does not work (i might have to go back to Media Encoder at this rate!

in Media Encoder you can set the Level.

Since JW says it has to be 3.0 or lower i tried 3.0 and then the software would not let me set the frame size above like 640. Would be a shame if I was stuck using SDish frame sizes just to get the video to work on iOS.

Also, anyone know where the Level is set in handbrake?
JHendrix wrote on 6/3/2011, 8:20 AM
answer:

after a bit more testing it seems this is strictly a "frame size" issue? if I render at 1280x720 it wont play on my 4.2.1 iPhone (it will play on the newer ones "a4")

anyway, if i render it at 640x368 it works fine ---BUT now on the web i am stuck with a small video when full screen is invoked..

Unless you own a current generation device based on the A4 processor, your maximum resolution is 720x480@30fps or 720x576@25fps. If you plan to target iPhones prior to the 3GS or the iPod Touch prior to the 3G you'll also need to ensure you're not using b-frames.


--


another pitch for using the HTML5 tag I guess. I am using JW player but it wont serve more than one file.

musicvid10 wrote on 6/3/2011, 10:17 AM
Realizing now that you are wanting two uses for your video rather than one, and since each use has its own set of constraints and optimizations, I would render two videos, one for my phone and one for the web. I see no way to optimize one render for both.

Baseline profile is not optimized for web delivery, and Main profile will not play on a phone. I see no way to get around this, nor would I ever recommend using one file for divergent delivery systems.
JHendrix wrote on 6/3/2011, 10:31 AM
you got that right

i am talking with JW now to see how to deliver two (or more) versions using JW. if that doesn't work I might have to use the HTML5 tag (or something else)...

still researching this.
amendegw wrote on 6/3/2011, 12:29 PM
This could probably be done in javascript. I have no way to test this (so there may be all sorts of bugs in the code), but you might try something like this:

        <div id="player">
<div id='container'>
Loading the player ...</div>
<script type='text/javascript'>
var myVideo;
if (navigator.userAgent.match(/iPhone/i))
{
myVideo = '../Testing/Videos/iPhone.mp4';
} else
{
myVideo = '../Testing/Videos/AllOther.mp4';
}

jwplayer('container').setup({
flashplayer: '../JWplayer55/player.swf',
file: myVideo,
height: 400,
width: 720,
autostart: true,
});

</script>
</div>

...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

musicvid10 wrote on 6/3/2011, 12:48 PM
Many commercial sites have a "mobile" version of their pages with all the appropriate formatting for phones.
"youtube.com" and "m.youtube.com" for example (which is set up for rstp).
JHendrix wrote on 6/3/2011, 3:18 PM
JW says this works:

<script type='text/javascript' src='/jwplayer/jwplayer.js'></script>

<div id='mediaplayer'></div>

<script type="text/javascript">
jwplayer('mediaplayer').setup({
'id': 'playerID',
'width': '480',
'height': '270',
'modes': [
{type: 'html5', file: 'htmlfile.mp4'},
{type: 'flash', src: 'player.swf', file: 'flashfile.mp4'},
{type: 'download', file: 'downloadfile.mp4'}
]
});
</script>

http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/18508/jw-embedder-modes#ModeSelectionAlgorithm
amendegw wrote on 6/4/2011, 10:56 AM
JHendrix,

First, I believe that if you use the javascript you posted above, you will not be able to solve your issue of Industrial Strength browsers being able to go to full screen with good resolution as this script uses the same source file for flash, html5 & download.

So... I've done a little testing and have come up with the following webpage which should use a 1280x720 media file as the source for Flash & a 480x272 media file for iPhones. However, I have no way of testing, so somebody with an iPhone, please browse here: http://www.jazzythedog.com/testing/jwptest.html see if it works. If it does, I'll post the html/javascript.

I can test via, IE9, Firefox & Chrome and can atest that the 1280x720 Flash play works fine with these browsers.

...Jerry

PS: Did I have mention, you did a helluva rendition of the "Star Spangled Banner"? [grin]

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

amendegw wrote on 6/4/2011, 5:40 PM
Okay, my daughter's boyfriend tested this on his iPhone & it works. Here's the html.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
JW Player Browser Test
<script src="../JWPlayer55/jwplayer.js" type="text/javascript"></script>
<style type="text/css">
div.divmain
{
background-color: black;
width: 1024px;
height: 768px;
margin: 0 auto;
}

#container_wrapper
{
text-align: center;
}
</style>
</head>
<body style="background-color: #000000;">
<div class="divmain">
<div style="text-align: center;">
<h2 style="color: orange; font-size:x-large;">
Browser Testing[/title]
</div>
<!--This is the HTML for playing a JWPlayer Video-->
<div id="player">
<div id="container">
Loading the player ...</div>
<script type='text/javascript'>

jwplayer('container').setup({
image: '../Testing/Images/horse.jpg',
file: '../Testing/Videos/HandHelds/Horse1280x720.mp4',
height: 405,
width: 720,
modes: [
{ type: 'flash', src: 'player.swf' },
{ type: 'html5', config: {
'file': '../Testing/Videos/HandHelds/Horse480x272.mp4',
'provider': 'video',
'height': 272,
'width': 480
}
},
{ type: 'download', config: {
'file': '../Testing/Videos/HandHelds/Horse480x272.mp4',
'provider': 'video'
}
}]
});

</script>
</div>
</div>
</body>
</html>


...Jerry

Edit: Note: the forum posting bug in the code block for the title & h2 tags. should be:





Edit2:This code also plays on my sister's Motorola 'droid 2.
Edit3: Now it doesn't seem to work on the iPhone (gen 3). I think my daughter's boyfriend was browsing to the wrong page. Can someone else with an iPhone test?

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

JHendrix wrote on 6/5/2011, 6:23 PM
at

www.jazzythedog.com/testing/jwptest.html


it does not "fallback" and play on my (older) iPhone 3 (OS 4.2.1)

like some of my testing i assume it would just play the "hd frame size" in an IPhone4 or iPAD 2 (or so called "A4" devices). when I test i just go to the local Verizon store. i also found that android did generally play the bigger frames sizes using flash.

so the code is not working (switching to the smaller "older iOS rez" video), I have taken it as a basis though and am still working with JW to see about getting it to work..

amendegw wrote on 6/6/2011, 3:07 AM
Ah Shoot!! (I'd say something stronger, but this is a family-friendly forum.) I misspelled the name of the iPhone mp4 in my Videos folder. Dumb Operator Error.

So, I've renamed it to agree with the code block above. Give it a try now and see if this works. http://www.jazzythedog.com/testing/JWPtest.html

It's really tough testing/debugging this stuff since I don't have an iPhone.

...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

JHendrix wrote on 6/6/2011, 8:43 AM
this works:

<script type='text/javascript' src='.../jwplayer.js'></script>

<div id='mediaplayer'></div>

<script type="text/javascript">

jwplayer('mediaplayer').setup({
'id': 'playerID',
'width': '640',
'height': '368',
stretching:'exactfit',
'file': '...fullsizevid.mp4',
'image': '...image.jpg',


'modes': [
{type: 'flash', src: '.../player.swf'},
{
type: 'html5',
config: {
'file': 'smallervid.mp4',
'provider': 'video'
}
},
{
type: 'download',
config: {
'file': 'fullsizevid.mp4',
'provider': 'video'
}
}
]
});
</script>




just tested yours...its works too!

LReavis wrote on 6/6/2011, 6:28 PM
just a note about android 2: It is my understanding that only 2.2 up has Flash 10.1 capabilities; I just upgraded to android 2.1 on my phone and can play YouTube, etc., but not .MP4s. So, when testing, you might want to inquire regarding which Android 2 is involved . . .
Former user wrote on 6/7/2011, 5:50 AM
I received a Longtail Video newsletter this morning with the following link in it concerning encoding for mobile devices that might be of some use.