HLS-24: Encode fails where audio stream present but null



Issue Information

Issue Type: Bug
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: HLS Stream Creator (HLS)
Resolution: Done (2019-07-26 13:17:37)
Affects Version: 1.0,
Target version: 1.0,
Components: Transcoding ,
Labels: Audio,

Created: 2017-07-16 14:55:46
Time Spent Working
Estimated:
 
45 minutes
Remaining:
 
45 minutes
Logged:
 
0 minutes


Description
HLS Stream creator will fail to run where an audio stream is present but shows as type none
  Duration: 00:00:00.00, start: 4241.278000, bitrate: N/A
    Stream #0:0: Video: flv1, 1 reference frame, yuv420p, 1280x720, 199 kb/s, 8.33 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: none, 0 channels


The resulting error is
  Duration: 00:00:00.00, start: 4241.278000, bitrate: N/A
    Stream #0:0: Video: flv1, 1 reference frame, yuv420p, 1280x720, 199 kb/s, 8.33 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: none, 0 channels
[graph 0 input from stream 0:0 @ 0xace980] w:1280 h:720 pixfmt:yuv420p tb:1/1000 fr:25/3 sar:0/1 sws_param:flags=2
No decoder for stream #0:1, filtering impossible
Error opening filters!
Invoking deleteStream


This can be mitigated by setting an FFMPEG flag to tell ffmpeg to ignore the audio stream:
ben@milleniumfalcon:/tmp/HLSCreate$ FFMPEG_FLAGS="-an"
ben@milleniumfalcon:/tmp/HLSCreate$ export FFMPEG_FLAGS
ben@milleniumfalcon:/tmp/HLSCreate$ ./HLS-Stream-Creator.sh -l -i rtmp://ent1/camtest/camera -s 2


But it'd be nice to have a commandline flag to be able to do this


Issue Links

Toggle State Changes

Activity



Repo: HLS-Stream-Creator
Commit: db85e45814b2a163c5ae927bca36a74460483fe7
Author: B Tasker <github@<Domain Hidden>>

Date: Fri Jul 26 13:03:02 2019 +0100
Commit Message: HLS-24 Allow audio track to be ignored with the -n commandline argument

This forces -an to be passed to ffmpeg.

It's not generally required, as missing audio tracks will be handled by default, but this allows the user to address inputs where `ffmpeg` reports the Audio type as `none`:
    Stream #0:0: Video: flv1, 1 reference frame, yuv420p, 1280x720, 199 kb/s, 8.33 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: none, 0 channels

This test stream was the result of a webcam being published into an RTMP relay with FFMPEG and then pulled back out the other side.



Modified (-)(+)
-------
HLS-Stream-Creator.sh
README.md




Webhook User-Agent

GitHub-Hookshot/20c7c42


View Commit

Commit db85e4 implements a new commandline flag -n

When this flag is present in the HLS-Stream-Creator commandline, we'll pass ffmpeg the flag -an in order to disable audio.

This leads to a slightly odd (but fine) ffmpeg command, in that we specify the audio codec to use, and then disable audio anyway.
ffmpeg -i ~/How_to_Build_a_Cathedral--.mp4 -y -vcodec libx264 -acodec aac -threads 0 -map 0 -flags -global_header -f segment -segment_list ./output/How_to_Build_a_Cathedral--.mp4.m3u8 -segment_time 10 -segment_format mpeg_ts -an ./output/How_to_Build_a_Cathedral--.mp4_%05d.ts

It's a little odd looking but doesn't cause any harm, so it seems foolish to introduce additional complexity to remove arguments from a command the user will never routinely see anyway.
btasker added 'Audio' to labels
btasker changed status from 'Open' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'