Audio rip from mp4
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    xyphoid
    Posts: 870 from 2008/7/11
    From: Delaware, USA
    I need a refresher to rip the audio from a still mp4 video (audio with still video like from youtube) I used: mplayer audio dump(flash) - mplayer Videofile -dumpaudio -dumpfile RAM:File.mp3
    but the resulting file didn't play
    Is there a better format string or even ffmpeg command?

    ffmpeg -i file:mymorphos:file.mp4 -f mp3 file:ram:file.mp3

    produced an error codec id 86017 not found for output stream #0 0 and placed empty file in ram


    [ Edited by xyphoid on 2010/12/23 11:09 ]
  • »23.12.10 - 14:57
    Profile
  • Butterfly
    Butterfly
    munk
    Posts: 94 from 2006/3/27
    Quote:

    ffmpeg -i file:mymorphos:file.mp4 -f mp3 file:ram:file.mp3



    First you should find out which audio format is used by the video. If it is a mp4 then it probably uses AAC. In any case use "-acodec copy" to extract the audio track from the video and remove the "-f ..."option.
    FWIW, it might be better to strip the video part because raw AAC cannot use mp3 tags. This is only possible with a (mp4) container.
  • »23.12.10 - 15:58
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    xyphoid
    Posts: 870 from 2008/7/11
    From: Delaware, USA
    did "ffmpeg -acodec file:mymorphos:inloveatchristmas.mp4 mp3 file:ram:inlove.mp3"
    and got "unable to find a suitable output for mp3"
  • »23.12.10 - 22:22
    Profile
  • Butterfly
    Butterfly
    pecanK
    Posts: 70 from 2004/11/5
    From: Czech Republic...
    Some time ago I ripped audio from dvd with Mplayer directly from gui,with no need of shell. Output format was something like wav and then I easily converted it to mp3 with Lame. I am on the train now but when I am home today or tommorrow I 'm going to write you exactly how to do it (if it is possible for mp4 files as well)
    pecaN of the Czech PowerPC User Group
  • »24.12.10 - 07:22
    Profile
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    @xyphoid

    The mp3lame support (mp3 encoder) was likely forgotten in the ffmpeg build. ffmpeg still comes with many builtin audio encoders. You could try saving as wav and use lame on the output.
  • »24.12.10 - 07:50
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Amigaharry2
    Posts: 1282 from 2010/1/6
    From: EU-Austria (Wien)
    There is a simple way to decode/encode nearly almost any video-formats to mp3 with MENCODER!

    I've written a small, primitive Arexx-script which you can use.......
    Be carefull with amplification - in most cases you need only "1" - you'll have to play a little bit with......

    /*Video2MP3 by KBS ®2010*/

    /* Note: Ram Disk must be named as RAM_DISK. It is possible to set an assign RAM_DISK: to "RAM DISK"
    MP3 will always saved in source-file directory. The name (file.xxx) will automatically changed
    to file.mp3. MENCODER has to be in following path: sys:utilities/mplayer/mencoder
    If not - change path in arexx-programm!
    */

    /*---------Öffne Fenster */
    open('out','syscon:300/100/800/300/Video2mp3/close')
    call writeln 'out','VIDEO to MP3 - Decode videostreams and extract MP3....! (®KbS. 2010)'
    call writeln 'out',''
    call writeln 'out','Attention: MP3-file will be stored in same directory as source-file!'

    /*---------lade Filmdatei */
    address command 'requestfile > env:getvideo title "Choose video-file......"'
    open(getvideo,'env:getvideo')
    answer=readln(getvideo)

    /*----------Brich ab wenn keine Datei gewählt */
    if answer='""'
    then do
    call writeln 'out',''
    call writeln 'out','No file - break! - Press ENTER!'
    call readln 'out'
    exit
    end

    else do

    /*----------hole Dateinamen */
    Videoname=strip(translate(answer,'','"'))
    Videoname=space(Videoname,1,'_');
    close(getvideo)
    address command 'delete env:getvideo quiet'

    /*---------wähle Audioverstärkung*/
    address command 'requestchoice > env:getnum "Volume" "amplification (default=1, no amplification)" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10"'
    open(getnum,'env:getnum')
    k=readln(getnum)
    close(getnum)
    address command 'delete env:getnum quiet'
    if k='' then k=1 ;/*defaultwert ist 1*/

    /*---------Erzeuge Name.mp3 aus Filmnamen...*/
    i=length(Videoname);say
    Zieldatei = delstr(Videoname,i-3)||'.mp3'

    /*---------Encodiere MP3 mit MENCODER (Achtung auf Pfad zu Mencoder) */
    call writeln 'out','Encoding ' answer ' to "' Zieldatei '" with amplification ' k
    call writeln 'out','Please wait......'; call writeln 'out', ''
    address command 'sys:utilities/mplayer/mencoder' answer '-ovc raw -of rawaudio -oac mp3lame -lameopts vol='k':cbr:br=128 -o 'Zieldatei; call writeln 'out',''

    /*---------Beenden */
    call writeln 'out','Ready! - new MP3-file >' Zieldatei '< writen.'
    call writeln 'out','Press ENTER to stop! ';call writeln 'out',''
    call readln 'out'
    end

    If you wish different quality of mp3: Increase/drecrease bitrate in MENCODER-command line......
    You can use this script in Ambient-custom-menu (with Crabum) - very usefull!
    Peg2, 3xPowerMac G5, 2xPowerbookG4, 2x MacMiniG4, Efika (again), A3000T and life is never boring.....
  • »24.12.10 - 12:32
    Profile
  • Butterfly
    Butterfly
    pecanK
    Posts: 70 from 2004/11/5
    From: Czech Republic...
    Ok xyphoid,it works as i said. I tested it with the latest Mplayer release(11.11.2010) and several mp4s. Run Gmplayer,click right mouse button,select "settings" and "preferences". Change audio driver to "pcm" and click "Use". Then load mp4 file. video is being played while sound isn't being played but stored to the Mplayer drawer as "audiodump.wav". Then you can convert it to mp3 with Lame...
    pecaN of the Czech PowerPC User Group
  • »24.12.10 - 20:39
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    xyphoid
    Posts: 870 from 2008/7/11
    From: Delaware, USA
    Simple Solutions! Thanks!
  • »25.12.10 - 08:40
    Profile