H264 --> DivX
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    Full HD H264 doesn't work well on my G5, but I've noticed that DivX works very well. Bigger files, yes, but very little usage of CPU, even in full HD.

    Is there any way to convert H264 to DivX in MorphOS? I can do that on Windows naturally, but I wanna be able to do this on MorphOS.
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »21.09.13 - 16:57
    Profile Visit Website
  • MorphOS Developer
    Krashan
    Posts: 1107 from 2003/6/11
    From: Białystok...
    Yes, you can do it with MEncoder (included in MPlayer package). It will be probably slower than on Windows, but can be done.
  • »21.09.13 - 18:34
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    Thanks!

    I tried to find a manual or instructions of some sort in the drawer, but I can't find anything. Do you know the lines I need to use, or at least know how I can find some sort of instructions?
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »21.09.13 - 20:02
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12163 from 2003/5/22
    From: Germany
    > I tried to find a manual or instructions of some sort in the drawer, but I can't find
    > anything. Do you know [...] how I can find some sort of instructions?

    http://www.mplayerhq.hu/DOCS/HTML/en/mencoder.html
    http://www.mplayerhq.hu/DOCS/HTML/en/encoding-guide.html
  • »21.09.13 - 20:21
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    Thanks! Wow, this will take a while to get through. Does anyone who is good at this know what lines I should use? It would save me time :-)
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »21.09.13 - 20:47
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    xyphoid
    Posts: 870 from 2008/7/11
    From: Delaware, USA
    MEncoder in extremely lengthy in process for doing this. Whenever possible I try to use ffmeg for my conversion needs.
    commands seem simpler. Not sure if that help you though. Same principle on search if you wish.
  • »22.09.13 - 03:04
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    I will try this as well. Thanks :-)
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »22.09.13 - 12:35
    Profile Visit Website
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    Quote:

    Yasu wrote:
    Full HD H264 doesn't work well on my G5, but I've noticed that DivX works very well. Bigger files, yes, but very little usage of CPU, even in full HD.

    Is there any way to convert H264 to DivX in MorphOS? I can do that on Windows naturally, but I wanna be able to do this on MorphOS.


    First, what is your G5 spec exactly? On a 2.3GHz or more, full hd h264 is most of the time fine. If not, you can uncomment "lavdopts=skiploopfilter=all" option in conf/config to give an additional 20% speedup.

    Regarding conversion, mencoder is just fine (and included with mplayer). I could also compile a ffmpeg binary if there's really demand for it, but mencoder does everything ffmpeg does, and more, which is why i usually don't release it.

    Converting with mencoder isn't much trouble, that would be something like mencoder yourfile -ovc xvid -oac mp3lame -xvidencopts fixed_quant=2:autoaspect -lameopts q=0:aq=0 -o destfile.avi

    Read the doc for more information, of course.
  • »22.09.13 - 13:14
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Jambalah
    Posts: 820 from 2008/3/30
    From: Roma, Italy
    A simple way to encode a full HD H264 with mencoder is this:

    Code:
    mencoder Source_Video.mp4 -ovc lavc -lavcopts vcodec=mpeg4 -oac pcm -o Dest_Video.avi


    If you desire more quality you can use the video options that are really a lot!. Another example with increased bitrate:

    Code:
    mencoder Source_Video.mp4 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1036:autoaspect -oac pcm -o Dest_Video2.avi


    Notice that you can change option "autoaspect" in "aspect=the_one_you_prefer" (16:9/4:3 etc).

    With those codes I encoded a h264 video 1280x550 (length 1:30) in almost 4 minutes (more or less). I f you want to add more quality you can use more options. Better look here and learn how:
    http://www.mplayerhq.hu/DOCS/HTML/en/index.html
    Specifically:
    http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-enc-libavcodec.html#menc-feat-mpeg4-lavc-example-settings
    In the last link there are some examples. I tried to encode the video with a high quality settings and it takes almost 15 minutes to perform the encode with a G4 @ 1.25.
    I can't post all the commands I have tried with both mencoder and ffmpeg because those damned gremlins erased my encoding directory. Really I don't understand why inside that dir there's nothing.... Who did it?!? Mistery....
    By the way, here you will find more about ffmpeg encoding commands:
    http://ffmpeg.mplayerhq.hu/ffmpeg.html

    EDIT:
    I forgot to say that h264 videos are not that bad on G4 (with obvious limits) and really nice on G5 (dual 2.7).



    [ Edited by Jambalah 22.09.2013 - 15:29 ]
    Pegasos II 1 ghz
    Powermac G4 Quicksilver with Sonnet Encore 1.8 ghz
    Powermac G4 MDD single 1.25 ghz, silenced for ears health...
    Powermac G5 dual 2.7 ghz I'll be back...
    Powermac G5 dual 2.0 ghz
    Powerbook G4 1.67 ghz 17
  • »22.09.13 - 13:21
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    Thanks for the codes! It's not easy to know what you need when you are not used to this stuff. I'm used to GUIs and they are usually quite straight forward, or at least have some sort of default setting that works with only a little tweaking. Having so much options isn't really useful when one doesn't know what one needs.

    So I'm grateful for all the help here.

    I have tried to get this to work before on standard h264 but unsuccessfully. The lag is terrible no matter what I do (I will try your suggestion Fab). I have a dual 2,7 GHz G5 with Radeon 9600XT with 128 MB VRAM. That should be enough right?

    Maybe it's some setting in GMplayer or Pach Chrysalis that messes things up?

    [ Edited by Yasu 22.09.2013 - 16:26 ]
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »22.09.13 - 14:21
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    For example: downloading anything from Youtube with 1080 setting will lag terribly.
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »22.09.13 - 14:46
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    I tried all the three codes from Fab and Jambalah and Fabs is certainly slowest, but the quality is the same as the original file. The other two codes have a lot of artifacts. If there is a quicker way to compress without loosing quality I'm all ears :-)
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »22.09.13 - 22:42
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    bash64
    Posts: 958 from 2010/10/28
    From: USA
    I have a powermac g5 2.3ghz with radeon 9600.

    I am playing 1080p movies fine unless they came from youtube.
    I am using gmplayer.
    Mac G5 ISight 21" 2.5 gb of ram 233gb hd matshita dvd-r uj-846
    Powerbook G4 1.67ghz 2GB, ATI 9700M Pro 128mb
    1TB hd, DL-DVD Burner, Netgear pcmcia wireless card.
    ImageFX 4.5, PageStream 3.3, PhotoGenics 5.0
  • »23.09.13 - 02:39
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    SKOLMAN_MWS
    Posts: 107 from 2006/10/24
    Fab,
    Quote:

    I could also compile a ffmpeg binary if there's really demand for it


    I am interested new version ffmpeg.

    By the way, why does MPlayer not plays both channels of the sound HiFi stereo without ++ ?

    When will in Macs native audio frequency of 48000 Hz and Efika audio frequency of 44100 Hz ?

    pegasos.audio native frequency: 8000 Hz, 11025 Hz, 16000 Hz, 22050 Hz, 32000 Hz, 44100 Hz, 48000 Hz http://skolman-mws.w.interia.pl/mos/pegasos_audio.png
    _
  • »23.09.13 - 08:54
    Profile
  • MorphOS Developer
    Krashan
    Posts: 1107 from 2003/6/11
    From: Białystok...
    @SKOLMAN_MWS:

    By the way, why does MPlayer not plays both channels of the sound HiFi stereo without ++ ?

    This is because "Stereo" mode uses different audio stream layout than "Stereo++" mode. The first one takes separate channels loaded as two different sounds. The second one takes interleaved stereo stream. MPlayer only supports the latter.

    When will in Macs native audio frequency of 48000 Hz and Efika audio frequency of 44100 Hz?

    There is no native 48 kHz in most of Macs and no native 44,1 kHz in Efika. Other frequencies may be achieved only with software resampling (which is what AHI does, admittely with poor quality).
  • »23.09.13 - 09:28
    Profile Visit Website
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    SKOLMAN_MWS
    Posts: 107 from 2006/10/24
    Krashan,
    Quote:

    There is no native 48 kHz in most of Macs and no native 44,1 kHz in Efika.


    EFIKA 5200B

    Code:
    Supported audio sample rates include:
    48 kHz, 44.1 kHz, 32 kHz, 22.05 kHz, 16 kHz, 11.025 kHz, and 8 kHz;
    additional rates are supported in the STAC9766/67 soft audio drivers.


    Mac mini G4

    Code:
    Built In Sound Card:

    PCM 16:
    Bit Depth: 16
    Bit Width: 16
    Channels: 2
    Sample Rates: 32 kHz, 44.1 kHz, 48 kHz, 88.2 kHz, 96 kHz

    PCM 24:
    Bit Depth: 24
    Bit Width: 32
    Channels: 2
    Sample Rates: 32 kHz, 44.1 kHz, 48 kHz, 88.2 kHz, 96 kHz
    _
  • »23.09.13 - 10:02
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    @bash64

    Does that mean that Youtube HD movies doesn't work for you but other HD movies does? I havn't tried that many others, but I remember Dredd on 1080 also lagging a lot.

    @Fab

    Maybe you could send me your configuration and I can see if that helps?
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »23.09.13 - 11:23
    Profile Visit Website
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    Quote:

    Yasu wrote:
    @bash64

    Does that mean that Youtube HD movies doesn't work for you but other HD movies does? I havn't tried that many others, but I remember Dredd on 1080 also lagging a lot.

    @Fab

    Maybe you could send me your configuration and I can see if that helps?






    Give an exact youtube link and we can see then. But when i tried youtube full hd links one year ago or so on my G5@2.3GHz, it was fine and i even had a few percent CPU left. It was even almost ok when played from inside OWB builtin mediaplayer (which has a slightly higher cpu load due to networking).
  • »23.09.13 - 11:55
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    This is the one I've been using to test MPlayer in HD:

    http://youtu.be/IDCU17wXktY
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »23.09.13 - 12:09
    Profile Visit Website
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    @Yasu

    Ok, i had time to switch on my G5@2.3GHz / Radeon 9600 and make some tests.

    Your link is somewhat dead unfortunately (youtube sucks), but i tested this one instead : http://www.youtube.com/watch?v=T6DJcgm3wNY# (mp4/1920x1080 version, 182s clip).

    And here are the results with MPlayer (latest version from april 2013 with lavdopts=skiploopfilter=all enabled in conf/config file) :

    I started MPlayer (GUI mode), and it plays perfectly in sync, with about 70-80% CPU usage.
    Then I benchmarked it precisely with the following command line in a shell:
    mplayer -benchmark -nosound -ao null file.mp4 "datas:Man of Steel - Official Trailer 3 [HD].mp4"

    BENCHMARKs: VC: 65.331s VO: 65.037s A: 0.000s Sys: 2.318s = 132.686s
    BENCHMARK%: VC: 49.2370% VO: 49.0158% A: 0.0000% Sys: 1.7471% = 100.0000%

    As you see, the whole 182s movie is played (without audio decoding/output) in 132s, so there's definitely quite some CPU left here.

    Do the same test on your setup, and we'll see. It should be even faster for you (even with loopfilter enabled, considering your CPU frequency). If not, then you have a serious configuration issue.



    [ Edited by Fab 24.09.2013 - 12:15 ]
  • »24.09.13 - 11:13
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    connor
    Posts: 570 from 2007/7/29
    How much do the movies grow from h264 to DivX? 10-20% or 50% and more? Would that also be a valid way to play 1080p movies on a G4 or will it still be too slow?
  • »24.09.13 - 18:04
    Profile
  • Butterfly
    Butterfly
    Mabo
    Posts: 67 from 2010/5/3
    Have a look here:

    1) MorphEnc: http://aminet.net/package/util/conv/MorphEnc

    2) mengui: http://aminet.net/package/gfx/edit/mengui

    Hope it helps

    :)
  • »24.09.13 - 19:51
    Profile Visit Website
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    Quote:

    connor wrote:
    How much do the movies grow from h264 to DivX? 10-20% or 50% and more? Would that also be a valid way to play 1080p movies on a G4 or will it still be too slow?


    To be seen how much bigger it would be, but in any case, 1080p divx is no trouble for a G4 > 1GHz.
  • »24.09.13 - 19:59
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    connor
    Posts: 570 from 2007/7/29
    Thanks. I will try to find some demo video and try that.
  • »24.09.13 - 20:51
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    @Fab

    I tried the way you described (excellently I might add!) and I suffered from some serious lag, the same as before. No change.

    Here's my benchmarks:

    BENCHMARKs: VC: 92.186s VO: 67.902s A: 0.000s Sys: 2.349s = 162.437s
    BENCHMARK%: VC: 56.7518% VO: 41.8021% A: 0.0000% Sys: 1.4461% = 100.0000%

    For some reason my system doesn't work as well as yours. But I have no idea of what's wrong. I'm using the same settings as came with MorphOS (plus Pack Crysalis).

    @Connor

    The file I converted to DivX with the same HD quality grew from 153 MB to 497 MB. Quite a bit.

    @Mabo

    Thanks! I will take a look at those :-)
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »24.09.13 - 21:54
    Profile Visit Website