Mozilla Firefox/DownloadHelper

Z Wikiverzity
Skočit na navigaci Skočit na vyhledávání

Mozilla Firefox/DownloadHelper

You Tube[editovat]

Testoval jsem na http://youtube.com

DownloadHelper mi nabídne ke stažení čtyři různé formáty:

  1. .flv
  2. .flv (z cache)
  3. .mp4 [HQ18]
  4. .flv [HQ35]

Jaké jsou délky souborů:

  1. 18M .flv
  2. 31M 1.flv (z cache)
  3. 33M .mp4 [HQ18]
  4. 59M 35.flv [HQ35]


Kvalita souborů[editovat]

Jak identifikuje kvalitu mplayer -msglevel identify=4

.flv[editovat]

VIDEO:  [FLV1]  400x226  0bpp  29.970 fps  263.2 kbps (32.1 kbyte/s)
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=FLV1
ID_VIDEO_BITRATE=263232
ID_VIDEO_WIDTH=400
ID_VIDEO_HEIGHT=226
ID_VIDEO_FPS=29.970
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=85
ID_AUDIO_BITRATE=64000
ID_AUDIO_RATE=22050
ID_AUDIO_NCH=2
ID_LENGTH=450.06
ID_SEEKABLE=1
ID_CHAPTERS=0
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffflv] vfm: ffmpeg (FFmpeg Flash video)
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 22050 Hz, 2 ch, s16le, 8.0 kbit/1.13% (ratio: 1000->88200)
ID_AUDIO_BITRATE=8000
ID_AUDIO_RATE=22050
ID_AUDIO_NCH=2
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
AO: [pulse] 22050Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=mp3

.flv (z cache)[editovat]

VIDEO:  [H264]  640x360  0bpp  29.970 fps  475.4 kbps (58.0 kbyte/s)
ID_FILENAME=Old Roman chant - Inveni David servum meum-1.flv
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=H264
ID_VIDEO_BITRATE=475440
ID_VIDEO_WIDTH=640
ID_VIDEO_HEIGHT=360
ID_VIDEO_FPS=29.970
ID_VIDEO_ASPECT=1.7778
ID_AUDIO_FORMAT=255
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
ID_LENGTH=450.06
ID_SEEKABLE=1
ID_CHAPTERS=0
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
ID_VIDEO_CODEC=ffh264

Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=faad
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.7778
VO: [xv] 640x360 => 640x360 Planar YV12 

.mp4 [HQ18][editovat]

Playing Old Roman chant - Inveni David servum meum.mp4.
VIDEO:  [avc1]  480x270  24bpp  30.000 fps    0.0 kbps ( 0.0 kbyte/s)
ID_FILENAME=Old Roman chant - Inveni David servum meum.mp4
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=avc1
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=480
ID_VIDEO_HEIGHT=270
ID_VIDEO_FPS=30.000
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=255
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
ID_LENGTH=450.10
ID_SEEKABLE=1
ID_CHAPTERS=0
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
ID_VIDEO_CODEC=ffh264

Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=faad
Starting playback...

.flv [HQ35][editovat]

Playing Old Roman chant - Inveni David servum meum-35.flv.
VIDEO:  [H264]  854x480  0bpp  29.970 fps  992.9 kbps (121.2 kbyte/s)
ID_FILENAME=Old Roman chant - Inveni David servum meum-35.flv
ID_DEMUXER=lavfpref
ID_VIDEO_FORMAT=H264
ID_VIDEO_BITRATE=992944
ID_VIDEO_WIDTH=854
ID_VIDEO_HEIGHT=480
ID_VIDEO_FPS=29.970
ID_VIDEO_ASPECT=1.7792
ID_AUDIO_FORMAT=255
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
ID_LENGTH=450.06
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
ID_VIDEO_CODEC=ffh264

Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=faad
VO: [xv] 854x480 => 854x480 Planar YV12 

Konverze do zvuku[editovat]

Zajímá mě jen zvuková nahrávka bez videa. Který soubor zvolit pro konverzi?

  1. 18M .flv - vzorkování 22050 Hz, 2 ch, s16le, 8.0 kbit - horší kvalita
  2. 31M 1.flv (z cache) - vzorkování 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
  3. 33M .mp4 [HQ18] - vzorkování 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
  4. 59M 35.flv [HQ35]- vzorkování 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)

Závěr: Nejkratší flash video má horší kvalitu zvukového záznamu, ostatní videa shodnou. Nabídka .flv z cache není vždy k disposici, délka souboru není o moc kratší než u mp4 HQ18. Soubor HQ35 je téměř dvojnásobně dlouhý, což je dáno vyšším rozlišením obrazu, který nás ale nezajímá. Proto pro konverzi volím mp4 HQ18.

Kliknu pravým vedle DownloadHelperu a zvolím "Konvertovat videa". Zobrazí se mi pouze soubory .flv, nikoli .mp4:

  1. 18M .flv - "Konverze kompletní - Soubor ... se nepodařilo konvertovat"
  2. 31M 1.flv (z cache) - "Konverze kompletní - Soubor ... se nepodařilo konvertovat"
  3. 33M .mp4 [HQ18] - nezobrazí se mezi soubory ke konverzi
  4. 59M 35.flv [HQ35] - "Konverze kompletní - Soubor ... se nepodařilo konvertovat"

Soubory mp3 se vytvořily, ale mají nulovou velikost.

Vypadá to, že asi nemám nainstalovaný nějaký konvertor těch videí. Podívám se na:

Takže ve Firefoxu na:

  • Nástroje -> Správce doplňků -> Předvolby -> Konvertor FFMpeg /usr/bin/ffmpeg

Tak už to mám nastavené, tak v čem je problém?

Konvertovat soubory z (flv) v VŠECHNO do MP3 v VÝCHOZÍ
Konvertovat soubory z (mp4) v VŠECHNO do MP3 v VÝCHOZÍ

Další možnost volby konvertoru je MEncoder /usr/bin/mencoder

  1. 18M .flv - "Konverze kompletní - Soubor ... úspěšně konvertován"
  2. 31M 1.flv (z cache) - "Konverze kompletní - Soubor ... úspěšně konvertován"
  3. 33M .mp4 [HQ18] - "Konverze kompletní - Soubor ... úspěšně konvertován"
  4. 59M 35.flv [HQ35] - "Konverze kompletní - Soubor ... úspěšně konvertován"

Výsledky konverse:

  1. 18M 2009-12-24 03:44 Old Roman chant - Inveni David servum meum-0.mp3
  2. 29M 2009-12-24 03:41 Old Roman chant - Inveni David servum meum-1.mp3
  3. 30M 2009-12-24 03:37 Old Roman chant - Inveni David servum meum.mp3
  4. 54M 2009-12-24 03:42 Old Roman chant - Inveni David servum meum-35.mp3
mp3check -c *mp3
not an audio mpeg stream    Old Roman chant - Inveni David servum meum-0.mp3
not an audio mpeg stream    Old Roman chant - Inveni David servum meum-1.mp3
not an audio mpeg stream    Old Roman chant - Inveni David servum meum.mp3
not an audio mpeg stream    Old Roman chant - Inveni David servum meum-35.mp3
file *mp3
0.mp3:  RIFF (little-endian) data, AVI, 400 x 226, ~30 fps, video:, audio: MPEG-1 Layer 3 (stereo, 22050 Hz)
1.mp3:  RIFF (little-endian) data, AVI, 640 x 360, ~30 fps, video: H.264 X.264 or H.264, audio: (stereo, 44100 Hz)
.mp3:    RIFF (little-endian) data, AVI, 480 x 270, 30.00 fps, video:
35.mp3: RIFF (little-endian) data, AVI, 854 x 480, ~30 fps, video: H.264 X.264 or H.264, audio: (stereo, 44100 Hz)

Aha, takže to nejsou žádné mp3, ale AVI.

Zkusím konvertovat "ručně":

mencoder $vstupnisoubor -of rawaudio -oac copy -ovc copy -o $vystupnisoubor
 man mencoder

   -of <format> (BETA CODE!)
        Encode to the specified container format (default: AVI).
        NOTE: Use -of help to get a list of available container formats.
   -of rawaudio  raw audio stream (no muxing - one audio stream only)

   -oac <codec name>
        Encode with the given audio codec (no default set).
        NOTE: Use -oac help to get a list of available audio codecs.
        EXAMPLE:
           -oac copy
                no encoding, just streamcopy
   -ovc <codec name>
         Encode with the given video codec (no default set).
         NOTE: Use -ovc help to get a list of available video codecs.
         EXAMPLE:
           -ovc copy
                no encoding, just streamcopy


Výsledek:

ls -l *mp3
3391052  Old Roman chant - Inveni David servum meum-0.mp3
5229036  Old Roman chant - Inveni David servum meum-1.mp3
5222999  Old Roman chant - Inveni David servum meum_mp4.mp3
5229036  Old Roman chant - Inveni David servum meum-35.mp3
file *mp3
Old Roman chant - Inveni David servum meum-0.mp3:   MPEG ADTS, layer III, v2,   8 kbps, 22.05 kHz, JntStereo
Old Roman chant - Inveni David servum meum-1.mp3:   data
Old Roman chant - Inveni David servum meum_mp4.mp3: data
Old Roman chant - Inveni David servum meum-35.mp3:  data
mp3check -c *mp3
L3 22   8 js n -O- -  56:31 Old Roman chant - Inveni David servum meum-0.mp3
not an audio mpeg stream    Old Roman chant - Inveni David servum meum-1.mp3
not an audio mpeg stream    Old Roman chant - Inveni David servum meum_mp4.mp3
not an audio mpeg stream    Old Roman chant - Inveni David servum meum-35.mp3
mencoder $vstupnisoubor -of rawaudio -oac mp3lame -ovc copy -o $vystupnisoubor


MEncoder SVN-r29237-4.4.1 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x1eebc66
libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO:  [H264]  640x360  0bpp  29.970 fps  475.4 kbps (58.0 kbyte/s)
[V] filefmt:44  fourcc:0x34363248  size:640x360  fps:29.970  ftime:=0.0334
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
Ignoring video stream!
videocodec: framecopy (640x360 0bpp fourcc=34363248)
MP3 audio selected.
Pos:   0.7s     22f ( 0%)  0.00fps Trem:   0min   5mb  A-V:0.070 [0:212]
Skipping frame!
Pos:   1.1s     34f ( 0%)  0.00fps Trem:   1min   7mb  A-V:0.067 [854:216]
Skipping frame!
...
Pos: 449.9s  13502f (100%) 138.41fps Trem:   0min  11mb  A-V:0.056 [462:213]
Video stream:  462.907 kbit/s  (57863 B/s)  size: 26031761 bytes  449.883 secs  13502 frames
Audio stream:  213.502 kbit/s  (26687 B/s)  size: 12017468 bytes  450.299 secs
$ mencoder Old\ Roman\ chant\ -\ Inveni\ David\ servum\ meum.mp4 -of rawaudio -oac mp3lame -ovc copy -o Old\ Roman\ chant\ -\ Inveni\ David\ servum\ meum-mp4.mp3
MEncoder SVN-r29237-4.4.1 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x208f80d
libavformat file format detected.
[lavf] Audio stream found, -aid 0
[lavf] Video stream found, -vid 1
VIDEO:  [avc1]  480x270  24bpp  30.000 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44  fourcc:0x31637661  size:480x270  fps:30.000  ftime:=0.0333
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
Ignoring video stream!
videocodec: framecopy (480x270 24bpp fourcc=31637661)
MP3 audio selected.
Pos:   0.7s     21f ( 0%)  0.00fps Trem:   0min   3mb  A-V:0.067 [0:212]
Skipping frame!
Pos:   1.1s     34f ( 0%)  0.00fps Trem:   0min   5mb  A-V:0.067 [615:215]
Skipping frame!
Pos: 448.1s  13446f (99%) 138.99fps Trem:   0min  11mb  A-V:0.070 [500:214]
Skipping frame!
Pos: 448.4s  13456f (99%) 139.05fps Trem:   0min  11mb  A-V:0.070 [500:214]
Skipping frame!
Pos: 448.7s  13466f (99%) 139.10fps Trem:   0min  11mb  A-V:0.070 [500:213]
Skipping frame!
Pos: 449.1s  13477f (99%) 139.16fps Trem:   0min  11mb  A-V:0.067 [501:213]
Skipping frame!
Pos: 449.9s  13502f (100%) 139.37fps Trem:   0min  11mb  A-V:0.026 [501:213]
Video stream:  501.695 kbit/s  (62711 B/s)  size: 28211968 bytes  449.867 secs  13502 frames

Audio stream:  213.681 kbit/s  (26710 B/s)  size: 12015700 bytes  449.855 secs


mp3check -c *mp3
L3 22   8 js n -O- -  56:31 Old Roman chant - Inveni David servum meum-0.mp3
l3 44  32 js n -O- -  50:04 Old Roman chant - Inveni David servum meum-1.mp3
l3 44  32 js n -O- -  50:03 Old Roman chant - Inveni David servum meum-mp4.mp3
l3 44  32 js n -O- -  50:04 Old Roman chant - Inveni David servum meum-35.mp3


Další utility[editovat]

Ještě zkusím:

  • serpentine - hlásí "Nepodařilo se konvertovat soubory"
  • nautilus-script-audio-convert
  • sox
  • xcfa


skript[editovat]

#! /bin/bash
#
# mp44wav = converts all MP4 files in the current directory to wav
#
for f in *.MP4; do
  newname=`echo $f | tr ' ' '_' `
  mv "$f" $newname
  f=$newname
  mplayer $f -ao pcm:file=${f/.MP4/.wav}
done