(AYU)Convirtiendo flv a avi para el mp4

Publicado por Nadius, Febrero 27, 2010, 20:50:09

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Nadius

Gente, hace poco me compré, (bah, me compraron) un mp4 Philips model MP-9200 de 2gb de capacidad.
El problema es que cuando quiero convertir cualquier archivo de video a formato avi, no importa la forma en que lo haga, siempre salta el mensaje "error formato de archivo".
Ya probé con el software que vino con el aparatito, pero solo convierte 6 segundos del video original, y aún así no se reproduce en el mp4.

Como el Gspot no funciona ni con wine, instalé el mediainfo para obtener información de un video de ejemplo, para darme una idea de los códecs a usar.

mediainfo '/media/disk-1/Snowboard_2401.avi'
General
Complete name                    : /media/disk-1/Snowboard_2401.avi
Format                           : AVI
Format/Info                      : Audio Video Interleave
File size                        : 2.20 MiB
Duration                         : 28s 526ms
Overall bit rate                 : 648 Kbps
Writing application              : MEncoder Sherpya-MinGW-20060312-4.1.0
Writing library                  : MPlayer

Video
ID                               : 0
Format                           : MPEG-4 Visual
Format profile                   : Simple@L3
Format settings, BVOP            : No
Format settings, QPel            : No
Format settings, GMC             : No warppoints
Format settings, Matrix          : Default (H.263)
Codec ID                         : XVID
Codec ID/Hint                    : XviD
Duration                         : 28s 364ms
Bit rate                         : 510 Kbps
Width                            : 320 pixels
Height                           : 240 pixels
Display aspect ratio             : 4:3
Frame rate                       : 22.000 fps
Resolution                       : 24 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.302
Stream size                      : 1.72 MiB (78%)
Writing library                  : XviD 1.1.0 (UTC 2005-11-22)

Audio
ID                               : 1
Format                           : MPEG Audio
Format version                   : Version 1
Format profile                   : Layer 2
Codec ID                         : 50
Duration                         : 28s 526ms
Bit rate mode                    : Constant
Bit rate                         : 128 Kbps
Channel(s)                       : 2 channels
Sampling rate                    : 44.1 KHz
Resolution                       : 16 bits
Stream size                      : 446 KiB (20%)
Alignment                        : Split accross interleaves
Interleave, duration             : 26 ms (0.57 video frame)
Interleave, preload duration     : 522 ms


Por ejemplo, trato con este video. Bajo el video con el formato flv, con un plugin para Firefox llamado Download Helper.
Primero trato de convertirlo el flv a avi usando el mencoder.
mencoder /media/disk-1/Videos/Monty\ Python\ and\ the\ Holy\ Grail\ in\ Lego\ HQ.flv -o /media/disk-1/Videos/Monty\ Python\ and\ the\ Holy\ Grail\ in\ Lego\ HQ.avi -oac lavc acodec=mp2 abitrate=128 -ovc xvid vcodec=libxvid
MEncoder 2:1.0~rc2-0ubuntu13.1+medibuntu1 (C) 2000-2007 MPlayer Team
CPU: AMD Sempron(tm) Processor LE-1100 (Family: 15, Model: 127, Stepping: 1)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 0  data: 0x0 - 0x3b781f
libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO:  [FLV1]  320x180  0bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44  fourcc:0x31564C46  size:320x180  fps:25.00  ftime:=0.0400
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 22050 Hz, 2 ch, s16le, 64.0 kbit/9.07% (ratio: 8000->88200)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
xvid: using library version 1.1.2 (build xvid-1.1.2)
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: [ffflv] vfm: ffmpeg (FFmpeg Flash video)
==========================================================================
[mp2 @ 0x8815750]bitrate 224 is not allowed in mp2
Couldn't open codec mp2, br=224.

Exiting...

Como obtengo un archivo de 0,0kb, entonces pruebo con el ffmpeg.

ffmpeg -i /media/disk-1/Videos/Monty\ Python\ and\ the\ Holy\ Grail\ in\ Lego\ HQ.flv -vcodec xvid -acodec mp2 -ab 128 /media/disk-1/Videos/Monty\ Python\ and\ the\ Holy\ Grail\ in\ Lego\ HQ.avi
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-libmp3lame --enable-libfaadbin --enable-libfaad --enable-libfaac --enable-xvid --enable-x264 --enable-liba52 --enable-amr_nb --enable-amr_wb --enable-shared --prefix=/usr
  libavutil version: 1d.49.3.0
  libavcodec version: 1d.51.38.0
  libavformat version: 1d.51.10.0
  built on Mar 17 2009 21:37:49, gcc: 4.2.4 (Ubuntu 4.2.4-1ubuntu3)

Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, flv, from '/media/disk-1/Videos/Monty Python and the Holy Grail in Lego HQ.flv':
  Duration: 00:01:36.8, start: 0.000000, bitrate: 64 kb/s
  Stream #0.0: Video: flv, yuv420p, 320x180, 25.00 fps(r)
  Stream #0.1: Audio: mp3, 22050 Hz, mono, 64 kb/s
Output #0, avi, to '/media/disk-1/Videos/Monty Python and the Holy Grail in Lego HQ.avi':
  Stream #0.0: Video: xvid, yuv420p, 320x180, q=2-31, 200 kb/s, 25.00 fps(c)
  Stream #0.1: Audio: mp2, 22050 Hz, mono, 0 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 2422 q=4.0 Lsize=    2555kB time=96.9 bitrate= 216.0kbits/s   
video:2419kB audio:25kB global headers:0kB muxing overhead 4.544194%

Entonces copio el archivo al mp4, pero igual no se reproduce.

¿Alguien tiene idea de qué falla?

¡Gracias!

groboko




Nadius

Cita de: groboko en Febrero 28, 2010, 02:02:41
¿Probaste convertirlo con el vlc?
El VLC en la versión que tengo yo no convierte a avi...  :'(

the98

Podés usar Avidemux.

Sin embargo, probá la siguiente instrucción con mencoder:

mencoder "/media/disk-1/Videos/Monty Python and the Holy Grail in Lego HQ.flv" -o "/media/disk-1/Videos/Monty Python and the Holy Grail in Lego HQ.avi" -oac mp3lame -msglevel all=9 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1200:vhq:vqmin=2:acodec=mp3


Haciendo una prueba rápida, me funcionó perfectamente con esa configuración de codecs.

Si querés usar xvid tendrás que leer el man de mencoder, llegando al final.

Saludos.

Nadius

si, el comando salió como piña... pero el archivo sigue siendo ilegible :'(
Menos mal que lee fácilmente los flv, porque sino estaría frita

the98

Mi mp4 lee solamente .amv. Fijate qué formatos soporta el tuyo.