0

I have a django app and use a call to subprocess.call('avconv -i ' + fileName + ' ' + fileNew, shell=True). The input file is a .3gp file which has only aac mono audio stream converted to an .ogg file. Conversion succeeds, but the new file seems to be damaged and audio will not play.

Here is what I got after trying to get information for one of the input files:

xxx:/workspace/build$ avconv -i audio.3gp
avconv version 0.8.10-4:0.8.10-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
  built on Feb  6 2014 20:56:59 with gcc 4.6.3
audio.3gp: Invalid data found when processing input

Here is the successful convert:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/workspace/multi-device-audio-project/webapp/../static/data/matpat.3gp':
  Metadata:
    major_brand     : 3gp4
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 2014-02-17 10:53:36
  Duration: 00:00:20.60, start: 0.000000, bitrate: 13 kb/s
    Stream #0.0(eng): Audio: aac, 8000 Hz, mono, s16, 12 kb/s
    Metadata:
      creation_time   : 2014-02-17 10:53:36
Output #0, ogg, to '/workspace/multi-device-audio-project/webapp/../static/data/matpat.ogg':
  Metadata:
    major_brand     : 3gp4
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 2014-02-17 10:53:36
    encoder         : Lavf53.21.1
    Stream #0.0(eng): Audio: flac, 8000 Hz, mono, s16, 200 kb/s
    Metadata:
      creation_time   : 2014-02-17 10:53:36
Stream mapping:
  Stream #0:0 -> #0:0 (aac -> flac)
Press ctrl-c to stop encoding
size=     216kB time=20.66 bitrate=  85.5kbits/s
video:0kB audio:214kB global headers:0kB muxing overhead 0.612994%

Here is one of the sample files: link

The following usage strings also return me an error : audio.3gp: Invalid data found when processing input::

avconv -i audio.3gp -vn -acodec libvorbis -aq 50 audio.ogg
avconv -i audio.3gp -acodec vorbis audio.ogg

Could the input files be broken, I think they are recorded on a Nexus 7?

4

1 回答 1

0

最后,我能够发现问题的根源。正如我所料,.3gp 文件没有正确创建,因为它们只包含音频信息,导致 avconv 无法识别和转换它们。更改应用程序以使用 .aac 解决了该问题。

于 2014-02-25T23:07:06.980 回答