Im running an ffmpeg command to generate a thumbnail from a video that exists on aws s3 bucket but accessed from cloud front. So i try to stream the video in the command. This is implemented in nodejs and the ffmpeg dependency is a lambda layer. The code looks like so
const gifName = `${baseFilename}.gif`;
await execPromise(`ffmpeg -t 10 -ss 00:00:01 -i "${_url}" ${'/tmp/' + gifName}`);
_url is a clound front url. This works when i test locally even via aws SAM cli.
But this fails when testing the deployed fuction. The error output I get is as follows
2022-06-13T14:07:41.079Z 35af32d2-c63f-4942-abce-3ae7dad2a6c3 INFO stderr: ffmpeg version 5.0.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 57. 17.100 / 57. 17.100
libavcodec 59. 18.100 / 59. 18.100
libavformat 59. 16.100 / 59. 16.100
libavdevice 59. 4.100 / 59. 4.100
libavfilter 8. 24.100 / 8. 24.100
libswscale 6. 4.100 / 6. 4.100
libswresample 4. 3.100 / 4. 3.100
libpostproc 56. 3.100 / 56. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://d17yrtgi5800rj.cloudfront.net/staging/videos/a66a92eb-bc31-4440-958c-07ee23e55bcb':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2022-05-03T19:50:01.000000Z
com.apple.quicktime.location.accuracy.horizontal: 4.732124
com.apple.quicktime.location.ISO6709: +52.3832+004.9205+018.038/
com.apple.quicktime.make: Apple
com.apple.quicktime.model: iPhone 13 Pro Max
com.apple.quicktime.software: 15.4.1
com.apple.quicktime.creationdate: 2022-05-03T21:50:01+0200
Duration: 00:00:42.67, start: 0.000000, bitrate: 8434 kb/s
Stream #0:0[0x1](und): Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 1920x1080, 8214 kb/s, 30 fps, 30 tbr, 600 tbn (default)
Metadata:
creation_time : 2022-05-03T19:50:01.000000Z
handler_name : Core Media Video
vendor_id : [0][0][0][0]
encoder : HEVC
Side data:
DOVI configuration record: version: 1.0, profile: 8, level: 4, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 4
displaymatrix: rotation of -90.00 degrees
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 162 kb/s (default)
Metadata:
creation_time : 2022-05-03T19:50:01.000000Z
handler_name : Core Media Audio
vendor_id : [0][0][0][0]
Stream #0:2[0x3](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
Metadata:
creation_time : 2022-05-03T19:50:01.000000Z
handler_name : Core Media Metadata
Stream #0:3[0x4](und): Data: none (mebx / 0x7862656D), 5 kb/s (default)
Metadata:
creation_time : 2022-05-03T19:50:01.000000Z
handler_name : Core Media Metadata
Stream #0:4[0x5](und): Data: none (mebx / 0x7862656D), 36 kb/s (default)
Metadata:
creation_time : 2022-05-03T19:50:01.000000Z
handler_name : Core Media Metadata
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> gif (native))
Press [q] to stop, [?] for help
[hevc # 0x63641c0] Multiple Dolby Vision RPUs found in one AU. Skipping previous.
[hevc # 0x6375900] Multiple Dolby Vision RPUs found in one AU. Skipping previous.
[hevc # 0x6333600] Multiple Dolby Vision RPUs found in one AU. Skipping previous.
Output #0, gif, to '/tmp/a66a92eb-bc31-4440-958c-07ee23e55bcb.gif':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
com.apple.quicktime.creationdate: 2022-05-03T21:50:01+0200
com.apple.quicktime.location.accuracy.horizontal: 4.732124
com.apple.quicktime.location.ISO6709: +52.3832+004.9205+018.038/
com.apple.quicktime.make: Apple
com.apple.quicktime.model: iPhone 13 Pro Max
com.apple.quicktime.software: 15.4.1
encoder : Lavf59.16.100
Stream #0:0(und): Video: gif, bgr8(pc, gbr/bt2020/arib-std-b67, progressive), 1080x1920, q=2-31, 200 kb/s, 30 fps, 100 tbn (default)
Metadata:
creation_time : 2022-05-03T19:50:01.000000Z
handler_name : Core Media Video
vendor_id : [0][0][0][0]
encoder : Lavc59.18.100 gif
Side data:
DOVI configuration record: version: 1.0, profile: 8, level: 4, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 4
displaymatrix: rotation of -0.00 degrees
frame= 1 fps=0.0 q=-0.0 size= 0kB time=00:00:00.08 bitrate= 0.0kbits/s speed=0.325x
frame= 4 fps=0.0 q=-0.0 size= 768kB time=00:00:00.18 bitrate=34952.5kbits/s speed=0.239x
frame= 9 fps=6.6 q=-0.0 size= 2304kB time=00:00:00.34 bitrate=55512.8kbits/s speed=0.248x
frame= 14 fps=7.0 q=-0.0 size= 3584kB time=00:00:00.51 bitrate=57568.9kbits/s speed=0.255x
frame= 19 fps=7.2 q=-0.0 size= 5120kB time=00:00:00.68 bitrate=61680.9kbits/s speed=0.259x
frame= 24 fps=7.4 q=-0.0 size= 6656kB time=00:00:00.84 bitrate=64911.8kbits/s speed=0.258x
frame= 29 fps=7.5 q=-0.0 size= 7936kB time=00:00:01.01 bitrate=64368.0kbits/s speed=0.26x
frame= 33 fps=7.5 q=-0.0 size= 9472kB time=00:00:01.14 bitrate=68065.5kbits/s speed=0.259x
frame= 37 fps=7.5 q=-0.0 size= 10752kB time=00:00:01.28 bitrate=68812.8kbits/s speed=0.261x
frame= 42 fps=7.6 q=-0.0 size= 12032kB time=00:00:01.44 bitrate=68448.7kbits/s speed=0.26x
frame= 46 fps=7.6 q=-0.0 size= 13312kB time=00:00:01.58 bitrate=69020.2kbits/s speed=0.261x
frame= 50 fps=7.6 q=-0.0 size= 14336kB time=00:00:01.71 bitrate=68678.7kbits/s speed=0.261x
frame= 54 fps=7.6 q=-0.0 size= 15360kB time=00:00:01.84 bitrate=68385.4kbits/s speed=0.259x
frame= 58 fps=7.6 q=-0.0 size= 16640kB time=00:00:01.98 bitrate=68845.9kbits/s speed=0.26x
frame= 62 fps=7.6 q=-0.0 size= 17664kB time=00:00:02.11 bitrate=68579.9kbits/s speed=0.26x
frame= 66 fps=7.6 q=-0.0 size= 18944kB time=00:00:02.24 bitrate=69280.9kbits/s speed=0.259x
frame= 70 fps=7.6 q=-0.0 size= 20224kB time=00:00:02.38 bitrate=69611.3kbits/s speed=0.26x
frame= 74 fps=7.7 q=-0.0 size= 21504kB time=00:00:02.51 bitrate=70183.6kbits/s speed=0.26x
frame= 78 fps=7.7 q=-0.0 size= 22784kB time=00:00:02.64 bitrate=70699.4kbits/s speed=0.259x
frame= 82 fps=7.7 q=-0.0 size= 24064kB time=00:00:02.78 bitrate=70910.9kbits/s speed=0.26x
frame= 86 fps=7.7 q=-0.0 size= 25600kB time=00:00:02.91 bitrate=72067.1kbits/s speed=0.259x
frame= 91 fps=7.7 q=-0.0 size= 27136kB time=00:00:03.08 bitrate=72174.7kbits/s speed=0.26x
frame= 95 fps=7.7 q=-0.0 size= 28416kB time=00:00:03.21 bitrate=72518.3kbits/s speed=0.26x
frame= 99 fps=7.7 q=-0.0 size= 29696kB time=00:00:03.34 bitrate=72835.2kbits/s speed=0.26x
frame= 103 fps=7.7 q=-0.0 size= 30976kB time=00:00:03.48 bitrate=72918.2kbits/s speed=0.26x
frame= 108 fps=7.7 q=-0.0 size= 32768kB time=00:00:03.64 bitrate=73746.0kbits/s speed=0.26x
frame= 112 fps=7.7 q=-0.0 size= 34048kB time=00:00:03.78 bitrate=73788.7kbits/s speed=0.26x
frame= 116 fps=7.7 q=-0.0 size= 35072kB time=00:00:03.91 bitrate=73480.8kbits/s speed=0.26x
frame= 120 fps=7.7 q=-0.0 size= 36352kB time=00:00:04.04 bitrate=73711.8kbits/s speed=0.26x
frame= 124 fps=7.7 q=-0.0 size= 37376kB time=00:00:04.18 bitrate=73249.8kbits/s speed=0.26x
frame= 128 fps=7.7 q=-0.0 size= 38656kB time=00:00:04.31 bitrate=73473.3kbits/s speed=0.26x
frame= 132 fps=7.7 q=-0.0 size= 39936kB time=00:00:04.44 bitrate=73683.7kbits/s speed=0.26x
frame= 136 fps=7.7 q=-0.0 size= 41216kB time=00:00:04.58 bitrate=73720.8kbits/s speed=0.26x
frame= 141 fps=7.7 q=-0.0 size= 42496kB time=00:00:04.74 bitrate=73444.6kbits/s speed=0.26x
frame= 145 fps=7.8 q=-0.0 size= 43776kB time=00:00:04.88 bitrate=73486.3kbits/s speed=0.261x
frame= 150 fps=7.8 q=-0.0 size= 45312kB time=00:00:05.04 bitrate=73650.0kbits/s speed=0.261x
frame= 154 fps=7.8 q=-0.0 size= 46336kB time=00:00:05.18 bitrate=73278.9kbits/s speed=0.261x
frame= 159 fps=7.8 q=-0.0 size= 47616kB time=00:00:05.34 bitrate=73046.9kbits/s speed=0.261x
frame= 164 fps=7.8 q=-0.0 size= 49152kB time=00:00:05.51 bitrate=73076.8kbits/s speed=0.262x
frame= 168 fps=7.8 q=-0.0 size= 50176kB time=00:00:05.64 bitrate=72879.8kbits/s speed=0.262x
frame= 173 fps=7.8 q=-0.0 size= 51456kB time=00:00:05.81 bitrate=72552.1kbits/s speed=0.262x
frame= 178 fps=7.8 q=-0.0 size= 52736kB time=00:00:05.98 bitrate=72243.0kbits/s speed=0.262x
frame= 183 fps=7.8 q=-0.0 size= 54272kB time=00:00:06.14 bitrate=72409.8kbits/s speed=0.262x
frame= 187 fps=7.8 q=-0.0 size= 55552kB time=00:00:06.28 bitrate=72465.3kbits/s speed=0.263x
frame= 191 fps=7.8 q=-0.0 size= 56832kB time=00:00:06.41 bitrate=72631.5kbits/s speed=0.262x
frame= 196 fps=7.8 q=-0.0 size= 58368kB time=00:00:06.58 bitrate=72667.3kbits/s speed=0.263x
frame= 200 fps=7.8 q=-0.0 size= 59648kB time=00:00:06.71 bitrate=72822.1kbits/s speed=0.262x
frame= 204 fps=7.8 q=-0.0 size= 60928kB time=00:00:06.84 bitrate=72971.1kbits/s speed=0.262x
frame= 208 fps=7.8 q=-0.0 size= 62208kB time=00:00:06.98 bitrate=73009.7kbits/s speed=0.262x
frame= 212 fps=7.8 q=-0.0 size= 63488kB time=00:00:07.11 bitrate=73149.6kbits/s speed=0.262x
frame= 216 fps=7.8 q=-0.0 size= 64768kB time=00:00:07.24 bitrate=73284.5kbits/s speed=0.262x
frame= 220 fps=7.8 q=-0.0 size= 66048kB time=00:00:07.38 bitrate=73315.1kbits/s speed=0.262x
frame= 224 fps=7.8 q=-0.0 size= 67072kB time=00:00:07.51 bitrate=73163.0kbits/s speed=0.262x
frame= 228 fps=7.8 q=-0.0 size= 68352kB time=00:00:07.64 bitrate=73290.5kbits/s speed=0.262x
frame= 232 fps=7.8 q=-0.0 size= 69632kB time=00:00:07.78 bitrate=73319.5kbits/s speed=0.262x
frame= 236 fps=7.8 q=-0.0 size= 70912kB time=00:00:07.91 bitrate=73440.1kbits/s speed=0.262x
frame= 240 fps=7.8 q=-0.0 size= 72192kB time=00:00:08.04 bitrate=73556.8kbits/s speed=0.262x
frame= 245 fps=7.8 q=-0.0 size= 73728kB time=00:00:08.21 bitrate=73566.4kbits/s speed=0.262x
frame= 249 fps=7.8 q=-0.0 size= 75008kB time=00:00:08.34 bitrate=73676.9kbits/s speed=0.262x
frame= 253 fps=7.8 q=-0.0 size= 76288kB time=00:00:08.48 bitrate=73697.1kbits/s speed=0.262x
frame= 257 fps=7.8 q=-0.0 size= 77568kB time=00:00:08.61 bitrate=73802.2kbits/s speed=0.262x
frame= 261 fps=7.8 q=-0.0 size= 78848kB time=00:00:08.74 bitrate=73904.2kbits/s speed=0.262x
frame= 265 fps=7.8 q=-0.0 size= 80128kB time=00:00:08.88 bitrate=73919.9kbits/s speed=0.262x
frame= 269 fps=7.8 q=-0.0 size= 81152kB time=00:00:09.01 bitrate=73784.4kbits/s speed=0.262x
frame= 273 fps=7.8 q=-0.0 size= 82432kB time=00:00:09.14 bitrate=73882.2kbits/s speed=0.262x
frame= 278 fps=7.8 q=-0.0 size= 83712kB time=00:00:09.31 bitrate=73659.4kbits/s speed=0.262x
frame= 282 fps=7.8 q=-0.0 size= 84992kB time=00:00:09.44 bitrate=73755.8kbits/s speed=0.262x
frame= 287 fps=7.8 q=-0.0 size= 86784kB time=00:00:09.61 bitrate=73978.6kbits/s speed=0.262x
frame= 291 fps=7.8 q=-0.0 size= 88064kB time=00:00:09.74 bitrate=74067.8kbits/s speed=0.262x
frame= 295 fps=7.8 q=-0.0 size= 89344kB time=00:00:09.88 bitrate=74079.6kbits/s speed=0.262x
frame= 299 fps=7.8 q=-0.0 size= 90624kB time=00:00:10.01 bitrate=74165.0kbits/s speed=0.262x
frame= 300 fps=7.8 q=-0.0 Lsize= 91358kB time=00:00:10.04 bitrate=74542.5kbits/s speed=0.261x
video:91358kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000021%
Any ideas what might be wrong?
It looks like it can access the input, so that looks correct.
How long does it run for?
Does it time out?
Related
Input:
const runCommand = require('./runCommand')
runCommand(
'ffmpeg',
`-threads:v 2 -threads:a 8 -filter_threads 2 -thread_queue_size 512 \
-loop 1 -i ./place.png \
-stream_loop -1 \
-i ./track.mp3 \
-pix_fmt yuv420p -c:v libx264 -qp:v 19 -profile:v high -rc:v cbr_ld_hq -level:v 4.2 -r:v 60 -g:v 120 -bf:v 3 -refs:v 16 -preset fast -f flv rtmp://a.rtmp.youtube.com/live2/${process.env.streamkey}`,
(data) => console.log(data),
() => console.log('finished')
)
Output:
x
frame= 588 fps=8.7 q=21.0 size= 9000kB time=00:00:22.76 bitrate=3238.2kbits/s speed=0.339x
frame= 590 fps=8.7 q=19.0 size= 9001kB time=00:00:22.83 bitrate=3229.4kbits/s speed=0.336x
frame= 597 fps=8.7 q=21.0 size= 9007kB time=00:00:23.11 bitrate=3191.5kbits/s speed=0.337x
frame= 603 fps=8.7 q=20.0 size= 9012kB time=00:00:23.36 bitrate=3159.3kbits/s speed=0.338x
frame= 608 fps=8.7 q=21.0 size= 9016kB time=00:00:23.56 bitrate=3133.9kbits/s speed=0.339x
frame= 614 fps=8.8 q=19.0 size= 9021kB time=00:00:23.80 bitrate=3104.9kbits/s speed=0.339x
frame= 617 fps=8.7 q=21.0 size= 10702kB time=00:00:23.92 bitrate=3663.8kbits/s speed=0.337x
frame= 623 fps=8.7 q=20.0 size= 10735kB time=00:00:24.16 bitrate=3638.9kbits/s speed=0.338x
frame= 629 fps=8.7 q=21.0 size= 10740kB time=00:00:24.40 bitrate=3605.8kbits/s speed=0.338x
frame= 635 fps=8.7 q=20.0 size= 10745kB time=00:00:24.63 bitrate=3573.1kbits/s speed=0.339x
frame= 643 fps=8.8 q=20.0 size= 10751kB time=00:00:24.96 bitrate=3527.4kbits/s speed=0.341x
frame= 646 fps=8.8 q=19.0 size= 10754kB time=00:00:25.08 bitrate=3512.1kbits/s speed=0.341x
frame= 651 fps=8.8 q=20.0 size= 10758kB time=00:00:25.28 bitrate=3485.6kbits/s speed=0.341x
frame= 656 fps=8.8 q=21.0 size= 10762kB time=00:00:25.48 bitrate=3459.6kbits/s speed=0.341x
frame= 658 fps=8.7 q=19.0 size= 10764kB time=00:00:25.56 bitrate=3448.7kbits/s speed=0.338x
frame= 664 fps=8.7 q=21.0 size= 10769kB time=00:00:25.81 bitrate=3417.9kbits/s speed=0.338x
Why is my FPS so low when streaming to Youtube?
P.S. The process is using very low memory and CPU, can I sacrifice a bit more for it?
I push the stream like so:
% ffmpeg -rtsp_transport tcp -i "rtsp://**********************" -codec copy -f flv rtmp://x.rtmp.youtube.com/live2/****************
ffmpeg version N-94664-g0821bc4eee Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190807
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 33.100 / 56. 33.100
libavcodec 58. 55.101 / 58. 55.101
libavformat 58. 31.104 / 58. 31.104
libavdevice 58. 9.100 / 58. 9.100
libavfilter 7. 58.101 / 7. 58.101
libswscale 5. 6.100 / 5. 6.100
libswresample 3. 6.100 / 3. 6.100
libpostproc 55. 6.100 / 55. 6.100
Input #0, rtsp, from 'rtsp:*************************':
Metadata:
title : Media Server
Duration: N/A, start: 0.040000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1280x720, 12 fps, 25 tbr, 90k tbn, 24 tbc
Stream #0:1: Audio: aac (LC), 32000 Hz, mono, fltp
Output #0, flv, to 'rtmp://x.rtmp.youtube.com/live2/********************':
Metadata:
title : Media Server
encoder : Lavf58.31.104
Stream #0:0: Video: h264 (Main) ([7][0][0][0] / 0x0007), yuvj420p(pc, bt709, progressive), 1280x720, q=2-31, 12 fps, 25 tbr, 1k tbn, 90k tbc
Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 32000 Hz, mono, fltp
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[flv # 000000000310d540] Non-monotonous DTS in output stream 0:0; previous: 557, current: 120; changing to 557. This may result in incorrect timestamps in the output file.
[flv # 000000000310d540] Non-monotonous DTS in output stream 0:0; previous: 557, current: 200; changing to 557. This may result in incorrect timestamps in the output file.
[flv # 000000000310d540] Non-monotonous DTS in output stream 0:0; previous: 557, current: 320; changing to 557. This may result in incorrect timestamps in the output file.
[flv # 000000000310d540] Non-monotonous DTS in output stream 0:0; previous: 557, current: 400; changing to 557. This may result in incorrect timestamps in the output file.
[flv # 000000000310d540] Non-monotonous DTS in output stream 0:0; previous: 557, current: 480; changing to 557. This may result in incorrect timestamps in the output file.
frame= 7 fps=0.0 q=-1.0 size= 74kB time=00:00:00.56 bitrate=1079.1kbits/s speed=1.06x
frame= 25 fps= 19 q=-1.0 size= 188kB time=00:00:02.08 bitrate= 741.5kbits/s speed=1.61x
frame= 49 fps= 22 q=-1.0 size= 330kB time=00:00:04.08 bitrate= 661.9kbits/s speed=1.83x
frame= 67 fps= 25 q=-1.0 size= 392kB time=00:00:05.66 bitrate= 567.3kbits/s speed=2.07x
frame= 72 fps= 22 q=-1.0 size= 410kB time=00:00:06.06 bitrate= 553.9kbits/s speed=1.84x
frame= 76 fps= 20 q=-1.0 size= 488kB time=00:00:06.38 bitrate= 626.5kbits/s speed=1.67x
frame= 86 fps= 20 q=-1.0 size= 519kB time=00:00:07.26 bitrate= 585.5kbits/s speed=1.68x
frame= 92 fps= 19 q=-1.0 size= 538kB time=00:00:07.74 bitrate= 569.5kbits/s speed= 1.6x
frame= 97 fps= 17 q=-1.0 size= 618kB time=00:00:08.11 bitrate= 623.8kbits/s speed=1.45x
frame= 108 fps= 18 q=-1.0 size= 658kB time=00:00:09.02 bitrate= 597.6kbits/s speed=1.48x
frame= 114 fps= 17 q=-1.0 size= 679kB time=00:00:09.50 bitrate= 585.3kbits/s speed=1.44x
frame= 120 fps= 17 q=-1.0 size= 698kB time=00:00:10.02 bitrate= 570.5kbits/s speed=1.41x
frame= 121 fps= 16 q=-1.0 size= 764kB time=00:00:10.09 bitrate= 619.8kbits/s speed=1.32x
frame= 132 fps= 16 q=-1.0 size= 802kB time=00:00:11.01 bitrate= 596.7kbits/s speed=1.35x
frame= 138 fps= 16 q=-1.0 size= 820kB time=00:00:11.57 bitrate= 580.6kbits/s speed=1.34x
frame= 144 fps= 16 q=-1.0 size= 841kB time=00:00:12.05 bitrate= 571.5kbits/s speed=1.32x
frame= 149 fps= 15 q=-1.0 size= 923kB time=00:00:12.45 bitrate= 606.8kbits/s speed=1.29x
frame= 157 fps= 15 q=-1.0 size= 949kB time=00:00:13.13 bitrate= 592.0kbits/s speed=1.28x
frame= 163 fps= 15 q=-1.0 size= 969kB time=00:00:13.65 bitrate= 581.3kbits/s speed=1.27x
frame= 169 fps= 15 q=-1.0 size= 1051kB time=00:00:14.09 bitrate= 610.9kbits/s speed=1.22x
frame= 180 fps= 15 q=-1.0 size= 1091kB time=00:00:15.05 bitrate= 593.6kbits/s speed=1.24x
frame= 187 fps= 15 q=-1.0 size= 1113kB time=00:00:15.61 bitrate= 583.8kbits/s speed=1.23x
frame= 192 fps= 15 q=-1.0 size= 1130kB time=00:00:16.05 bitrate= 576.7kbits/s speed=1.21x
frame= 197 fps= 14 q=-1.0 size= 1212kB time=00:00:16.45 bitrate= 603.2kbits/s speed= 1.2x
frame= 206 fps= 14 q=-1.0 size= 1241kB time=00:00:17.17 bitrate= 592.1kbits/s speed= 1.2x
frame= 213 fps= 14 q=-1.0 size= 1265kB time=00:00:17.77 bitrate= 582.8kbits/s speed= 1.2x
frame= 217 fps= 14 q=-1.0 size= 1340kB time=00:00:18.09 bitrate= 606.6kbits/s speed=1.16x
frame= 228 fps= 14 q=-1.0 size= 1380kB time=00:00:19.05 bitrate= 593.4kbits/s speed=1.18x
frame= 234 fps= 14 q=-1.0 size= 1399kB time=00:00:19.57 bitrate= 585.6kbits/s speed=1.17x
frame= 240 fps= 14 q=-1.0 size= 1418kB time=00:00:20.05 bitrate= 579.4kbits/s speed=1.16x
[flv # 000000000310d540] Failed to update header with correct duration.
[flv # 000000000310d540] Failed to update header with correct filesize.
frame= 241 fps= 14 q=-1.0 Lsize= 1486kB time=00:00:20.05 bitrate= 606.8kbits/s speed=1.14x
video:1317kB audio:153kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.058846%
Exiting normally, received signal 2.
When viewed on youtube the stream audio is distorted i.e. it has regular 7ms gaps between each 32ms sound portions.
However, when I save the input stream to a file the audio is fine.
I've experimented with different input/output options for ffmpeg including transcoding the audio stream but nothing helped fix the issue. I think ffmpeg is the culprit here, since VLC or other streaming services like angelcam etc can play the rtsp stream without any distortions.
I've been trying to create a slideshow from a series of images using nodejs + fluent-ffmpeg, however it is not working well or consistently. ffmpeg occasionally emits "Error: ffmpeg exited with code 1: pipe:0: Invalid data found when processing input", and in case an eventual video (mp4) is created it seems to be missing images/frames.
The process is as follows: images are loaded into memory, transformed resized to same dimensions using lwip, written sequentially into a passthrough stream, which is fed to ffmpeg as input.
Relevant code snippets:
var lwip = require('lwip');
var ffmpeg = require('fluent-ffmpeg');
var stream = require('stream');
var imagesStream = new stream.PassThrough();
...
image.batch()
.contain(options.video.width, options.video.height, 'lanczos')
.toBuffer(options.frames.format, {quality: 100}, (err, buffer) => {
if (err) {
throw ('error convering image to buffer. ' + err);
}
imagesStream.write(buffer, 'utf8');
resolve();
});
...
ffmpeg(imagesStream)
.inputOptions('-framerate 1/' + options.frames.secsPerImage)
.input(path.join(AUDIO_ROOT, options.audio.track))
.save(path.join(path.join(OUTPUT_FOLDER, `${options.video.output.prefix}${timestamp}.${options.video.output.format}`)))
.size(`${options.video.width}x${options.video.height}`)
.on('start', () => {
console.log('creating the clip now...')
})
.on('progress', (progress) => {
var progPercent = Math.round(100 * progress.frames / (numImages * options.frames.secsPerImage * 25));
progPercent = Math.min(progPercent, 100);
console.log(`processing: ${progPercent}% done`)
})
.on('stderr', (line) => {
console.error('ffmpeg error: ' + line);
})
.on('error', (error) => {
reject('ffmpeg transcoding error: ' + error);
})
.on('end', () => {
console.log('done!');
resolve(true);
})
.run();
And here is the output:
"C:\Program Files (x86)\JetBrains\WebStorm 2016.1.1\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" vm2.js
image count: 18
image count: 6
creating the clip now...
ffmpeg error: ffmpeg version N-80335-gcb46b78 Copyright (c) 2000-2016 the FFmpeg developers
ffmpeg error: built with gcc 5.4.0 (GCC)
ffmpeg error: configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
ffmpeg error: libavutil 55. 24.100 / 55. 24.100
ffmpeg error: libavcodec 57. 46.100 / 57. 46.100
ffmpeg error: libavformat 57. 38.100 / 57. 38.100
ffmpeg error: libavdevice 57. 0.101 / 57. 0.101
ffmpeg error: libavfilter 6. 46.101 / 6. 46.101
ffmpeg error: libswscale 4. 1.100 / 4. 1.100
ffmpeg error: libswresample 2. 1.100 / 2. 1.100
ffmpeg error: libpostproc 54. 0.100 / 54. 0.100
creating the clip now...
ffmpeg error: ffmpeg version N-80335-gcb46b78 Copyright (c) 2000-2016 the FFmpeg developers
ffmpeg error: built with gcc 5.4.0 (GCC)
ffmpeg error: configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
ffmpeg error: libavutil 55. 24.100 / 55. 24.100
ffmpeg error: libavcodec 57. 46.100 / 57. 46.100
ffmpeg error: libavformat 57. 38.100 / 57. 38.100
ffmpeg error: libavdevice 57. 0.101 / 57. 0.101
ffmpeg error: libavfilter 6. 46.101 / 6. 46.101
ffmpeg error: libswscale 4. 1.100 / 4. 1.100
ffmpeg error: libswresample 2. 1.100 / 2. 1.100
ffmpeg error: libpostproc 54. 0.100 / 54. 0.100
ffmpeg error: pipe:0: Invalid data found when processing input
ffmpeg error:
an error has occurred: ffmpeg transcoding error: Error: ffmpeg exited with code 1: pipe:0: Invalid data found when processing input
ffmpeg error: [jpeg_pipe # 0000000000308fe0] Format jpeg_pipe detected only with low score of 6, misdetection possible!
ffmpeg error: Input #0, jpeg_pipe, from 'pipe:0':
ffmpeg error: Duration: N/A, bitrate: N/A
ffmpeg error: Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 0.33 tbr, 0.33 tbn, 0.33 tbc
ffmpeg error: [mp3 # 0000000002fa0720] Estimating duration from bitrate, this may be inaccurate
ffmpeg error: Input #1, mp3, from 'audio\avicii.mp3':
ffmpeg error: Metadata:
ffmpeg error: album : True
ffmpeg error: genre : House
ffmpeg error: copyright : ℗ 2013 Avicii Music AB, / PRMD under exclusive license to Universal Music AB
ffmpeg error: encoded_by : Oz
ffmpeg error: title : Wake Me Up
ffmpeg error: artist : Avicii
ffmpeg error: album_artist : Avicii
ffmpeg error: disc : 1/1
ffmpeg error: track : 1/12
ffmpeg error: TYER : 2013-09-13T07:00:00Z
ffmpeg error: Duration: 00:04:09.73, start: 0.000000, bitrate: 321 kb/s
ffmpeg error: Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
ffmpeg error: Stream #1:1: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 600x600 [SAR 305:305 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
ffmpeg error: Metadata:
ffmpeg error: comment : Cover (front)
ffmpeg error: No pixel format specified, yuvj420p for H.264 encoding chosen.
ffmpeg error: Use -pix_fmt yuv420p for compatibility with outdated media players.
ffmpeg error: [libx264 # 000000000030e860] using SAR=1/1
ffmpeg error: [libx264 # 000000000030e860] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
ffmpeg error: [libx264 # 000000000030e860] profile High, level 4.0
ffmpeg error: [libx264 # 000000000030e860] 264 - core 148 r2694 3b70645 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
ffmpeg error: [mp4 # 0000000002ec6980] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
ffmpeg error: Last message repeated 1 times
ffmpeg error: Output #0, mp4, to 'output\clip_2016-06-22_06-17-25.mp4':
ffmpeg error: Metadata:
ffmpeg error: encoder : Lavf57.38.100
ffmpeg error: Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p(pc), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
ffmpeg error: Metadata:
ffmpeg error: encoder : Lavc57.46.100 libx264
ffmpeg error: Side data:
ffmpeg error: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
ffmpeg error: Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s
ffmpeg error: Metadata:
ffmpeg error: encoder : Lavc57.46.100 aac
ffmpeg error: Stream mapping:
ffmpeg error: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
ffmpeg error: Stream #1:0 -> #0:1 (mp3 (native) -> aac (native))
ffmpeg error: frame= 75 fps=0.0 q=28.0 size= 0kB time=00:00:00.64 bitrate= 0.6kbits/s dup=74 drop=0 speed=1.09x
processing: 17% done
ffmpeg error: frame= 150 fps= 97 q=28.0 size= 371kB time=00:00:03.64 bitrate= 835.6kbits/s dup=148 drop=0 speed=2.35x
processing: 33% done
processing: 33% done
ffmpeg error: frame= 150 fps= 73 q=28.0 size= 879kB time=00:00:07.36 bitrate= 977.8kbits/s dup=148 drop=0 speed= 3.6x
processing: 33% done
ffmpeg error: frame= 150 fps= 59 q=28.0 size= 952kB time=00:00:18.36 bitrate= 424.7kbits/s dup=148 drop=0 speed=7.21x
processing: 33% done
ffmpeg error: frame= 150 fps= 49 q=28.0 size= 1190kB time=00:00:32.99 bitrate= 295.3kbits/s dup=148 drop=0 speed=10.8x
ffmpeg error: frame= 150 fps= 42 q=28.0 size= 1409kB time=00:00:46.64 bitrate= 247.4kbits/s dup=148 drop=0 speed=13.1x
processing: 33% done
processing: 33% done
ffmpeg error: frame= 150 fps= 37 q=28.0 size= 1628kB time=00:01:00.30 bitrate= 221.1kbits/s dup=148 drop=0 speed=14.9x
processing: 33% done
ffmpeg error: frame= 150 fps= 33 q=28.0 size= 1878kB time=00:01:15.83 bitrate= 202.8kbits/s dup=148 drop=0 speed=16.7x
processing: 33% done
ffmpeg error: frame= 150 fps= 30 q=28.0 size= 2130kB time=00:01:31.64 bitrate= 190.4kbits/s dup=148 drop=0 speed=18.2x
processing: 33% done
ffmpeg error: frame= 150 fps= 27 q=28.0 size= 2375kB time=00:01:47.18 bitrate= 181.5kbits/s dup=148 drop=0 speed=19.3x
processing: 33% done
ffmpeg error: frame= 150 fps= 25 q=28.0 size= 2626kB time=00:02:03.15 bitrate= 174.7kbits/s dup=148 drop=0 speed=20.4x
processing: 33% done
ffmpeg error: frame= 150 fps= 23 q=28.0 size= 2832kB time=00:02:16.20 bitrate= 170.3kbits/s dup=148 drop=0 speed=20.8x
ffmpeg error: frame= 150 fps= 21 q=28.0 size= 3063kB time=00:02:30.34 bitrate= 166.9kbits/s dup=148 drop=0 speed=21.3x
processing: 33% done
processing: 33% done
ffmpeg error: frame= 150 fps= 20 q=28.0 size= 3298kB time=00:02:44.93 bitrate= 163.8kbits/s dup=148 drop=0 speed=21.8x
processing: 33% done
ffmpeg error: frame= 150 fps= 19 q=28.0 size= 3522kB time=00:02:58.93 bitrate= 161.3kbits/s dup=148 drop=0 speed=22.2x
processing: 33% done
ffmpeg error: frame= 150 fps= 18 q=28.0 size= 3792kB time=00:03:15.83 bitrate= 158.6kbits/s dup=148 drop=0 speed=22.9x
processing: 33% done
ffmpeg error: frame= 150 fps= 17 q=28.0 size= 4035kB time=00:03:31.11 bitrate= 156.6kbits/s dup=148 drop=0 speed=23.3x
processing: 33% done
ffmpeg error: frame= 150 fps= 16 q=28.0 size= 4294kB time=00:03:47.62 bitrate= 154.5kbits/s dup=148 drop=0 speed=23.8x
processing: 33% done
ffmpeg error: frame= 150 fps= 15 q=28.0 size= 4566kB time=00:04:04.87 bitrate= 152.7kbits/s dup=148 drop=0 speed=24.4x
processing: 33% done
ffmpeg error: frame= 150 fps= 14 q=-1.0 Lsize= 4851kB time=00:04:09.73 bitrate= 159.1kbits/s dup=148 drop=0 speed=23.6x
ffmpeg error: video:826kB audio:3978kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.967442%
ffmpeg error: [libx264 # 000000000030e860] frame I:2 Avg QP:14.53 size:414604
ffmpeg error: [libx264 # 000000000030e860] frame P:38 Avg QP:16.59 size: 222
ffmpeg error: [libx264 # 000000000030e860] frame B:110 Avg QP:12.67 size: 69
ffmpeg error: [libx264 # 000000000030e860] consecutive B-frames: 1.3% 2.7% 0.0% 96.0%
ffmpeg error: [libx264 # 000000000030e860] mb I I16..4: 25.5% 49.4% 25.1%
ffmpeg error: [libx264 # 000000000030e860] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.7% 0.0% 0.0% 0.0% 0.0% skip:99.2%
ffmpeg error: [libx264 # 000000000030e860] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.0% 0.0% 0.0% direct: 0.0% skip:100.0% L0: 1.2% L1:98.8% BI: 0.0%
ffmpeg error: [libx264 # 000000000030e860] 8x8 transform intra:49.4% inter:92.1%
ffmpeg error: [libx264 # 000000000030e860] coded y,uvDC,uvAC intra: 74.2% 73.7% 69.0% inter: 0.0% 0.2% 0.0%
ffmpeg error: [libx264 # 000000000030e860] i16 v,h,dc,p: 97% 0% 2% 1%
ffmpeg error: [libx264 # 000000000030e860] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 19% 15% 7% 9% 7% 10% 7% 13%
ffmpeg error: [libx264 # 000000000030e860] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 21% 8% 8% 11% 9% 12% 7% 13%
ffmpeg error: [libx264 # 000000000030e860] i8c dc,h,v,p: 55% 19% 16% 10%
ffmpeg error: [libx264 # 000000000030e860] Weighted P-Frames: Y:0.0% UV:0.0%
ffmpeg error: [libx264 # 000000000030e860] ref P L0: 95.4% 0.6% 3.1% 0.9%
ffmpeg error: [libx264 # 000000000030e860] ref B L1: 98.8% 1.2%
ffmpeg error: [libx264 # 000000000030e860] kb/s:1127.01
ffmpeg error: [aac # 0000000002ecc880] Qavg: 541.237
ffmpeg error:
done!
Apparently this is a bug in fluent-ffmpeg, so I reverted to using ffmpeg directly as a child process. Here is the final code for creating an mp4 from a stream of raw in-memory jpeg images:
var timestamp = moment().format(options.video.output.timestampFormat);
var framerate = '1/' + options.frames.secsPerImage;
var videosize = `${options.video.width}x${options.video.height}`;
var audiotrack = path.join(AUDIO_ROOT, options.audio.track);
var outputFilename = path.join(path.join(OUTPUT_FOLDER,
`${options.video.output.prefix}${timestamp}.${options.video.output.format}`));
var childProcess = spawn('bin/ffmpeg.exe', ['-y', '-f', 'image2pipe',
'-s', videosize,
'-framerate', framerate,
'-pix_fmt', 'yuv420p',
'-i', '-',
'-i', audiotrack,
'-vcodec', 'mpeg4',
'-shortest',
outputFilename
]);
childProcess.stdout.on('data', data => console.log(data.toString()));
childProcess.stderr.on('data', data => console.log(data.toString()));
childProcess.on('close', code => {
console.log(`done! (${code})`);
resolve();
});
imagesStream.pipe(childProcess.stdin);
And as for the stream:
var stream = require('stream');
var imagesStream = new stream.PassThrough();
...
// repeat for every image...
imagesStream.write(buffer, 'utf8');
...
// then finally end the stream
imagesStream.end();
I'm making a song downloader app in Node.js. I managed to get everything to work, the app downloads the song and downloads its artwork (image). So I have the mp3 file and jpg file. The only problem is attaching the jpg file to the mp3 file.
I'm using the ffmetadata node.js module. I downloaded and installed its dependency "ffmpeg" cli.
Now when I try to write the metadata to the mp3 file and attach the artwork it spits this error:
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
My code:
ffmetadata.write('test.mp3', {}, {attachments: ['test.jpg']}, function(err) {
if (err) console.error(err);
});
The error:
[Error: ffmpeg version N-73872-g6b96c70 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 28.100 / 54. 28.100
libavcodec 56. 50.101 / 56. 50.101
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 25.100 / 5. 25.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'songs/Irresistible - Fall Out Boy (Lyrics).mp3':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6mp41
creation_time : 2015-04-03 10:45:25
Duration: 00:03:26.94, start: 0.000000, bitrate: 128 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
creation_time : 2015-04-03 10:45:25
handler_name : SoundHandler
Input #1, image2, from 'songs/albumart/Irresistible - Fall Out Boy (Lyrics).jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: 24578 kb/s
Stream #1:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 640x640 [SAR 300:300 DAR 1:1], 25 tbr, 25 tbn, 25 tbc
[mp3 # 0000000004865d80] Invalid audio stream. Exactly one MP3 audio stream is required.
Output #0, mp3, to 'songs\Irresistible - Fall Out Boy (Lyrics).ffmetadata.mp3':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6mp41
dryRun : true
encoder : Lavf56.40.101
Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 125 kb/s (default)
Metadata:
creation_time : 2015-04-03 10:45:25
handler_name : SoundHandler
Stream #0:1: Video: mjpeg, yuvj444p, 640x640 [SAR 300:300 DAR 1:1], q=2-31, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
]
Read the output:
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
[mp3 # 0000000004865d80] Invalid audio stream. Exactly one MP3 audio stream is required
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Your input file is not an MP3 but an MP4A /AAC. It has the wrong extension. You are then attempting to copy the AAC stream as MP3 which obviously fails. Check the source file in your downloader.
Continuing the journey into vnext...
I can now build the entire solution & run it successfully. However, when I try to initialise the IMvxGeoLocationWatcher, it crashes. The code & output are -
private IMvxGeoLocationWatcher _geoWatcher;
public void StartGettingLocation(Action<MvxCoordinates> response)
{
Log.Info("LocationService->StartGettingLocation");
// crashes on this line -
if (_geoWatcher == null) _geoWatcher = this.GetService<IMvxGeoLocationWatcher>();
Output -
Unhandled Exception:
0 MyApp 0x000797ae mono_handle_exception_internal_first_pass + 2190
1 MyApp 0x0007b1e2 mono_handle_exception_internal + 1602
2 MyApp 0x0007bd2f mono_handle_exception + 47
3 MyApp 0x000bce22 mono_x86_throw_exception + 306
4 ??? 0x07f30f8f 0x0 + 133369743
at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:545
at System.Activator.CreateInstance (System.Type,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo,object[]) [0x00174] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:299
at System.Activator.CreateInstance (System.Type,object[],object[]) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:234
at System.Activator.CreateInstance (System.Type,object[]) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:229
at Cirrious.MvvmCross.Application.MvxDefaultViewModelLocator.TryLoad (System.Type,System.Collections.Generic.IDictionary2<string, string>,Cirrious.MvvmCross.Interfaces.ViewModels.IMvxViewModel&) <IL 0x00043, 0x000d8>
at Cirrious.MvvmCross.Application.MvxViewModelLoader.LoadViewModel (Cirrious.MvvmCross.Views.MvxShowViewModelRequest) <IL 0x0005b, 0x000a2>
at Cirrious.MvvmCross.Touch.ExtensionMethods.MvxTouchViewControllerExtensionMethods.LoadViewModel<TViewModel> (Cirrious.MvvmCross.Touch.Interfaces.IMvxTouchView1)
at Cirrious.MvvmCross.Touch.ExtensionMethods.MvxTouchViewControllerExtensionMethods/c__AnonStorey01.<>m__0 () <IL 0x00006, 0x00034>
at Cirrious.MvvmCross.ExtensionMethods.MvxViewExtensionMethods.OnViewCreate<TViewModel> (Cirrious.MvvmCross.Interfaces.Views.IMvxView1,System.Func1<TViewModel>) <IL 0x00012, 0x00045>
at Cirrious.MvvmCross.Touch.ExtensionMethods.MvxTouchViewControllerExtensionMethods.OnViewCreate<TViewModel> (Cirrious.MvvmCross.Touch.Interfaces.IMvxTouchView1)
at Cirrious.MvvmCross.Touch.Views.MvxTouchViewController`1.ViewDidLoad ()
at MyApp.UI.Touch.MainMenuViewController.ViewDidLoad () [0x00000] in /Users/franklyn/Documents/Programming/MyApp/MyApp.UI.Touch/Views/MainMenuViewController.cs:34
Edit - the rest of the exception trace:
at (wrapper runtime-invoke) object.runtime_invoke_void_this_ (object,intptr,intptr,intptr)
18 MyApp 0x00008732 mono_jit_runtime_invoke + 722
19 MyApp 0x0014f39e mono_runtime_invoke + 126
20 MyApp 0x001e6296 monotouch_trampoline + 3686
21 UIKit 0x00a4b817 -[UIViewController loadViewIfRequired] + 536
22 UIKit 0x00a4b882 -[UIViewController view] + 33
23 UIKit 0x00a4bb2a -[UIViewController contentScrollView] + 36
24 UIKit 0x00a62ef5 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 36
25 UIKit 0x00a62fdb -[UINavigationController _layoutViewController:] + 43
26 UIKit 0x00a63286 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 254
27 UIKit 0x00a63381 -[UINavigationController _startTransition:fromViewController:toViewController:] + 72
28 UIKit 0x00a63eab -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
29 UIKit 0x00a63fc9 -[UINavigationController _startDeferredTransitionIfNeeded] + 41
30 UIKit 0x00a64055 -[UINavigationController viewWillLayoutSubviews] + 33
31 UIKit 0x00b693ab -[UILayoutContainerView layoutSubviews] + 233
32 UIKit 0x009ba92d -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 279
33 libobjc.A.dylib 0x022086b0 -[NSObject performSelector:withObject:] + 70
34 QuartzCore 0x01952fc0 -[CALayer layoutSublayers] + 240
35 QuartzCore 0x0194733c _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 468
36 QuartzCore 0x01952eaf -[CALayer layoutIfNeeded] + 166
37 UIKit 0x00a598cd -[UIViewController window:setupWithInterfaceOrientation:] + 242
38 UIKit 0x009a21a6 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 5346
39 UIKit 0x009a0cbf -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82
40 UIKit 0x009a0bd9 -[UIWindow _setRotatableViewOrientation:duration:force:] + 89
41 UIKit 0x0099fe34 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke_0 + 224
42 UIKit 0x0099fc6e -[UIWindow _updateToInterfaceOrientation:duration:force:] + 209
43 UIKit 0x009a0a29 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 853
44 UIKit 0x009a3922 -[UIWindow setDelegate:] + 351
45 UIKit 0x00a4dfec -[UIViewController _tryBecomeRootViewControllerInWindow:] + 164
46 UIKit 0x0099abc4 -[UIWindow addRootViewControllerViewIfPossible] + 481
47 UIKit 0x0099adbf -[UIWindow _setHidden:forced:] + 368
48 UIKit 0x0099af55 -[UIWindow _orderFrontWithoutMakingKey] + 49
49 UIKit 0x009a3f67 -[UIWindow makeKeyAndVisible] + 65
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend (intptr,intptr)
at MonoTouch.UIKit.UIWindow.MakeKeyAndVisible () [0x00008] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIWindow.g.cs:126
at MyApp.UI.Touch.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication,MonoTouch.Foundation.NSDictionary) [0x0003b] in /Users/franklynweber/Documents/Programming/MyApp/MyApp.UI.Touch/OtherClasses/AppDelegate.cs:46
at (wrapper runtime-invoke) .runtime_invoke_bool__this_object_object (object,intptr,intptr,intptr)
54 MyApp 0x00008732 mono_jit_runtime_invoke + 722
55 MyApp 0x0014f39e mono_runtime_invoke + 126
56 MyApp 0x001e6296 monotouch_trampoline + 3686
57 UIKit 0x009677b7 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 266
58 UIKit 0x00967da7 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1248
59 UIKit 0x00968fab -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 805
60 UIKit 0x0097a315 -[UIApplication handleEvent:withNewEvent:] + 1022
61 UIKit 0x0097b24b -[UIApplication sendEvent:] + 85
62 UIKit 0x0096ccf8 _UIApplicationHandleEvent + 9874
63 GraphicsServices 0x02c98df9 _PurpleEventCallback + 339
64 GraphicsServices 0x02c98ad0 PurpleEventCallback + 46
65 CoreFoundation 0x01f34bf5 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 53
66 CoreFoundation 0x01f34962 __CFRunLoopDoSource1 + 146
67 CoreFoundation 0x01f65bb6 __CFRunLoopRun + 2118
68 CoreFoundation 0x01f64f44 CFRunLoopRunSpecific + 276
69 CoreFoundation 0x01f64e1b CFRunLoopRunInMode + 123
70 UIKit 0x009687da -[UIApplication _run] + 774
71 UIKit 0x0096a65c UIApplicationMain + 1211
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
at MyApp.UI.Touch.Application.Main (string[]) [0x00000] in /Users/franklynweber/Documents/Programming/MyApp/MyApp.UI.Touch/OtherClasses/Main.cs:17
at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr)
76 MyApp 0x00008732 mono_jit_runtime_invoke + 722
77 MyApp 0x0014f39e mono_runtime_invoke + 126
78 MyApp 0x001534c4 mono_runtime_exec_main + 420
79 MyApp 0x00157ff5 mono_runtime_run_main + 725
80 MyApp 0x000651a5 mono_jit_exec + 149
81 MyApp 0x001db7b5 main + 2005
82 MyApp 0x000021f5 start + 53
2013-03-25 08:12:00.009 MyApp[7906:12203] Unhandled managed exception: Exception has been thrown by the target of an invocation. (System.Reflection.TargetInvocationException)
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0011f] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:536
at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:545
at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00174] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:299
at System.Activator.CreateInstance (System.Type type, System.Object[] args, System.Object[] activationAttributes) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:234
at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:229
at Cirrious.MvvmCross.Application.MvxDefaultViewModelLocator.TryLoad (System.Type viewModelType, IDictionary2 parameterValueLookup, IMvxViewModel& model) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Application.MvxViewModelLoader.LoadViewModel (Cirrious.MvvmCross.Views.MvxShowViewModelRequest request) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.ExtensionMethods.MvxTouchViewControllerExtensionMethods.LoadViewModel[MainMenuViewModel] (IMvxTouchView1 touchView) [0x00000] in :0
at Cirrious.MvvmCross.Touch.ExtensionMethods.MvxTouchViewControllerExtensionMethods+c__AnonStorey01[MyApp.Core.ViewModels.MainMenuViewModel].<>m__0 () [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.ExtensionMethods.MvxViewExtensionMethods.OnViewCreate[MainMenuViewModel] (IMvxView1 view, System.Func1 viewModelLoader) [0x00000] in <filename unknown>:0
at Cirrious.MvvmCross.Touch.ExtensionMethods.MvxTouchViewControllerExtensionMethods.OnViewCreate[MainMenuViewModel] (IMvxTouchView1 touchView) [0x00000] in :0
at Cirrious.MvvmCross.Touch.Views.MvxTouchViewController`1[MyApp.Core.ViewModels.MainMenuViewModel].ViewDidLoad () [0x00000] in :0
at MyApp.UI.Touch.MainMenuViewController.ViewDidLoad () [0x00000] in /Users/franklynweber/Documents/Programming/MyApp/MyApp.UI.Touch/Views/MainMenuViewController.cs:34
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging:void_objc_msgSend (intptr,intptr)
at MonoTouch.UIKit.UIWindow.MakeKeyAndVisible () [0x00008] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIWindow.g.cs:126
at MyApp.UI.Touch.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication app, MonoTouch.Foundation.NSDictionary options) [0x0003b] in /Users/franklynweber/Documents/Programming/MyApp/MyApp.UI.Touch/OtherClasses/AppDelegate.cs:46
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
at MyApp.UI.Touch.Application.Main (System.String[] args) [0x00000] in /Users/franklynweber/Documents/Programming/MyApp/MyApp.UI.Touch/OtherClasses/Main.cs:17
Stacktrace:
Native stacktrace:
0 MyApp 0x0007bf6c mono_handle_native_sigsegv + 284
1 MyApp 0x000c01ad sigabrt_signal_handler + 109
2 libsystem_c.dylib 0x9a5da59b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 libsystem_sim_c.dylib 0x0297457b abort + 140
5 MyApp 0x001ed17b monotouch_unhandled_exception_handler + 283
6 MyApp 0x00077dbc mono_invoke_unhandled_exception_hook + 140
7 MyApp 0x0007bbda mono_handle_exception_internal + 4154
8 MyApp 0x0007bd2f mono_handle_exception + 47
9 MyApp 0x000bce22 mono_x86_throw_exception + 306
10 ??? 0x07f30f8f 0x0 + 133369743
11 ??? 0x0bad1a5d 0x0 + 195893853
12 ??? 0x0bad13dd 0x0 + 195892189
13 ??? 0x0bad1164 0x0 + 195891556
14 ??? 0x0bad112c 0x0 + 195891500
15 ??? 0x11b0a360 0x0 + 296788832
16 ??? 0x11b09fca 0x0 + 296787914
17 ??? 0x11b09de2 0x0 + 296787426
18 ??? 0x11b09cf4 0x0 + 296787188
19 ??? 0x11b09c65 0x0 + 296787045
20 ??? 0x11b09b60 0x0 + 296786784
21 ??? 0x11b09a5c 0x0 + 296786524
22 ??? 0x11b099c4 0x0 + 296786372
23 ??? 0x07fe2059 0x0 + 134094937
24 MyApp 0x00008732 mono_jit_runtime_invoke + 722
25 MyApp 0x0014f39e mono_runtime_invoke + 126
26 MyApp 0x001e6296 monotouch_trampoline + 3686
27 UIKit 0x00a4b817 -[UIViewController loadViewIfRequired] + 536
28 UIKit 0x00a4b882 -[UIViewController view] + 33
29 UIKit 0x00a4bb2a -[UIViewController contentScrollView] + 36
30 UIKit 0x00a62ef5 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 36
31 UIKit 0x00a62fdb -[UINavigationController _layoutViewController:] + 43
32 UIKit 0x00a63286 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 254
33 UIKit 0x00a63381 -[UINavigationController _startTransition:fromViewController:toViewController:] + 72
34 UIKit 0x00a63eab -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
35 UIKit 0x00a63fc9 -[UINavigationController _startDeferredTransitionIfNeeded] + 41
36 UIKit 0x00a64055 -[UINavigationController __viewWillLayoutSubviews] + 33
37 UIKit 0x00b693ab -[UILayoutContainerView layoutSubviews] + 233
38 UIKit 0x009ba92d -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 279
39 libobjc.A.dylib 0x022086b0 -[NSObject performSelector:withObject:] + 70
40 QuartzCore 0x01952fc0 -[CALayer layoutSublayers] + 240
41 QuartzCore 0x0194733c _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 468
42 QuartzCore 0x01952eaf -[CALayer layoutIfNeeded] + 166
43 UIKit 0x00a598cd -[UIViewController window:setupWithInterfaceOrientation:] + 242
44 UIKit 0x009a21a6 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 5346
45 UIKit 0x009a0cbf -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82
46 UIKit 0x009a0bd9 -[UIWindow _setRotatableViewOrientation:duration:force:] + 89
47 UIKit 0x0099fe34 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke_0 + 224
48 UIKit 0x0099fc6e -[UIWindow _updateToInterfaceOrientation:duration:force:] + 209
49 UIKit 0x009a0a29 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 853
50 UIKit 0x009a3922 -[UIWindow setDelegate:] + 351
51 UIKit 0x00a4dfec -[UIViewController _tryBecomeRootViewControllerInWindow:] + 164
52 UIKit 0x0099abc4 -[UIWindow addRootViewControllerViewIfPossible] + 481
53 UIKit 0x0099adbf -[UIWindow _setHidden:forced:] + 368
54 UIKit 0x0099af55 -[UIWindow _orderFrontWithoutMakingKey] + 49
55 UIKit 0x009a3f67 -[UIWindow makeKeyAndVisible] + 65
56 ??? 0x11aee564 0x0 + 296674660
57 ??? 0x11b099a8 0x0 + 296786344
58 ??? 0x0bad24ee 0x0 + 195896558
59 ??? 0x0bad25df 0x0 + 195896799
60 MyApp 0x00008732 mono_jit_runtime_invoke + 722
61 MyApp 0x0014f39e mono_runtime_invoke + 126
62 MyApp 0x001e6296 monotouch_trampoline + 3686
63 UIKit 0x009677b7 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 266
64 UIKit 0x00967da7 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1248
65 UIKit 0x00968fab -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 805
66 UIKit 0x0097a315 -[UIApplication handleEvent:withNewEvent:] + 1022
67 UIKit 0x0097b24b -[UIApplication sendEvent:] + 85
68 UIKit 0x0096ccf8 _UIApplicationHandleEvent + 9874
69 GraphicsServices 0x02c98df9 _PurpleEventCallback + 339
70 GraphicsServices 0x02c98ad0 PurpleEventCallback + 46
71 CoreFoundation 0x01f34bf5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
72 CoreFoundation 0x01f34962 __CFRunLoopDoSource1 + 146
73 CoreFoundation 0x01f65bb6 __CFRunLoopRun + 2118
74 CoreFoundation 0x01f64f44 CFRunLoopRunSpecific + 276
75 CoreFoundation 0x01f64e1b CFRunLoopRunInMode + 123
76 UIKit 0x009687da -[UIApplication _run] + 774
77 UIKit 0x0096a65c UIApplicationMain + 1211
78 ??? 0x0bacf84c 0x0 + 195885132
79 ??? 0x0bace218 0x0 + 195879448
80 ??? 0x0bacdfb0 0x0 + 195878832
81 ??? 0x0bace03f 0x0 + 195878975
82 MyApp 0x00008732 mono_jit_runtime_invoke + 722
83 MyApp 0x0014f39e mono_runtime_invoke + 126
84 MyApp 0x001534c4 mono_runtime_exec_main + 420
85 MyApp 0x00157ff5 mono_runtime_run_main + 725
86 MyApp 0x000651a5 mono_jit_exec + 149
87 MyApp 0x001db7b5 main + 2005
88 MyApp 0x000021f5 start + 53
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
Thanks for any help.
Without the inner exception it's hard to know what has gone wrong - sorry.
I'd guess that there is some problem in initializing the geowatcher - either because:
the plugin isn't registered
you call this line before you've called Cirrious.MvvmCross.Plugins.Location.PluginLoader.Instance.EnsureLoaded()
or because of some 'app specific reason'.
The tutorial app uses the location plugin in: https://github.com/slodge/MvvmCross/tree/vnext/Sample%20-%20Tutorial/Tutorial/Tutorial.UI.Touch
Does the tutorial work for you? If it does, then you'll maybe need to look at comparing the two.
If the crash persists for you, then maybe:
- post the inner exception if you can?
- or post a small repo which demos the problem - I'd certainly need more code than I can see in this 2 line snippet.
Sorry for the lack of documentation. I am making a huge effort right now to create proper documents and tutorials for the new v3 released - but this is all self-funded!