web-dev-qa-db-ja.com

avconvを使用してmp4からXvid aviに変換しますか?

私は通常、avistreamを使用して、Philips Streamium SLM5500のmp4をXvid AVIに変換します。通常、ビデオとAC3(lav)オーディオの平均ビットレートf 1500kb/sで2パスでMPEG-4 ASP(Xvid)を選択し、変換します正しく。

ただし、スクリプトでプロセスを自動化できるようにavconvを使用しようとしていますが、これを行うとビデオが途切れて途中で再生が停止します。オーディオ変換の欠陥と関係があるのではないかと疑っています。

私が使用しているコマンドは次のとおりです。

avconv -y -i video.mp4 -pass 1 -vtag xvid -c:a ac3 -b:a 128k -b:v 1500k -f avi /dev/null
avconv -y -i video.mp4 -pass 2 -vtag xvid -c:a ac3 -b:a 128k -b:v 1500k -f avi video.avi

Avconvには、途方もない引数の配列があります。私が間違っていることはありますか?ヘッドレスサーバーからavidemuxをスクリプト化する方法はありますか?

コマンドライン出力をご覧ください:

$ avconv -y -i video.mp4 -pass 1 -vtag xvid -an -b:v 1500k -f avi /dev/null
avconv version 0.8.5-6:0.8.5-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Jan 24 2013 14:49:20 with gcc 4.7.2
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2013-02-04 13:53:38
  Duration: 00:44:09.16, start: 0.000000, bitrate: 669 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 720x404 [PAR 1:1 DAR 180:101], 538 kb/s, 25 fps, 25 tbr, 100 tbn, 50 tbc
    Metadata:
      creation_time   : 2013-02-04 13:53:38
    Stream #0.1(und): Audio: ac3, 44100 Hz, stereo, s16, 127 kb/s
    Metadata:
      creation_time   : 2013-02-04 13:53:42
[buffer @ 0x7f4c40] w:720 h:404 pixfmt:yuv420p
Output #0, avi, to '/dev/null':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2013-02-04 13:53:38
    ISFT            : Lavf53.21.1
    Stream #0.0(und): Video: mpeg4, yuv420p, 720x404 [PAR 1:1 DAR 180:101], q=2-31, pass 1, 1500 kb/s, 25 tbn, 25 tbc
    Metadata:
      creation_time   : 2013-02-04 13:53:38
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
Press ctrl-c to stop encoding
frame=66227 fps=328 q=2.0 Lsize=       0kB time=2649.16 bitrate=   0.0kbits/s    
video:401602kB audio:0kB global headers:0kB muxing overhead -100.000000%
$ avconv -y -i video.mp4 -pass 2 -vtag xvid -c:a ac3 -b:a 128k -b:v 1500k -f avi video.avi
avconv version 0.8.5-6:0.8.5-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
  built on Jan 24 2013 14:49:20 with gcc 4.7.2
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2013-02-04 13:53:38
  Duration: 00:44:09.16, start: 0.000000, bitrate: 669 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 720x404 [PAR 1:1 DAR 180:101], 538 kb/s, 25 fps, 25 tbr, 100 tbn, 50 tbc
    Metadata:
      creation_time   : 2013-02-04 13:53:38
    Stream #0.1(und): Audio: ac3, 44100 Hz, stereo, s16, 127 kb/s
    Metadata:
      creation_time   : 2013-02-04 13:53:42
[buffer @ 0x12b4f00] w:720 h:404 pixfmt:yuv420p
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
[mpeg4 @ 0x12b3ec0] [lavc rc] Using all of requested bitrate is not necessary for this video with these parameters.
Output #0, avi, to 'video.avi':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2013-02-04 13:53:38
    ISFT            : Lavf53.21.1
    Stream #0.0(und): Video: mpeg4, yuv420p, 720x404 [PAR 1:1 DAR 180:101], q=2-31, pass 2, 1500 kb/s, 25 tbn, 25 tbc
    Metadata:
      creation_time   : 2013-02-04 13:53:38
    Stream #0.1(und): Audio: ac3, 44100 Hz, stereo, flt, 128 kb/s
    Metadata:
      creation_time   : 2013-02-04 13:53:42
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg4)
  Stream #0:1 -> #0:1 (ac3 -> ac3)
Press ctrl-c to stop encoding
Input stream #0:1 frame changed from rate:44100 fmt:s16 ch:2 to rate:44100 fmt:flt ch:2
frame=66227 fps=284 q=2.2 Lsize=  458486kB time=2649.13 bitrate=1417.8kbits/s    
video:413716kB audio:41393kB global headers:0kB muxing overhead 0.741969%
1

複数のパスを使用する場合、パス1で-anオプションを使用してオーディオを無効にする必要があります。

avconv -y -i video.mp4 -pass 1 -vtag libxvid -an -b:v 1500k -f avi /dev/null
1
riimzzai

製造元によると、Philips SLM5500は WMAまたはMPEGビデオ のいずれかと組み合わせるのが最適です。

その仮定に基づいて、avconvに以下を簡単に使用できます。

avconv -i video.mp4 -c:v mpeg2video -b:v 1500k -c:a mp2 video.mpg

これで作業を開始できます。2パスの設定を適切に調整できます。

1
ThatGuy