-
Notifications
You must be signed in to change notification settings - Fork 17
Description
I have been experimenting with this library and love the idea of using a simple transcoding function to transcode to HLS. However, when I attempt to run it, I see a: Video Failed to Transcode error.
Here are the logs:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/workarea/temp.mp4':
2022-02-16T16:34:18.697201425Z
2022-02-16T16:34:18.698128484Z Metadata:
2022-02-16T16:34:18.698148313Z
2022-02-16T16:34:18.698882874Z major_brand :
2022-02-16T16:34:18.699399558Z isom
2022-02-16T16:34:18.699928312Z
2022-02-16T16:34:18.699965741Z
2022-02-16T16:34:18.700470265Z minor_version :
2022-02-16T16:34:18.701098757Z 512
2022-02-16T16:34:18.703977242Z
2022-02-16T16:34:18.704020311Z compatible_brands: isomiso2avc1mp41
2022-02-16T16:34:18.704025661Z encoder : Lavf58.76.100
2022-02-16T16:34:18.704028851Z Duration: 00:00:06.84, start: 0.000000, bitrate: 504 kb/s
2022-02-16T16:34:18.704031991Z Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x360 [SAR 1:1 DAR 16:9], 500 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
2022-02-16T16:34:18.704035331Z Metadata:
2022-02-16T16:34:18.704038311Z handler_name : Apple Video Media Handler
2022-02-16T16:34:18.704041321Z vendor_id : [0][0][0][0]
2022-02-16T16:34:18.704044311Z timecode : 00:00:00:00
2022-02-16T16:34:18.704047281Z Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
2022-02-16T16:34:18.704050361Z Metadata:
2022-02-16T16:34:18.704053281Z handler_name : Apple Video Media Handler
2022-02-16T16:34:18.704068671Z timecode : 00:00:00:00
2022-02-16T16:34:18.704071831Z Stream mapping:
2022-02-16T16:34:18.704074771Z Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
2022-02-16T16:34:18.704078491Z Stream #0:0 -> #1:0 (h264 (native) -> h264 (libx264))
2022-02-16T16:34:18.704081601Z Stream #0:0 -> #2:0 (h264 (native) -> h264 (libx264))
2022-02-16T16:34:18.704093230Z Stream #0:0 -> #3:0 (h264 (native) -> h264 (libx264))
2022-02-16T16:34:18.704096660Z Press [q] to stop, [?] for help
2022-02-16T16:34:18.704101220Z
2022-02-16T16:34:18.707365070Z [libx264 @ 0x7f9b7e073080]
2022-02-16T16:34:18.708059072Z using SAR=1/1
2022-02-16T16:34:18.708074332Z
2022-02-16T16:34:18.709108509Z [libx264 @ 0x7f9b7e073080]
2022-02-16T16:34:18.709683522Z using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
2022-02-16T16:34:18.709698211Z
2022-02-16T16:34:18.710854357Z [libx264 @ 0x7f9b7e073080]
2022-02-16T16:34:18.711376421Z profile Main, level 3.0, 4:2:0, 8-bit
2022-02-16T16:34:18.711390130Z
2022-02-16T16:34:18.712089242Z [libx264 @ 0x7f9b7e073080]
2022-02-16T16:34:18.712569586Z 264 - core 163 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 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=48 keyint_min=4 scenecut=0 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=856 vbv_bufsize=1200 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
2022-02-16T16:34:18.712591826Z
2022-02-16T16:34:18.713376336Z Output #0, hls, to '/workarea/transcoded/360.m3u8':
2022-02-16T16:34:18.713397356Z
2022-02-16T16:34:18.713942509Z Metadata:
2022-02-16T16:34:18.713957319Z
2022-02-16T16:34:18.714452443Z major_brand :
2022-02-16T16:34:18.714951167Z isom
2022-02-16T16:34:18.715437171Z
2022-02-16T16:34:18.715450960Z
2022-02-16T16:34:18.716216561Z minor_version :
2022-02-16T16:34:18.716870083Z 512
2022-02-16T16:34:18.717400967Z
2022-02-16T16:34:18.717414286Z
2022-02-16T16:34:18.717946920Z compatible_brands:
2022-02-16T16:34:18.719932105Z isomiso2avc1mp41
2022-02-16T16:34:18.719962695Z encoder : Lavf58.76.100
2022-02-16T16:34:18.719967945Z Stream #0:0(eng): Video: h264, yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 800 kb/s, 25 fps, 90k tbn (default)
2022-02-16T16:34:18.720024154Z Metadata:
2022-02-16T16:34:18.720028654Z handler_name : Apple Video Media Handler
2022-02-16T16:34:18.720031844Z vendor_id : [0][0][0][0]
2022-02-16T16:34:18.720034864Z timecode : 00:00:00:00
2022-02-16T16:34:18.720037864Z encoder : Lavc58.134.100 libx264
2022-02-16T16:34:18.720040984Z Side data:
2022-02-16T16:34:18.720044014Z cpb: bitrate max/min/avg: 856000/0/800000 buffer size: 1200000 vbv_delay: N/A
2022-02-16T16:34:18.720047184Z
2022-02-16T16:34:18.722026499Z [libx264 @ 0x7f9b7e070040]
2022-02-16T16:34:18.722737191Z using SAR=1264/1263
2022-02-16T16:34:18.722754340Z
2022-02-16T16:34:18.723936976Z [libx264 @ 0x7f9b7e070040]
2022-02-16T16:34:18.724572888Z using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
2022-02-16T16:34:18.724589808Z
2022-02-16T16:34:18.725962531Z [libx264 @ 0x7f9b7e070040]
2022-02-16T16:34:18.726550144Z profile Main, level 3.0, 4:2:0, 8-bit
2022-02-16T16:34:18.726566044Z
2022-02-16T16:34:18.727258805Z [libx264 @ 0x7f9b7e070040]
2022-02-16T16:34:18.727866138Z 264 - core 163 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 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=48 keyint_min=4 scenecut=0 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1 vbv_bufsize=2100 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
2022-02-16T16:34:18.727886287Z
2022-02-16T16:34:18.728757417Z Output #1, hls, to '/workarea/transcoded/480.m3u8':
2022-02-16T16:34:18.728774096Z
2022-02-16T16:34:18.729346569Z Metadata:
2022-02-16T16:34:18.729363099Z
2022-02-16T16:34:18.729911732Z major_brand :
2022-02-16T16:34:18.730551595Z isom
2022-02-16T16:34:18.731095898Z
2022-02-16T16:34:18.731111238Z
2022-02-16T16:34:18.731729960Z minor_version :
2022-02-16T16:34:18.732325323Z 512
2022-02-16T16:34:18.732922315Z
2022-02-16T16:34:18.732938075Z
2022-02-16T16:34:18.733518588Z compatible_brands:
2022-02-16T16:34:18.740227255Z isomiso2avc1mp41
2022-02-16T16:34:18.740268335Z encoder : Lavf58.76.100
2022-02-16T16:34:18.740274125Z Stream #1:0(eng): Video: h264, yuv420p(tv, bt709, progressive), 842x474 [SAR 1264:1263 DAR 16:9], q=2-31, 1400 kb/s, 25 fps, 90k tbn (default)
2022-02-16T16:34:18.740308894Z Metadata:
2022-02-16T16:34:18.740314014Z handler_name : Apple Video Media Handler
2022-02-16T16:34:18.740318424Z vendor_id : [0][0][0][0]
2022-02-16T16:34:18.740322794Z timecode : 00:00:00:00
2022-02-16T16:34:18.740326914Z encoder : Lavc58.134.100 libx264
2022-02-16T16:34:18.740332134Z Side data:
2022-02-16T16:34:18.740336274Z cpb: bitrate max/min/avg: 1000/0/1400000 buffer size: 2100000 vbv_delay: N/A
2022-02-16T16:34:18.740340694Z [libx264 @ 0x7f9b7e070dc0] using SAR=1/1
2022-02-16T16:34:18.740344774Z [libx264 @ 0x7f9b7e070dc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
2022-02-16T16:34:18.740349244Z
2022-02-16T16:34:18.742774554Z [libx264 @ 0x7f9b7e070dc0]
2022-02-16T16:34:18.743517015Z profile Main, level 3.1, 4:2:0, 8-bit
2022-02-16T16:34:18.743532135Z
2022-02-16T16:34:18.744453113Z [libx264 @ 0x7f9b7e070dc0]
2022-02-16T16:34:18.744932688Z 264 - core 163 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 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=48 keyint_min=4 scenecut=0 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2996 vbv_bufsize=4200 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
2022-02-16T16:34:18.744948617Z
2022-02-16T16:34:18.745685328Z Output #2, hls, to '/workarea/transcoded/720.m3u8':
2022-02-16T16:34:18.745699058Z
2022-02-16T16:34:18.746266651Z Metadata:
2022-02-16T16:34:18.746282371Z
2022-02-16T16:34:18.746803245Z major_brand :
2022-02-16T16:34:18.747327988Z isom
2022-02-16T16:34:18.747841132Z
2022-02-16T16:34:18.747856802Z
2022-02-16T16:34:18.748438584Z minor_version :
2022-02-16T16:34:18.748965328Z 512
2022-02-16T16:34:18.749523291Z
2022-02-16T16:34:18.749537631Z
2022-02-16T16:34:18.750041485Z compatible_brands:
2022-02-16T16:34:18.750536028Z isomiso2avc1mp41
2022-02-16T16:34:18.751081782Z
2022-02-16T16:34:18.751095301Z
2022-02-16T16:34:18.751614425Z encoder :
2022-02-16T16:34:18.756053391Z Lavf58.76.100
2022-02-16T16:34:18.756126720Z Stream #2:0(eng): Video: h264, yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 2800 kb/s, 25 fps, 90k tbn (default)
2022-02-16T16:34:18.756147119Z Metadata:
2022-02-16T16:34:18.756150789Z handler_name : Apple Video Media Handler
2022-02-16T16:34:18.756153939Z vendor_id : [0][0][0][0]
2022-02-16T16:34:18.756156939Z timecode : 00:00:00:00
2022-02-16T16:34:18.756159959Z encoder : Lavc58.134.100 libx264
2022-02-16T16:34:18.756163059Z Side data:
2022-02-16T16:34:18.756166089Z cpb: bitrate max/min/avg: 2996000/0/2800000 buffer size: 4200000 vbv_delay: N/A
2022-02-16T16:34:18.756169319Z
2022-02-16T16:34:18.758655879Z [libx264 @ 0x7f9b7e071b40]
2022-02-16T16:34:18.759234091Z using SAR=1/1
2022-02-16T16:34:18.759249141Z
2022-02-16T16:34:18.760256449Z [libx264 @ 0x7f9b7e071b40]
2022-02-16T16:34:18.760767103Z using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
2022-02-16T16:34:18.760780722Z
2022-02-16T16:34:18.762790678Z [libx264 @ 0x7f9b7e071b40]
2022-02-16T16:34:18.763356371Z profile Main, level 4.0, 4:2:0, 8-bit
2022-02-16T16:34:18.763369901Z
2022-02-16T16:34:18.764496127Z [libx264 @ 0x7f9b7e071b40]
2022-02-16T16:34:18.765015170Z 264 - core 163 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 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=48 keyint_min=4 scenecut=0 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=5350 vbv_bufsize=7500 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
2022-02-16T16:34:18.765030770Z
2022-02-16T16:34:18.765753941Z Output #3, hls, to '/workarea/transcoded/1080.m3u8':
2022-02-16T16:34:18.765768251Z
2022-02-16T16:34:18.766275155Z Metadata:
2022-02-16T16:34:18.766288575Z
2022-02-16T16:34:18.766787528Z major_brand :
2022-02-16T16:34:18.767315622Z isom
2022-02-16T16:34:18.767814516Z
2022-02-16T16:34:18.767829215Z
2022-02-16T16:34:18.768360019Z minor_version :
2022-02-16T16:34:18.768859133Z 512
2022-02-16T16:34:18.769346907Z
2022-02-16T16:34:18.769360437Z
2022-02-16T16:34:18.769800871Z compatible_brands:
2022-02-16T16:34:18.770278295Z isomiso2avc1mp41
2022-02-16T16:34:18.770778259Z
2022-02-16T16:34:18.770791829Z
2022-02-16T16:34:18.771321553Z encoder :
2022-02-16T16:34:18.771817176Z Lavf58.76.100
2022-02-16T16:34:18.776224772Z
2022-02-16T16:34:18.776308511Z Stream #3:0(eng): Video: h264, yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 5000 kb/s, 25 fps, 90k tbn (default)
2022-02-16T16:34:18.776313251Z Metadata:
2022-02-16T16:34:18.776316391Z handler_name : Apple Video Media Handler
2022-02-16T16:34:18.776319411Z vendor_id : [0][0][0][0]
2022-02-16T16:34:18.776322411Z timecode : 00:00:00:00
2022-02-16T16:34:18.776325571Z encoder : Lavc58.134.100 libx264
2022-02-16T16:34:18.776328611Z Side data:
2022-02-16T16:34:18.776331581Z cpb: bitrate max/min/avg: 5350000/0/5000000 buffer size: 7500000 vbv_delay: N/A
2022-02-16T16:34:18.776334701Z frame= 1 fps=0.0 q=0.0 q=0.0 q=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x
2022-02-16T16:34:19.274675975Z frame= 29 fps=0.0 q=0.0 q=0.0 q=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed= 0x
2022-02-16T16:34:20.282286289Z crond: wakeup dt=10
2022-02-16T16:34:20.538657563Z Child exited with code null
2022-02-16T16:34:20.547018270Z Something went wrong Video Failed to Transcode
As you can see the error 'Video Failed to Transcode' is displayed
I see an index.m3u8 file created in the designated directory . This contains the following entries:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360
360.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1400000,RESOLUTION=842x480
480.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2800000,RESOLUTION=1280x720
720.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=5000000,RESOLUTION=1920x1080
The code that is producing this is:
ffmpeg(fromurl)
.format('mp4')
.size('640x?')
.videoCodec('libx264')
.aspect('16:9')
.on('error', (err, stdout, stderr) => {
console.error('An error occured during encoding', err.message);
console.error('stdout:', stdout);
console.error('stderr:', stderr);
})
.on("progress", (progress) => console.log('Here is progress', progress))
.on('end', async function() {
console.log('Finished processing');
const t = new Transcoder.Transcoder('/workarea/temp.mp4', '/workarea/transcoded', {showLogs: true});
try {
const hlsPath = await t.transcode();
console.log('Successfully Transcoded Video');
console.log('Files', getAllFiles('/workarea/'));
fs.unlink(fromurl, (err) => {
if (err) {
console.log("failed to delete local image:"+err);
} else {
console.log('successfully deleted ', fromurl);
}
});
} catch(e){
console.log('Something went wrong', e);
fs.unlink(fromurl, (err) => {
if (err) {
console.log("failed to delete local image:"+err);
} else {
console.log('successfully deleted ', fromurl);
}
});
}
This takes a video file and first converts to mp4 and then attempts to transcode as a second stage to m3u8.
Would appreciate your thoughts on what might be happening...