[FFmpeg-user] Minimal build to take PAM+WAV and write MPEG1+MP2 in .mpg file

George MacKerron george at mackerron.co.uk
Fri Nov 22 15:13:22 CET 2013


I'm having some trouble generating a minimal build of ffmpeg for a specific purpose: taking some PAM images and a WAV audio file, and encoding and muxing them into MPEG1 video and MP2 audio in an MPG container.

The command I'm using is as follows:
ffmpeg -f image2 -c:v pam -r 1 -i image_%d.pam -f wav -itsoffset 19 -async 1 -i chime.wav -c:v mpeg1video -q:v 4 -c:a mp2 -b:a 64k -r 25 output.mpg

This works using a standard, batteries-included build. (I am in fact doing this in a web browser using this project: http://bgrins.github.io/videoconverter.js/). And I get this output:

ffmpeg version git-2013-11-14-fe4a3f6 Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 14 2013 17:32:14 with emcc (Emscripten GCC-like replacement) 1.7.1 (commit 90dcac551fee69cf284ae4431db949bc69796a1c)
  configuration: --cc=emcc --target-os=none --cpu=generic --arch=x86_64 --disable-ffplay --disable-ffprobe --disable-ffserver --disable-asm --enable-pic --disable-doc --disable-devices --disable-pthreads --disable-w32threads --disable-network --enable-small --disable-hwaccels --disable-parsers --disable-bsfs --disable-debug --disable-zlib
  libavutil      52. 52.100 / 52. 52.100
  libavcodec     55. 41.100 / 55. 41.100
  libavformat    55. 21.100 / 55. 21.100
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.102 /  3. 90.102
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
[pam @ 0xcbab80] Warning: not compiled with thread support, using thread emulation
Input #0, image2, from 'image_%d.pam':
  Duration: 00:00:24.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: pam, rgba, 771x255, 1 fps, 1 tbr, 1 tbn, 1 tbc
[pcm_s16le @ 0xcc2290] Warning: not compiled with thread support, using thread emulation
Guessed Channel Layout for  Input Stream #1.0 : mono
Input #1, wav, from 'chime.wav':
  Metadata:
    artist          : vtkproductions.com
  Duration: 00:00:02.60, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
-async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.
[mpeg1video @ 0xdbe5d0] Warning: not compiled with thread support, using thread emulation
[mp2 @ 0xd8e4c0] Warning: not compiled with thread support, using thread emulation
[pam @ 0xcbab80] Warning: not compiled with thread support, using thread emulation
[pcm_s16le @ 0xcc2290] Warning: not compiled with thread support, using thread emulation
[mpeg @ 0xd8b420] VBV buffer size not set, muxing may fail
Output #0, mpeg, to 'output/output.mpg':
  Metadata:
    encoder         : Lavf55.21.100
    Stream #0:0: Video: mpeg1video, yuv420p, 771x255, q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0:1: Audio: mp2, 44100 Hz, mono, s16, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pam -> mpeg1video)
  Stream #1:0 -> #0:1 (pcm_s16le -> mp2)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=   26 fps= 15 q=4.0 size=       0kB time=00:00:00.96 bitrate=   0.0kbits/s dup=24 drop=0    
[output stream 0:1 @ 0xcb7610] 100 buffers queued in output stream 0:1, something may be wrong.
frame=   51 fps= 17 q=4.0 size=     116kB time=00:00:19.05 bitrate=  49.9kbits/s dup=48 drop=0    
frame=   76 fps= 21 q=4.0 size=     160kB time=00:00:19.05 bitrate=  68.8kbits/s dup=72 drop=0    
frame=  101 fps= 24 q=4.0 size=     212kB time=00:00:19.05 bitrate=  91.1kbits/s dup=96 drop=0    
frame=  126 fps= 27 q=4.0 size=     260kB time=00:00:19.05 bitrate= 111.8kbits/s dup=120 drop=0    
frame=  176 fps= 31 q=4.0 size=     356kB time=00:00:19.05 bitrate= 153.0kbits/s dup=168 drop=0    
frame=  226 fps= 35 q=4.0 size=     452kB time=00:00:19.05 bitrate= 194.3kbits/s dup=216 drop=0    
frame=  276 fps= 38 q=4.0 size=     562kB time=00:00:19.05 bitrate= 241.6kbits/s dup=264 drop=0    
frame=  326 fps= 40 q=4.0 size=     690kB time=00:00:19.05 bitrate= 296.6kbits/s dup=312 drop=0    
frame=  376 fps= 42 q=4.0 size=     836kB time=00:00:19.05 bitrate= 359.3kbits/s dup=360 drop=0    
frame=  426 fps= 43 q=4.0 size=     988kB time=00:00:19.05 bitrate= 424.7kbits/s dup=408 drop=0    
frame=  476 fps= 44 q=4.0 size=    1134kB time=00:00:19.05 bitrate= 487.4kbits/s dup=456 drop=0    
frame=  501 fps= 43 q=4.0 size=    1166kB time=00:00:19.96 bitrate= 478.6kbits/s dup=480 drop=0    
frame=  526 fps= 43 q=4.0 size=    1268kB time=00:00:20.96 bitrate= 495.6kbits/s dup=504 drop=0    
frame=  576 fps= 44 q=4.0 size=    1362kB time=00:00:22.96 bitrate= 486.0kbits/s dup=552 drop=0    
frame=  576 fps= 44 q=4.0 Lsize=    1438kB time=00:00:23.00 bitrate= 512.2kbits/s dup=552 drop=0
video:1257kB audio:169kB subtitle:0 global headers:0kB muxing overhead 0.840617%
exit(0) called 


However, I don't seem to be able to identify the right combination of demuxers, decoders, encoders, and muxers to make a smaller build that supports this. I currently have the following build commands:

cd ffmpeg

emconfigure ./configure --cc="emcc" --target-os=none --cpu=generic --arch=x86_64 --disable-ffplay --disable-ffprobe --disable-ffserver --disable-asm --enable-pic --disable-doc --disable-devices --disable-pthreads --disable-w32threads --disable-network --enable-small --disable-hwaccels --disable-parsers --disable-bsfs --disable-debug --disable-zlib \
    --disable-demuxers --enable-demuxer=image2 --enable-demuxer=wav \
    --disable-decoders --enable-decoder=pam --enable-decoder=pcm_s16le \
    --disable-encoders --enable-encoder=mpeg1video --enable-encoder=mp2 --enable-encoder=h263 \
    --disable-muxers --enable-muxer=mpeg1video \
    --disable-filters --enable-filter=scale

make clean;
emmake make;
emcc --closure 0 -s OUTLINING_LIMIT=100000 -O2 -s VERBOSE=0 -s ASM_JS=0 -s TOTAL_MEMORY=33554432 -v libavutil/*.o libavcodec/*.o libavformat/*.o libavdevice/*.o libswresample/*.o libavfilter/*.o libswscale/*.o *.o -o ../ffmpeg.js --pre-js ../ffmpeg_pre.js --post-js ../ffmpeg_post.js


When I run the same command as above with ffmpeg compiled that way, I get a file with video only. The output is as follows: 

ffmpeg version git-2013-11-19-f99698c Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 22 2013 14:01:53 with emcc (Emscripten GCC-like replacement) 1.7.1 (commit 104654bbc0aa6c917597b68c814888422dfe827f)
  configuration: --cc=emcc --target-os=none --cpu=generic --arch=x86_64 --disable-ffplay --disable-ffprobe --disable-ffserver --disable-asm --enable-pic --disable-doc --disable-devices --disable-pthreads --disable-w32threads --disable-network --enable-small --disable-hwaccels --disable-parsers --disable-bsfs --disable-debug --disable-zlib --disable-demuxers --enable-demuxer=image2 --enable-demuxer=wav --disable-decoders --enable-decoder=pam --enable-decoder=pcm_s16le --disable-encoders --enable-encoder=mpeg1video --enable-encoder=mp2 --enable-encoder=h263 --disable-muxers --enable-muxer=mpeg1video --disable-filters --enable-filter=scale
  libavutil      52. 52.100 / 52. 52.100
  libavcodec     55. 41.100 / 55. 41.100
  libavformat    55. 21.100 / 55. 21.100
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.102 /  3. 90.102
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
[pam @ 0x5b8b80] Warning: not compiled with thread support, using thread emulation
Input #0, image2, from 'image_%d.pam':
  Duration: 00:00:24.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: pam, rgba, 771x255, 1 fps, 1 tbr, 1 tbn, 1 tbc
[pcm_s16le @ 0x5c0290] Warning: not compiled with thread support, using thread emulation
Guessed Channel Layout for  Input Stream #1.0 : mono
Input #1, wav, from 'chime.wav':
  Metadata:
    artist          : vtkproductions.com
  Duration: 00:00:02.60, bitrate: 705 kb/s
    Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (output/output.mpg) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
[mpeg1video @ 0x6bc5d0] Warning: not compiled with thread support, using thread emulation
[pam @ 0x5b8b80] Warning: not compiled with thread support, using thread emulation
Output #0, mpeg1video, to 'output/output.mpg':
  Metadata:
    encoder         : Lavf55.21.100
    Stream #0:0: Video: mpeg1video, yuv420p, 771x255, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (pam -> mpeg1video)
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A    
frame=   51 fps= 28 q=4.0 size=     104kB time=00:00:01.96 bitrate= 434.5kbits/s dup=48 drop=0    
frame=   76 fps= 32 q=4.0 size=     141kB time=00:00:02.96 bitrate= 389.2kbits/s dup=72 drop=0    
frame=  101 fps= 34 q=4.0 size=     185kB time=00:00:03.96 bitrate= 382.1kbits/s dup=96 drop=0    
frame=  126 fps= 35 q=4.0 size=     223kB time=00:00:04.96 bitrate= 368.2kbits/s dup=120 drop=0    
frame=  176 fps= 40 q=4.0 size=     305kB time=00:00:06.96 bitrate= 359.2kbits/s dup=168 drop=0    
frame=  226 fps= 43 q=4.0 size=     384kB time=00:00:08.96 bitrate= 351.1kbits/s dup=216 drop=0    
frame=  276 fps= 46 q=4.0 size=     480kB time=00:00:10.96 bitrate= 358.6kbits/s dup=264 drop=0    
frame=  326 fps= 48 q=4.0 size=     588kB time=00:00:12.96 bitrate= 371.7kbits/s dup=312 drop=0    
frame=  376 fps= 50 q=4.0 size=     720kB time=00:00:14.96 bitrate= 394.2kbits/s dup=360 drop=0    
frame=  426 fps= 51 q=4.0 size=     854kB time=00:00:16.96 bitrate= 412.7kbits/s dup=408 drop=0    
frame=  476 fps= 51 q=4.0 size=     983kB time=00:00:18.96 bitrate= 424.9kbits/s dup=456 drop=0    
frame=  526 fps= 51 q=4.0 size=    1134kB time=00:00:20.96 bitrate= 443.1kbits/s dup=504 drop=0    
frame=  576 fps= 52 q=4.0 size=    1257kB time=00:00:22.96 bitrate= 448.4kbits/s dup=552 drop=0    
frame=  576 fps= 50 q=4.0 Lsize=    1257kB time=00:00:23.00 bitrate= 447.8kbits/s dup=552 drop=0    

video:1257kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.000000%
exit(0) called 


I strongly suspect that I have the wrong muxer enabled, but --enable-muxer=mpeg, which seemed like the obvious choice, tells me:

WARNING: Option --enable-muxer=mpeg did not match anything


Can anyone tell me (a) if there's some process I can follow to determine the right configure parameters? Or, failing that, (b) what *are* the right configure parameters?

Many thanks,
George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4121 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20131122/959dbe40/attachment.p7s>


More information about the ffmpeg-user mailing list