actionchaos
(usa KUbuntu)
Enviado em 01/07/2012 - 00:54h
Olá comunidade linux.
Essa é a primeira vez que peço ajuda em uma comunidade sobre linux, pois antes sempre encontrava uma solução ou material na internet (a maioria no VOL) mesmo que a resposta fosse "não dá pra fazer isso".
Problema:
Estou tentando converter um vídeo para rodar em meu celular Samsung GT-C3510.
Passos que segui:
1) Instalei o MediaInfo (para ver as configurações do vídeo) e o
Hyper Video Converter e converti o vídeo para 3gp com resolução de
176x144.
#OBS: Com o MediaInfo vi que o codec de vídeo dos vídeos que
rodam no meu celular é o H.263 (ou h263 no ffmpeg e no avconv) só
que esse codec nao suporta a resolução de 320x240 (tela cheia no meu
celular). Com a resolução 352x288 os vídeos não rodam no celular.
2) Usando o programa que vem com o celular (PC studio rodando no
Windows, claro) converti um vídeo que baixei no youtube para .3gp
e para .mp4. Em .3gp o programa também não consegue a resolução de
320x240 mas no formato .mp4 ele conseguiu e rodou perfeito no celular
(em tela cheia). Veja a descrição do arquivo gerado pelo programa
no fim desse texto (MediaInfo-Descrição).
3) Apartir desse arquivo comecei a fazer testes. Como o Hyper Video
Converter gera o código para executar direto ou copiar e colar num
terminal acabei aprendendo um pouco do ffmpeg.
4) Como o arquivo "PCstudio_Battlefield 3 PS3.mp4" apresenta o codec
H.263 na descrição (MediaInfo-Descrição) e ao tentar a resolução
320x240 o ffmpeg/avconv diz que esse codec não suporta e que posso
tentar o H.263+ (h263p no ffmpeg/avconv), passei a testar o codec
h263p.
5) Os comandos e os erros estão resumidos abaixo e completos no fim
desse texto.
## Teste com o FFMPEG
$ ffmpeg -i "Battlefield 3 PS3[da net].mp4" -vcodec h263p -s 320x240 -aspect 4:3 -r 15000 -acodec libvo_aacenc -ab 92k -ar 44100 -ac 2 "Battlefield 3 PS3[HVC].mp4"
Saída (Erro resumido):
[mp4 @ 0x839c3a0] track 0: could not find tag, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?)
##########
## Teste com o AVCONV
$ avconv -i "Battlefield 3 PS3[da net].mp4" -vcodec h263p -s 320x240 -aspect 4:3 -r 15000 -acodec libvo_aacenc -ab 92k -ar 44100 -ac 2 "Battlefield 3 PS3[HVC].mp4"
Saída (Erro resumido):
[h263p @ 0x89a45e0] multi threaded encoding not supported by codec
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
##########
6) Pessoal se alguém souber os comandos certos para converter o arquivo para que tenha as configurações parecidas com o arquivo descrito pelo MediaInfo, por favor me ajudem.
<MediaInfo-Descrição>
General
Complete name : /media/3861-3662/Videos/PCstudio_Battlefield 3 PS3.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 15.4 MiB
Duration : 4mn 7s
Overall bit rate mode : Variable
Overall bit rate : 521 Kbps
Encoded date : UTC 2012-06-30 01:56:52
Tagged date : UTC 2012-06-30 02:00:00
Video
ID : 2
Format : MPEG-4 Visual
Format profile : Simple@L3
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : 20
Duration : 4mn 7s
Bit rate mode : Variable
Bit rate : 420 Kbps
Maximum bit rate : 692 Kbps
Width : 320 pixels
Height : 240 pixels
Display aspect ratio : 4:3
Frame rate mode : Variable
Frame rate : 14.850 fps
Original frame rate : 15.000 fps
Minimum frame rate : 14.837 fps
Maximum frame rate : 14.859 fps
Color space : YUV
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.368
Stream size : 12.4 MiB (81%)
Language : English
Encoded date : UTC 2012-06-30 01:56:52
Tagged date : UTC 2012-06-30 02:00:00
Audio
ID : 1
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 4mn 7s
Bit rate mode : Variable
Bit rate : 96.0 Kbps
Maximum bit rate : 109 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 2.83 MiB (18%)
Language : English
Encoded date : UTC 2012-06-30 01:56:52
Tagged date : UTC 2012-06-30 02:00:00
Material_Duration : 247687
Material_StreamSize : 2972727
</MediaInfo-Descrição>
<TENTATIVA COM FFMPEG>
$ ffmpeg -i "Battlefield 3 PS3[da net].mp4" -vcodec h263p -s 320x240 -aspect 4:3 -r 15000 -acodec libvo_aacenc -ab 92k -ar 44100 -ac 1 "Battlefield 3 PS3[HVC].mp4"
ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
built on Jun 12 2012 16:37:58 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Battlefield 3 PS3[da net].mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2012-02-01 20:35:22
Duration: 00:04:07.78, start: 0.000000, bitrate: 2996 kb/s
Stream #0.0(und): Video: h264 (High), yuv420p, 1280x720, 2843 kb/s, 29.97 fps, 29.97 tbr, 60k tbn, 59.94 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 150 kb/s
Metadata:
creation_time : 2012-02-01 20:35:22
File 'Battlefield 3 PS3[HVC].mp4' already exists. Overwrite ? [y/N] y
[buffer @ 0x8386de0] w:1280 h:720 pixfmt:yuv420p
[scale @ 0x8387160] w:1280 h:720 fmt:yuv420p -> w:320 h:240 fmt:yuv420p flags:0x4
[mp4 @ 0x839c3a0] track 0: could not find tag, codec not currently supported in container
Output #0, mp4, to 'Battlefield 3 PS3[HVC].mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2012-02-01 20:35:22
encoder : Lavf53.21.0
Stream #0.0(und): Video: h263p, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 15k tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Stream #0.1(und): Audio: libvo_aacenc, 44100 Hz, 1 channels, s16, 92 kb/s
Metadata:
creation_time : 2012-02-01 20:35:22
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Could not write header for output file #0 (incorrect codec parameters ?)
</TENTATIVA COM FFMPEG>
<TENTATIVA COM AVCONV>
$ avconv -i "Battlefield 3 PS3[da net].mp4" -vcodec h263p -s 320x240 -aspect 4:3 -c -ab 92k -ar 44100 -ac 1 "Battlefield 3 PS3[HVC].mp4"
avconv version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
built on Jun 12 2012 16:37:58 with gcc 4.6.3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Battlefield 3 PS3[da net].mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2012-02-01 20:35:22
Duration: 00:04:07.78, start: 0.000000, bitrate: 2996 kb/s
Stream #0.0(und): Video: h264 (High), yuv420p, 1280x720, 2843 kb/s, 29.97 fps, 29.97 tbr, 60k tbn, 59.94 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 150 kb/s
Metadata:
creation_time : 2012-02-01 20:35:22
File 'Battlefield 3 PS3[HVC].mp4' already exists. Overwrite ? [y/N] y
[buffer @ 0x89a44e0] w:1280 h:720 pixfmt:yuv420p
[scale @ 0x8996aa0] w:1280 h:720 fmt:yuv420p -> w:320 h:240 fmt:yuv420p flags:0x4
[h263p @ 0x89a45e0] multi threaded encoding not supported by codec
Output #0, mp4, to 'Battlefield 3 PS3[HVC].mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2012-02-01 20:35:22
Stream #0.0(und): Video: h263p, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 15k tbc
Metadata:
creation_time : 1970-01-01 00:00:00
Stream #0.1(und): Audio: [0][0][0][0] / 0x0000, 44100 Hz, 1 channels, s16, 200 kb/s
Metadata:
creation_time : 2012-02-01 20:35:22
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> h263p)
Stream #0:1 -> #0:1 (aac -> libvo_aacenc)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
</TENTATIVA COM AVCONV>