0

While I am trying to convert wav file to wma file size is becomes much larger than original source file:

  • input.wav - 11M
  • output.wma - 16M

Is there any way to reduce file size of output file?

Command and output:

$ ffmpeg -i input.wav -c copy output.wma

ffmpeg version N-80797-g8b4d6cc Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 6.1.1 (GCC) 20160501
  configuration: --enable-gpl
  libavutil      55. 27.100 / 55. 27.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 40.101 / 57. 40.101
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 46.102 /  6. 46.102
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'input.wav':
  Metadata:
    encoder         : Lavf57.40.101
  Duration: 00:01:00.00, bitrate: 1411 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s
Output #0, asf, to 'output.wma':
  Metadata:
    WM/EncodingSettings: Lavf57.40.101
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, 1411 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=   16150kB time=00:01:00.00 bitrate=2205.1kbits/s speed=1.9e+03x    
video:0kB audio:10336kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 56.255745%
llogan
  • 121,796
  • 28
  • 232
  • 243
Jinto John
  • 365
  • 4
  • 22
  • How do we duplicate the issue? Does the issue occur if you run the `ffmpeg` command manually, unscripted in a command line interface? Show the complete console output from the `ffmpeg` command. – llogan Jun 24 '16 at 06:46
  • @LordNeckbeard ,hope now u can debug my code..and ' ffmpeg.exe' is an executable solution for getting command line interface. – Jinto John Jun 24 '16 at 06:53
  • See this question : [Reducing video size with same format and reducing frame size](http://stackoverflow.com/questions/4490154/reducing-video-size-with-same-format-and-reducing-frame-size) – Thomas Ayoub Jun 24 '16 at 06:59
  • 1
    You didn't answer my questions, so I can't help. – llogan Jun 24 '16 at 17:33
  • @LordNeckbeard ,,I am not run ffmpeg command manually,I have a .exe file for that – Jinto John Jun 25 '16 at 05:05
  • I asked you to run the command manually so we can determine if the issue is due to `ffmpeg` alone or due to your script. – llogan Jun 25 '16 at 17:41
  • @LordNeckbeard ,tried below code for the same ffmpeg -i recording.wav -acodec copy newrecording.wma – Jinto John Jun 27 '16 at 03:50
  • @LordNeckbeard ffmpeg -i recording.wav -acodec copy newrecording.wma Run the above code and got same issues – Jinto John Jun 27 '16 at 07:21

1 Answers1

3

WMA is crappy. Try changing the packet size. From FFmpeg ASF muxer documentation:

-packet_size
Set the muxer packet size. By tuning this setting you may reduce data fragmentation or muxer overhead depending on your source. Default value is 3200, minimum is 100, maximum is 64k.

Example:

ffmpeg -i input.wav -c copy -packet_size 65536 output_64k.wma

File sizes:

  • input.wav - 11M
  • output_64k.wma - 11M
  • output_default.wma - 16M
llogan
  • 121,796
  • 28
  • 232
  • 243
  • Is there any downside to using a large `packet_size`? Why isn't that the default? (The use-case I care about is files played from disk or NFS, or other seekable media, not streaming.) Does it increase the amount of demuxing / decoding required for a seek to a certain position in a WMV containing video + audio? – Peter Cordes Sep 20 '19 at 22:40
  • @PeterCordes For local(-ish) playback I don't think it matters, I am not aware of any downside, and I don't think it will mess up your seeking. I'm guessing the default is a balance weighted towards steaming usage. You may want to ask on ffmpeg-user: I don't use WMA/ASF, so maybe I'm wrong. – llogan Sep 20 '19 at 23:06