Extraire la partie son d'une vidéo youtube

Résolu/Fermé
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 - 1 mai 2008 à 14:39
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 - 25 avril 2012 à 15:11
Bonjour,

en suivant ceci :
http://forums.fedoraforum.org/forum/showthread.php?p=1004207#post1004207
ou "comment télécharger des vidéos youtube et extraire uniquement le son",.

Je reproduis donc ici, à l'identique les manipulations pour extraire la partie audio ....manipulations que voici :


première méthode :

[redfox@fedora8 Bureau]$ mplayer -dumpaudio myvideo.flv
MPlayer 1.0rc2-4.1.2 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Celeron(R) CPU 2.80GHz (Family: 15, Model: 4, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing myvideo.flv.
libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO: [FLV1] 320x240 0bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
Core dumped

Exiting... (End of file)
[redfox@fedora8 Bureau]$


il semble qu'il y ait un gros problème...mais pourtant, et, de façon intéressante, s'est créé un fichier nommé "stream.dump".
Je peux l'écouter en passant simplement la souris sur l'icône du fichier (ou en l'écoutant avec tout lecteur) !


deuxième méthode :

[redfox@fedora8 Bureau]$ ffmpeg -i myvideo.flv -f mp3 -vn -acodec copy myvideo.mp3
FFmpeg version SVN-r10703, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --arch=i386 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables --enable-liba52 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libogg --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libx264 --enable-pp --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-opts --disable-strip
libavutil version: 49.5.0
libavcodec version: 51.45.0
libavformat version: 51.14.0
built on Oct 18 2007 03:11:06, gcc: 4.1.2 20070925 (Red Hat 4.1.2-31)

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, flv, from 'myvideo.flv':
Duration: 00:05:00.0, start: 0.000000, bitrate: 56 kb/s
Stream #0.0: Video: flv, yuv420p, 320x240, 25.00 fps(r)
Stream #0.1: Audio: mp3, 22050 Hz, mono, 56 kb/s
Output #0, mp3, to 'trumpet.mp3':
Stream #0.0: Audio: libmp3lame, 22050 Hz, mono, 56 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
size= 2321kB time=300.0 bitrate= 63.4kbits/s
video:0kB audio:2321kB global headers:0kB muxing overhead 0.001347%
[redfox@fedora8 Bureau]$


ça marche chez moi; j'obtiens bien un fichier myvideo.mp3 que je peux écouter en passant simplement la souris sur l'icône du fichier (ou en l'écoutant via un lecteur).

si on jette un oeil :
[redfox@fedora8 Bureau]$ ls -l stream.dump myvideo.mp3
-rw-rw-r-- 1 redfox redfox 2376318 mai 1 14:04 stream.dump
-rw-rw-r-- 1 redfox redfox 2376350 mai 1 14:19 myvideo.mp3
[redfox@fedora8 Bureau]$


ce qui est "intéressant" c'est la taille quasi identique des 2 fichiers !

je suppose que je dois regarder du côté de "mplayer" ....pour commencer ...

:-))
A voir également:

11 réponses

vous pouvez utilisez ca c'est plus simple http://listentoyoutube.com/

en esperant que ca aide !!
5
=O c'est génial ton truc!!!!!
0
Amazing ;) très utile !
0
Awesome, thanks a lot!!!
0
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 472
25 avril 2012 à 15:11
Clic ! Clic ! Clic ! ... Windowsiens va ! ;-)

N'oubliez pas que vous êtes sur un forum Linux et que le post date de 2008 ...^^
0
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 472
2 mai 2008 à 21:55
petit rajout pour moi :

[root@fedora8 ~]# yum list | grep mplayer | grep installed
mplayer.i386 1.0-0.90.rc2.lvn8 installed
mplayer-gui.i386 1.0-0.90.rc2.lvn8 installed
[root@fedora8 ~]#

autre rajout:
Convert .flv to .avi
mencoder -oac copy -ovc copy -o file.avi file.flv
-1
salut j'ai tente d'utiliser la methode avec ffmpeg
mais voila que j'ai comme erreur format unknown. pourtant en faisant ffmpeg -formats je vois bien avi dans la liste
-1
@ opening post: " il semble qu'il y ait un gros problème...mais pourtant, et, de façon intéressante, s'est créé un fichier nommé "stream.dump".
Je peux l'écouter en passant simplement la souris sur l'icône du fichier (ou en l'écoutant avec tout lecteur) ! "

En fait ce qu'il s'est probablement passé c'etait qu'aucun fichier de sortie n'a été spécifié, donc mplayer n'a fait que dumper la partie audio de la flv dans un fichier .dump :)

par exemple, si je fais

$ mplayer -dumpaudio -dumpfile audio.mp3 video.flv

il me le dump tout propre dans un fichier audio.mp3 ^_^
-1

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 472
20 juin 2009 à 21:27
$ mplayer -dumpaudio -dumpfile audio.mp3 video.flv

ha ben oui ............................. après + de 6 mois de retard !

effectivement dans le premier lien donné dans mon post n°7, on donne la commande suivante :
mplayer -dumpaudio my_video_file.avi -dumpfile extracted_audio.mp3


et comme le dit le sage dicton : "mieux vaut tard que jamais" .... alors, merci !
-1
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 472
21 juin 2009 à 22:21
extraire une image d'une video avec ffmpeg :

http://www.kookyoo.net/...

voir aussi :
http://www.kookyoo.net/...
-1
-1
jeanbi Messages postés 15118 Date d'inscription samedi 9 décembre 2006 Statut Contributeur Dernière intervention 6 février 2023 2 177
1 mai 2008 à 17:51
bonjour,
as tu essayer avec avidemux
a+
-2
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 472
1 mai 2008 à 19:41
non, jamais essayé !
en fait c'est la partie extraction qui m'intéresse !
comme je connaissais un peu ffmpeg (à partir du dépôt livna, comme mencoder)

mais je l'essaierai à l'occasion ...


bien je n'ai plus qu'à me prendre la tête pour comprendre pourquoi mplayer "plante" !


ps : sinon pour télécharger et manipuler des vidéos (youtube, DailyMotion, Google video, ....) ....... il y a ceci :
(c'est en anglais mais je pense que c'est assez explicite)

i like to use E.M. Youtube video download tool
it's powerful and easy to use.
Has the best way to search,download,covert ,repair and play flv video.

It can seach any flash video from many websites at the same time ,download youtube video fastly and easily, convert flv video to any audio include MP3, wma,wav,ac3,mmf,amr,ogg,aac..., to any video formats include 3gp,avi,wmv, mpg,mpg4,asf,swf,h264,mov,jpg, that can be support by psp,ipod,iphone,zune,cellphone,digital camera,DV,CD/DVD/VCD/SVCD.

It still can repiar and capture RTMP video streams.

U download it here:

http://www.effectmatrix.com/Youtube_video_download_tool/index.htm

source : http://forums.fedoraforum.org/forum/showthread.php?t=155668&highlight=download+youtube+videos

:-))
-2
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 472
1 mai 2008 à 20:23
ok ! en vrac :

nom du fichier video : "making_a_trumpet-Yl8qfu-ojTQ.avi"

[redfox@fedora8 Bureau]$ mplayer making_a_trumpet-Yl8qfu-ojTQ.avi
MPlayer 1.0rc2-4.1.2 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Celeron(R) CPU 2.80GHz (Family: 15, Model: 4, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing making_a_trumpet-Yl8qfu-ojTQ.avi.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO: [XVID] 320x240 12bpp 25.000 fps 451.2 kbps (55.1 kbyte/s)
Clip info:
Software: MEncoder 1.0rc2-4.1.2
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 22050 Hz, 2 ch, s16le, 8.0 kbit/1.13% (ratio: 1000->88200)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [alsa] 22050Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 320 x 240 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 320x240 => 320x240 Planar YV12
A: 299.8 V: 299.8 A-V: -0.014 ct: 0.242 7496/7496 2% 0% 0.5% 4 0

Exiting... (End of file)
[redfox@fedora8 Bureau]$


on peut bidouiller son fichier ~/.mplayer/config
en collant le code ci-dessous :
vo = gl2  ## active la sortie gl2
double = yes  ## double buffering
fs=yes ## démarre la vidéo en plein écran
fixed-vo=yes ## maintient la vidéo en plein écran lors d'un changement de fichier


nom du fichier : "making_a_trumpet.avi"
[redfox@fedora8 Bureau]$ mplayer making_a_trumpet.avi
MPlayer 1.0rc2-4.1.2 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Celeron(R) CPU 2.80GHz (Family: 15, Model: 4, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing making_a_trumpet.avi.
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO: [FMP4] 320x240 24bpp 25.000 fps 205.9 kbps (25.1 kbyte/s)
Clip info:
Software: Lavf51.14.0
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 64.0 kbit/4.17% (ratio: 8000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 320 x 240 (preferred colorspace: Planar YV12)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[swscaler @ 0x876e990]SwScaler: using unscaled yuv420p -> bgr24 special converter
VO: [gl2] 320x240 => 320x240 BGR 24-bit [fs]
[gl2] You have OpenGL >= 1.2 capable drivers, GOOD (16bpp and BGR is ok!)
[gl2] antialiasing off
[gl2] bilinear linear
No bind found for key 'MOUSE_BTN2'. 5% 2 0
A: 23.1 V: 23.1 A-V: -0.000 ct: 0.004 578/578 3% 11% 0.5% 2 0
Exiting... (Quit) ...............................................................................................en faisant Echap
[redfox@fedora8 Bureau]$

car je sais pas comment revenir à la taille "normale" proprement ...

bref mplayer marche, bien que je retrouve les mêmes messages d'erreur !

enfin je pense que la commande mplayer -dumpaudio est foireuse !

mplayer semble tout faire :
How to Backup a DVD
https://help.ubuntu.com/community/BackupDVD
-2
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 472
2 sept. 2008 à 18:38
enfin je pense que la commande mplayer -dumpaudio est foireuse !

voir ici :
https://www.google.fr/?gws_rd=ssl

toujours ffmpeg et/ou mencoder (toujours en ligne de commande) :
http://linuxmonitor.net
0
bob031 Messages postés 8158 Date d'inscription samedi 7 août 2004 Statut Membre Dernière intervention 1 septembre 2014 472
1 mai 2008 à 21:19
car je sais pas comment revenir à la taille "normale" proprement ...

en tapant la lettre f sur le clavier .... tout est dans man mplayer

FIN !
-2