MPEG/DivX/Xvid: MENCODER für ppc Dreamboxen, getestet auf DM7020

  • Hallo,


    für mein Dream Motion Projekt benötige ich einen flexiblen MPEG Encoder, der die gängigen Codes unterstützt. Aus diesem Grund habe ich mich mit dem MENCODER beschäftigt und konnte ihn erfolgreich kompilieren.


    Der MENCODER ist Teil des MPLAYER packages, welches ich auch gleich mit kompiliert habe. Das MENCODER binary ist unten angehängt. Ich hoffe, ich mache hier keinen Doppelpost, da ich MENCODER nirgend wo gefunden habe.


    Der MENCODER beherrscht alle gängigen Codes (MPEG4, 2, 1, Xvid, usw). Quelle: mplayerhq. Er ist lizensiert unter GNU General Public License v2.


    Die Dreambox ist natuerlich viel zu langsam für "encoding-on-the-fly". Hier geht es um etwas anderes:


    Ich baue mit ihm einen MPEG1 Video File (kann von Enigma abgespielt werden!) aus den Einzelbildern meiner IP-CAM:


    MPEG1 (abspielbar mit Enigma!):
    mencoder mf://*.jpg -mf w=1600:h=1200:fps=15:type=jpg -ovc lavc -lavcopts vcodec=mpeg1video -vf scale=640:480 -of mpeg -o output.mpg


    Da die IP-CAM jpgs sehr klein sind (640x480, 15 kb) und es nur ein paar wenige sind (meist so um die 10..15), fällt die schwache Rechenleistung der Dreambox nicht sehr ins Gewicht.


    MPEG4 ginge so:
    mencoder mf://*.jpg -mf w=1600:h=1200:fps=15:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -vf scale=640:480 -of mpeg -o output.mpg


    Wie gesagt: beides kann der Encoder übersetzen. Inwiefern in weitere Formate konvertiert werden kann , konnte ich noch nicht testen.


    Über Feedback würde ich mich freuen. Ich hänge das MPLAYER binary hier nicht an, da ich damit noch keine Tests gemacht habe. Um es auf der Dream zum laufen zu bekommen, fehlt mir gerade die Phantasie: ;-). Auf Anfrage kann ich es zur Verfügung stellen (sind ca. 3MB)


    MENCODER benötigt die libjeg.so.6. Die ist im TGZ File enthalten und kann z.B. nach /lib kopiert werden.


    Gruß Mamba
    ________________________________________


    MPlayer Features
    MPlayer is a movie player which runs on many systems (see the documentation). It plays most MPEG/VOB, AVI, Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT, NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files, supported by many native, XAnim, and Win32 DLL codecs. You can watch VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5 and even WMV movies..


    Another great feature of MPlayer is the wide range of supported output drivers. It works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, AAlib, DirectFB, but you can use GGI, SDL (and this way all their drivers), VESA (on every VESA compatible card, even without X11!) and some low level card-specific drivers (for Matrox, 3Dfx and ATI), too! Most of them support software or hardware scaling, so you can enjoy movies in fullscreen. MPlayer supports displaying through some hardware MPEG decoder boards, such as the Siemens DVB, DXR2 and DXR3/Hollywood+.


    MPlayer has an onscreen display (OSD) for status information, nice big antialiased shaded subtitles and visual feedback for keyboard controls. European/ISO 8859-1,2 (Hungarian, English, Czech, etc), Cyrillic and Korean fonts are supported along with 12 subtitle formats (MicroDVD, SubRip, OGM, SubViewer, Sami, VPlayer, RT, SSA, AQTitle, JACOsub, PJS and our own: MPsub). DVD subtitles (SPU streams, VOBsub and Closed Captions) are supported as well.


    License
    MPlayer is available under the GNU General Public License v2.


    Supported Input Formats
    (S)VCD (Super Video CD)
    CDRwin's .bin image file
    DVD, including encrypted DVD
    MPEG-1/2 (ES/PS/PES/VOB)
    RIFF AVI file format
    ASF/WMV/WMA format
    QT/MOV/MP4 format
    RealAudio/RealVideo format
    Ogg/OGM files
    Matroska
    NUT
    NSV (Nullsoft Streaming Video)
    VIVO format
    FLI format
    NuppelVideo format
    yuv4mpeg format
    FILM (.cpk) format
    RoQ format
    PVA format
    streaming via HTTP/FTP, RTP/RTSP, MMS/MMST, MPST, SDP
    TV grabbing
    Supported Video and Audio Codecs
    most important video codecs:
    MPEG-1 (VCD) and MPEG-2 (SVCD/DVD/DVB) video
    MPEG-4 in all variants including DivX ;-), OpenDivX (DivX4), DivX 5 (Pro), XviD
    Windows Media Video 7/8 (WMV1/2)
    Windows Media Video 9 (WMV3) (using x86 DLL)
    RealVideo 1.0, 2.0 (G2)
    RealVideo 3.0 (RP8), 4.0 (RP9) (using Real libraries)
    Sorenson v1/v3 (SVQ1/SVQ3), Cinepak, RPZA and other QuickTime codecs
    DV video
    3ivx
    Intel Indeo3 (3.1, 3.2)
    Intel Indeo 4.1 and 5.0 (using x86 DLL or XAnim codecs)
    VIVO 1.0, 2.0, I263 and other H.263(+) variants (using x86 DLL)
    MJPEG, AVID, VCR2, ASV2 and other hardware formats
    FLI/FLC
    HuffYUV
    various old simple RLE-like formats
    most important audio codecs:
    MPEG layer 1, 2, and 3 (MP3) audio
    AC3/A52 (Dolby Digital) audio (software or SP/DIF)
    AAC (MPEG-4 audio)
    WMA (DivX Audio) v1, v2
    WMA 9 (WMAv3), Voxware audio, ACELP.net etc (using x86 DLLs)
    RealAudio: COOK, SIPRO, ATRAC3 (using Real libraries)
    RealAudio: DNET and older codecs
    QuickTime: Qclp, Q-Design QDMC/QDM2, MACE 3/6 (using QT libraries), ALAC
    Ogg Vorbis audio
    VIVO audio (g723, Vivo Siren) (using x86 DLL)
    alaw/ulaw, (ms)gsm, pcm, *adpcm and other simple old audio formats
    The codec status page has the complete list and is updated daily.


    Supported Video Output Devices
    general:
    x11: X11 with SHM extension
    xv: X11 using overlays with the Xvideo extension (hardware YUV & scaling)
    xvmc: Xvideo Motion Compensation
    vidix: VIDeo Interface for *niX
    xvidix: VIDIX in an X11 window
    cvidix: VIDIX on the console
    winvidix: VIDIX under Windows
    dga: X11 DGA extension (both v1.0 and v2.0)
    gl: OpenGL renderer
    gl2: alternative OpenGL renderer (with multiple textures)
    fbdev: framebuffer output
    svga: SVGAlib output (supports EGA displays)
    sdl: SDL >= v1.1.7 driver
    ggi: GGI graphics output
    aalib: text mode rendering
    caca: text mode rendering in color
    vesa: display through the VESA BIOS (also needed for Radeon TV-out)
    directfb: DirectFB support
    directx: native Windows DirectX output driver
    quartz: native Mac OS X output driver
    card specific:
    mga: Matrox G200/G400/G450/G550 hardware YUV overlay via the mga_vid device
    xmga: Matrox G200/G400/G450/G550 overlay (mga_vid) in X11 window (Xv emulation on X 3.3.x!)
    syncfb: Matrox G400 YUV support on framebuffer
    3dfx: Voodoo 3/Banshee hardware YUV support (/dev/3dfx)
    tdfxfb: Voodoo 3/Banshee hardware YUV support on tdfx framebuffer
    mpegpes: support for Siemens DVB hardware MPEG-1/2 decoder boards (or MPEG-PES file output)
    dxr2: support for DXR2 hardware MPEG-1/2 decoder boards
    dxr3: support for DXR3/Hollywood+ hardware MPEG-1/2 decoder boards
    zr: support for Zoran360[56]7 based hardware MJPEG cards
    special:
    png: PNG output
    jpeg: JPEG output
    gif89a: animated GIF output
    tga: Targa output
    yuv4mpeg: yuv4mpeg output for mjpegtools
    pgm: PGM output (for testing purposes)
    md5: MD5sum output (for debugging)
    null: null output (for speed tests/benchmarking)
    bl: Blinkenlights output
    See the video card section of the documentation for more details.


    Supported Audio Output Devices
    OSS (Open Sound System) - factory standard under UNIX
    SDL (Simple Directmedia Layer) - wrapper library with support for various systems
    ALSA (Advanced Linux Sound Architecture) 0.5/0.9/1.0 for Linux
    SUN audio driver for BSD and Solaris8/9 users
    SGI audio for IRIX
    Mac OS X audio
    Windows audio
    NAS (Network Audio System)
    ESD (ESound Daemon)
    ARTS (KDE Sound System)
    JACK (Jack Audio Connection Kit)


    HINWEIS ZUM AUSPACKEN:
    MENCODERxx.RAR umbennen in MENCODER.Rxx und dann mit RAR entpacken. Sorry, für den Umweg, aber das Board erlaubt nur File bis max 1 MB und besteht auf die Endung .RAR. Libjpeg nach /lib kopieren!

  • Hallo,


    habe mal ein paar Vergleiche mit MENCODER zw. DM7020 und meinem P3 1 GHZ Linux PC gemacht.
    Input File: 2x 700MB Xvid-MPEG4, Ausgabe 1 MPEG2 video (abspielbar für Enigma).


    Der PC schafft ca. 50 fps. Die Dreambox: 3,11 fps. Jeweils bei gleichem Input-Video. Der Unterschied ist recht groß, für meinen Geschmack. Liegt vermutlich an der cpu Architektur (keine FPU), da es mit dem Unterschied in der Taktrate nicht erklärbar ist (die ist sowieso kein Anhaltspunkt mehr).


    Der MENCODER wurde mit --target=ppc kompiliert, sollte also relativ optimal laufen. Er meldet auch zur Laufzeit, daß er einen PPC erkannt hat.


    Dennoch kann man auch so über Nacht jeweils ein 700 MB DivX/Xvid Video umkodieren lassen. Dauert ca 10h. :winking_face:
    Vorstellbar wäre ein script, was alle paar Minuten nach *.avi Files schaut und den dann nach MPEG2 umkodiert und danach die *.avi's löscht. Dann braucht man gar nichts mehr zu machen (ausser zu warten). :smiling_face:


    Mit der DM8000 sieht das vermutlich schon wieder ganz anders aus. Die schafft das encoding des MPEG4-Format evtl. auch ohne Hersteller-Code "on the fly". Bin gespannt.


    Als nächsten Schritt werde ich mal den MPEG4 File nach RAW umkodieren und auf /dev/null schreiben. Mal sehen, wie schnell das geht (in fps).


    Gruß Mamba


    PS: Hier als Beispiel des Screenslog der DM7020:


    root@dm7020:/media/hdd/movie_temp# /hdd/bin/mencoder ./*.avi -of mpeg -o output.mpg -oac lavc -ovc lavc -lavcopts acodec=mp2:abitrate=224:vcodec=mpeg2video


    MEncoder 1.0pre8-3.4.4 (C) 2000-2006 MPlayer Team
    CPU: PowerPC
    success: format: 0 data: 0x0 - 0x2bc74800
    AVI file format detected.
    VIDEO: [XVID] 720x304 12bpp 25.000 fps 1453.0 kbps (177.4 kbyte/s)
    [V] filefmt:3 fourcc:0x44495658 size:720x304 fps:25.00 ftime:=0.0400
    ==========================================================================
    Opening audio decoder: [liba52] AC3 decoding with liba52
    No accelerated IMDCT transform found
    AC3: 5.1 (3f+2r+lfe) 48000 Hz 448.0 kbit/s
    No accelerated resampler found
    AUDIO: 48000 Hz, 2 ch, s16be, 448.0 kbit/29.17% (ratio: 56000->192000)
    Selected audio codec: [a52] afm: liba52 (AC3-liba52)
    ==========================================================================
    PACKET SIZE: 2048 bytes, deltascr: 245759
    Opening video filter: [expand osd=1]
    Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
    ==========================================================================
    Limiting audio preload to 0.4s.
    Increasing audio density to 4.
    VDec: vo config request - 720 x 304 (preferred colorspace: Planar YV12)
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 2.37:1 - prescaling to correct movie aspect.
    videocodec: libavcodec (720x304 fourcc=3267706d [2gpm])


    Pos: 3.1s 77f ( 0%) 3.11fps Trem: 667min 464mb A-V:0.051 [204:223]


    ------------------------------------------------


    Beim Dekodieren ist die Dream etwas schneller. Immerhin 17 fps und das ohne FPU! Das ist doch schon mal was. Natuerlich sollte man ein video-file eher mit dem mplayer dekodieren, der ist aber anscheinend langsamer.


    root@dm7020:/media/hdd/movie_temp# /hdd/bin/mencoder ./*.avi -o /dev/null -ovc raw -oac copy


    MEncoder 1.0pre8-3.4.4 (C) 2000-2006 MPlayer Team
    CPU: PowerPC
    success: format: 0 data: 0x0 - 0x574808f2
    AVI file format detected.
    VIDEO: [XVID] 672x272 12bpp 25.000 fps 1302.7 kbps (159.0 kbyte/s)
    [V] filefmt:3 fourcc:0x44495658 size:672x272 fps:25.00 ftime:=0.0400
    Opening video filter: [expand osd=1]
    Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
    ==========================================================================
    audiocodec: framecopy (format=55 chans=2 rate=44100 bits=0 B/s=14912 sample-0)
    VDec: vo config request - 672 x 272 (preferred colorspace: Planar YV12)
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is 2.47:1 - prescaling to correct movie aspect.
    Writing header...1f ( 0%) 0.00fps Trem: 0min 0mb A-V:0.000 [0:0]
    ODML: vprp aspect is 16384:6631.
    Writing header...
    ODML: vprp aspect is 16384:6631.


    Pos: 11.4s 286f ( 0%) 17.52fps Trem: 0min 0mb A-V:0.037 [54643:95]
    Flushing video frames
    Writing index...
    Writing header...
    ODML: vprp aspect is 16384:6631.


    Video stream: 54643.469 kbit/s (6830433 B/s) size: 78140160 bytes 11.440 secs 286 frames


    Audio stream: 95.226 kbit/s (11903 B/s) size: 141789 bytes 11.912 secs
    root@dm7020:/media/hdd/movie_temp#

    __________________________________
    Dreambox 800/7020, 250 GB HDD, 100 Mbit Lan

    3 Mal editiert, zuletzt von mamba0815 ()

  • Zitat

    Original von mamba0815
    Dennoch kann man auch so über Nacht jeweils ein 700 MB DivX/Xvid Video umkodieren lassen. Dauert ca 10h. :winking_face:
    Vorstellbar wäre ein script, was alle paar Minuten nach *.avi Files schaut und den dann nach MPEG2 umkodiert und danach die *.avi's löscht. Dann braucht man gar nichts mehr zu machen (ausser zu warten). :smiling_face:


    Ein Fall für Cron. Ist ja bei der Busybox mit bei.

    Samsung QE55Q6FGMTXZG
    3x DM900 UHD, 1x DM820HD, 2x DM520HD
    Sony UBP-X700
    Spaun Multi-Switch 9962; 2x LNB Alps Quattro Astra 19.2°, Hotbird 13°
    Telestar Digibit R1

    Einmal editiert, zuletzt von Unchained ()

  • Hi,


    es gibt eine neue Version von MENCODER und MPLAYER:
    ______________________AUSZUG____________________________
    2006.10.22, Sunday :: MPlayer 1.0rc1 released
    posted by the release team
    We wish to thank the Google Summer of Code project for sponsoring the FFmpeg project. Thanks to the SoC program for 2006, the FFmpeg project was able to get help from students to implement more native codecs.


    The highlights of this release are native VC-1/WMV3, On2 VP5 and VP62 (used in some Flash video files) decoding, which works even on non-Intel platforms, and SSA/ASS/color subtitles.


    Vorbis decoding has seen a big speedup, as has H.264. The optimizations to H.264 are still ongoing, but the difference should already be noticeable.
    ______________________AUSZUG____________________________


    Bin gerade daran es zu kompilieren (mit xdevels nativ auf der Dreambox direkt).


    Was mich stutzig gemacht hat:


    >./configure
    (....)
    Checking for TV interface ... yes
    Checking for Video 4 Linux TV interface ... yes
    Checking for Video 4 Linux 2 TV interface ... yes
    Checking for Radio interface ... no
    Checking for Capture for Radio interface ... no
    Checking for Video 4 Linux 2 Radio interface ... no
    Checking for Video 4 Linux Radio interface ... no
    Checking for Video 4 Linux 2 MPEG PVR interface ... no
    Checking for audio select() ... yes
    (....)


    Tja .... was bedeutet das wohl??


    Gruß Mamba

    __________________________________
    Dreambox 800/7020, 250 GB HDD, 100 Mbit Lan

  • Ich habe mit grossem Interesse den Artikel gelesen, weil ich schon seit langem hinter so etwas her bin. Mein Interesse gilt dem übersetzen von Sat-Radio auf der Dreambox on-the-fly in mp3, damit das dann über das Netzwerk als stream abgeholt werden kann. Hintergrund: Ich habe einen Netzwerk-Standalone-Player der aber nur mp3 und ein paar andere Formate kann, aber definitiv kein mp2.
    Ist soetwas mit MENCODER möglich umwandeln und streamen?

  • Ja, aber leider reicht die CPU Power der Dreambox nicht aus. Vielleicht wird das was mit derm DM8k.


    Mamba

    __________________________________
    Dreambox 800/7020, 250 GB HDD, 100 Mbit Lan

  • Zitat

    Original von jegow
    Ich habe mit grossem Interesse den Artikel gelesen, weil ich schon seit langem hinter so etwas her bin. Mein Interesse gilt dem übersetzen von Sat-Radio auf der Dreambox on-the-fly in mp3, damit das dann über das Netzwerk als stream abgeholt werden kann. Hintergrund: Ich habe einen Netzwerk-Standalone-Player der aber nur mp3 und ein paar andere Formate kann, aber definitiv kein mp2.
    Ist soetwas mit MENCODER möglich umwandeln und streamen?


    Sowas ist im [Moderator] Fremdimage, verstößt gegen die Boardregeln [/Moderator]bereits drin, da kannste dir Internetradio automatisch zu mp3 Konvertieren lassen. Einfach mal ne Nacht laufen lassen und schon quillt die HDD über...

    DM7000 - 80GB-HDD - 1GB-USB-Stick - 100Mbit-LAN
    DM600 - 20GB-HDD - 100Mbit-LAN

    Einmal editiert, zuletzt von floh ()