Wowza Community

ffmpeg presets for IOS devices?

This ought to be on the Xuggler boards, but I’m still waiting to get permission to post…

I’ve been able to generate H.264/AAC files that play beautifully on my desktop over Wowza 2.X or 3.0 pre-release from an FLV stream generated by FlashPlayer. Problem is, the files generated are at level 5.1 and most iPhones and many iPads require 3.0 to play.

Here’s the output from the Wowza log:

INFO server comment - MediaReaderH264Cupertino.handlePacket[vod/_definst_/dvrTest2.mp4][mp4a.40.2]: AAC Audio info: {AACFrame: size: 0, rate: 11025, channels: 1, samples: 1024, errorBitsAbsent: true, profileObjectType: "LC"}
INFO server comment - MediaReaderH264Cupertino.handlePacket[vod/_definst_/dvrTest2.mp4][avc1.100.51]: H.264 (Video may not be playable on older iPhone and iPod touch devices where Baseline/Level 3.0 or lower is required) Video info: {H264CodecConfigInfo: profile: "High", level: 5.1, frameSize: 800x600, displaySize: 800x600, crop: l:0 r:0 t:0 b:4, frameRate: 1000.0}

I’m using Xuggler - not ffmpeg directly, but the latest version supports preset files. I do the transcode like this:

-vcodec libx264  -vpreset  preset/libx264-ipod640.ffpreset rtmp://media-d1.biglifelabs.com/vod/dvrTest2 file://Users/myHomedir/tmp/dvrTest2.mp4

and get the following from libx264

20:44:06.866 [main] ERROR org.ffmpeg - [libx264 @ 0x10b050200] Default settings detected, using medium profile

I’ve tried all of the provided presets, most produce super huge files and no video. The reset default to medium and don’t play on an iPad or iPhone.

If you’ve worked with Xuggler before and have any experience with settings that work, PLEASE, PLEASE respond.

Thanks,

Leo

biglifelabs.com

@leosbiglife

Try with ffmpeg.

There’s some suggestions here you may be able to adapt for your needs: https://www.wowza.com/docs/how-to-encode-video-on-demand-content

Some other examples:

ffmpeg -i INPUT -s 320x240 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 -vpre ipod320 -acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

ffmpeg -i INPUT -s 640x480 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 -vpre ipod640 -acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

Without Presets:

ffmpeg -i INPUT -s 320x240 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 -coder 0 -bf 0 -flags2 -wpred-dct8x8 -level 13 -maxrate 768k -bufsize 3M-acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

ffmpeg -i INPUT -s 320x240 -r 30000/1001 -b 200k -bt 240k -vcodec libx264 coder 0 -bf 0 -refs 1 -flags2 -wpred-dct8x8 -level 30 -maxrate 10M -bufsize 10M-acodec libfaac -ac 2 -ar 48000 -ab 192k output.mp4

Notice one of those is level 1.3 and the other is level 3.0.

Thanks - this was useful.

In the end I’ve opted to use the soon to be released flash player 11. This player can be configured to encode video in H.264. It would be better if it could encode AAC audio. Anyone using it should be aware though that the player still doesn’t set the bit rate, so Xuggler/ffmpeg would typically generate a lower bit rate (quality) video. I’ve hardcoded it (for now) in my application and it works fine.

cheers