Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

MP4's with avc codec not playing video


I'm having a problem getting mp4 video to show up in jw player 4.5.230. I'm converting mpeg2's to mp4's with ffmpeg serverside, using the libx264 codec. I've used 4 or 5 of the different ffmpeg presets, all turn out the same, deafault, normal, loseless, hq, etc.

Using the libfaac audio codec I get sound and no video. When I use the aac audio codec I get sound, no video.

Both of these videos play locally in quicktime and through IE8 and FF 3 with the quicktime plugin.

Here are the two videos, the ffmpeg commands, and the MediaInfo from the original mpeg2 and the mp4's.

Any help would be appreciated.

http://www.touristnetworkinteractive.com/mp4test/mp4_test.htm

======================================================================================================================

http://www.touristnetworkinteractive.com/mp4test/mpg_to_mpeg4_hq_96kbsp_aac.mp4

ffmpeg -i btv4881.mpg -vcodec libx264 -r 15 -b 400000 -s 400x300 -acodec aac -ab 96000 -ar 44100 -sameq -vpre hq mpg_to_mpeg4_hq_96kbsp_aac.mp4

mpg_to_mpeg4_hq_96kbsp_aac.mp4 - MediaInfo -
General
Complete name : C:\Documents and Settings\lucas\Desktop\mpg_to_mpeg4_hq_96kbsp_aac.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 3.63 MiB
Duration : 1mn 5s
Overall bit rate : 464 Kbps
Writing application : Lavf52.50.0

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L2.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1mn 5s
Bit rate mode : Variable
Bit rate : 358 Kbps
Nominal bit rate : 400 Kbps
Width : 400 pixels
Height : 300 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 15.000 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.199
Stream size : 2.80 MiB (77%)
Writing library : x264 core 84
Encoding settings : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=1 / sliced_threads=0 / nr=0 / decimate=1 / mbaff=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / wpredp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=400 / ratetol=10.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 1mn 5s
Bit rate mode : Variable
Bit rate : 102 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 44.1 KHz
Stream size : 817 KiB (22%)

======================================================================================================================

http://www.touristnetworkinteractive.com/mp4test/mpg_to_mpeg4_hq_96kbsp_libfaac.mp4

ffmpeg -i btv4881.mpg -vcodec libx264 -r 15 -b 400000 -s 400x300 -acodec copy -ab 96000 -ar 44100 -sameq -vpre hq mpg_to_mpeg4_hq_copied_from_mpeg.mp4

mpg_to_mpeg4_hq_96kbsp_libfaac.mp4 - MediaInfo -
General
Complete name : mpg_to_mpeg4_hq_96kbsp_libfaac.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 3.59 MiB
Duration : 1mn 5s
Overall bit rate : 458 Kbps
Writing application : Lavf52.50.0

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L2.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1mn 5s
Bit rate mode : Variable
Bit rate : 358 Kbps
Nominal bit rate : 400 Kbps
Width : 400 pixels
Height : 300 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 15.000 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.199
Stream size : 2.80 MiB (78%)
Writing library : x264 core 84
Encoding settings : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=1 / sliced_threads=0 / nr=0 / decimate=1 / mbaff=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / wpredp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=400 / ratetol=10.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : 40
Duration : 1mn 5s
Bit rate mode : Variable
Bit rate : 96.0 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 44.1 KHz
Stream size : 768 KiB (21%)

======================================================================================================================

MPEG2 - MediaInfo -
General
Complete name : btv4881.mpg
Format : MPEG-PS
File size : 33.6 MiB
Duration : 1mn 5s
Overall bit rate : 4 293 Kbps

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, BVOP : Yes
Format settings, Matrix : Default
Duration : 1mn 5s
Bit rate mode : Constant
Bit rate : 3 930 Kbps
Nominal bit rate : 3 863 Kbps
Width : 704 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate : 29.970 fps
Resolution : 8 bits
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.388
Stream size : 30.7 MiB (92%)

Audio
ID : 192 (0xC0)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Mode : Dual mono
Duration : 1mn 5s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Video delay : -67ms
Stream size : 1.50 MiB (4%)

10 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

The file needs to be encoded in H.264 in order to work in Flash.

JW Player

User  
-1 rated :

FYI, these mp4's play in this stand alone flv player - http://www.wimpyplayer.com/products/wimpy_standalone_flv_player.html

Ethan Feldman

JW Player Support Agent  
0 rated :

Yes, but Flash itself requires that videos be encoded in H.264

JW Player

User  
0 rated :

FFMpeg is already encoding it: -vcodec libx264

or am I mistaken?

That last MediaInfo is for the original mpeg2.

The two above it are the mp4's MediaInfo.

Ethan Feldman

JW Player Support Agent  
0 rated :

I do not know if libx264 is actual H.264, I would run it through the free encoding program handbrake (www.handbrake.fr) to make sure it in H.264

JW Player

User  
0 rated :

Yes libx264 is the opensource H.264 codec - x264:
http://www.videolan.org/developers/x264.html

I'm doing this server side.

This thread says ffmpeg using libx264 makes playable mp4's:
http://www.longtailvideo.com/support/forum/General-Chat/14560/Can-t-play-this-video-even-in-the-JW-Wizard-page



Ethan Feldman

JW Player Support Agent  
0 rated :

Theoretically, that should work.

Note, I just checked your test page and I see that you are using the V4.5 player. I just tested your file http://www.touristnetworkinteractive.com/mp4test/mpg_to_mpeg4_hq_96kbsp_libfaac.mp4 in our wizard – http://www.longtailvideo.com/support/jw-player-setup-wizard, which uses V5, and it works fine :) I see the video and hear the audio! :-D

JW Player

User  
0 rated :

Cool, maybe because I'm embedding instead of using the swfobject? Either way thanks for the help, I'll setup another page with the swfobject and see if that works.

Edit: D'oh I see now, 4.5 is probably not working and 5 is, I'll update our player, thanks again.

Ethan Feldman

JW Player Support Agent  
0 rated :

Np!

JW Player

User  
0 rated :

here is my zip package everything is in there to encode videos ffmpeg,qt fast start,mencoder,mplayer, codecs etc

everything inside the zip is updated

File Size: 47.54 MB
http://www.mediafire.com/?yg1zznamdmm

replace the paths you see


open notepad, copy code below, save it as encoder.bat replace the ffmpeg.exe qt exe etc to where the files you saved and also change the preset location ! thats it now your able to stream mp4 in flash, i really do hate flash but everybody using it ! shhish

@ ECHO OFF
REM The following will convert all avi files in the current folder into mp4 files.

IF EXIST *.wmv FOR %%A IN (*.wmv) DO CALL :twopass "%%A"

:twopass
C:\encoder\ffmpeg.exe -y -i %* -b 2M -bt 4M -vcodec libx264 -pass 1 -fpre "C:\encoder\ffpresets\libx264-veryfast_firstpass.ffpreset" -s 640x360 -b 1500kbps -bt 1500kbps -threads 4 output.mp4
C:\encoder\ffmpeg.exe -y -i %* -b 2M -bt 4M -vcodec libx264 -pass 2 -fpre "C:\encoder\ffpresets\libx264-veryfast.ffpreset" -s 640x360 -b 100kbps -bt 120kbps -threads 4 output.mp4


RENAME output.mp4 %*.mp4

:QT Faststart
C:\encoder\qt-faststart.exe %*.mp4 %*.qt.mp4


:GET Thumbs
C:\encoder\ffmpeg.exe -v 0 -y -i %* -vframes 1 -ss 30 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 %*.qt_mp4.jpg


:Remove MP4 WITHOUT QT FASTSTART
ECHO Y | DEL %*.mp4

ECHO.
GOTO :EOF

This question has received the maximum number of answers.