kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
1.98k stars 439 forks source link

audio track selection problem #1042

Open wnpllrzodiac opened 5 years ago

wnpllrzodiac commented 5 years ago

http://1.2.3.4:9880/hls/cut_good.mp4/tracks/v1-a2/index.m3u8 no audio track found

But source clip has 1 video track and 4 audio track ffprobe cut_good.mp4

  Duration: 00:00:30.89, start: 0.000000, bitrate: 2377 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], 2105 kb/s, 23.98 fps, 23.98 tbr, 16k tbn, 47.95 tbc (default
)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo,
 fltp, 65 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(chi): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo,
 fltp, 65 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:3(chi): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo,
 fltp, 65 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:4(chi): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo,
 fltp, 65 kb/s
    Metadata:
      handler_name    : SoundHandler
[hls,applehttp @ 0000002842f13d80] Opening 'http://1.2.3.4:9880/hls/cut_go
od.mp4/tracks/v1-a2/seg-1-v1.ts' for reading
[hls,applehttp @ 0000002842f13d80] Opening 'http://1.2.3.4:9880/hls/cut_go
od.mp4/tracks/v1-a2/seg-2-v1.ts' for reading
Input #0, hls,applehttp, from 'http://1.2.3.4:9880/hls/cut_good.mp4/tracks
/v1-a2/index.m3u8':
  Duration: 00:00:30.87, start: 0.185000, bitrate: 0 kb/s
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
      variant_bitrate : 0
   1.15 M-V:  0.001 fd=   0 aq=    0KB vq=  472KB sq=    0B f=0/0
wnpllrzodiac commented 5 years ago

sample clip as follows:

http://iloveyaya.ga:9108/test/tmp/cut_good.mp4

BTW, stream index base on 0 or 1, and based on whole stream index or a/v seperate. e.g. one clip has v0, a0, a1, a2 selection v0+a0 should be v1-a1 ? selection v0+a1+a2 should be v1-a2-a3 ?

erankor commented 5 years ago

Works fine for me -

# curl localhost:8001/local/hls/content/cut_good.mp4/master.m3u8
#EXTM3U

#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio0",NAME="English",LANGUAGE="en",AUTOSELECT=YES,DEFAULT=YES,CHANNELS="2",URI="http://localhost:8001/local/hls/content/cut_good.mp4/index-a1.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio0",NAME="中文; 汉语; 华语",LANGUAGE="zh",AUTOSELECT=NO,DEFAULT=NO,CHANNELS="2",URI="http://localhost:8001/local/hls/content/cut_good.mp4/index-a2.m3u8"

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2170204,RESOLUTION=1280x720,FRAME-RATE=24.390,CODECS="avc1.640029,mp4a.40.2",AUDIO="audio0"
http://localhost:8001/local/hls/content/cut_good.mp4/index-v1-a1.m3u8

#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=84772,RESOLUTION=1280x720,CODECS="avc1.640029",URI="http://localhost:8001/local/hls/content/cut_good.mp4/iframes-v1-a1.m3u8"

Also verified with a player that selecting each audio track gives the expected language. The master returns only the first Chinese track since it can't output more than one per language.

Regarding the indexes, they are 1-based, and they are counted separately for video/audio.

wnpllrzodiac commented 5 years ago

Maybe duplicated problem as #1041

wnpllrzodiac commented 5 years ago

one more question, does nginx-vod-module support multi track selection? e.g. tracks/v1-a1-a2-a3 for 1 video and 3 audio tracks tracks/v1-v2-a1-a2 for 2 video and 2 audio tracks

erankor commented 5 years ago

In requests such as master.m3u8/manifest.mpd - yes, this will limit the set of tracks used in the manifest (the default is to take all). However, the module does not generate TS/fMP4 with more than one audio/video track. If you try to call index-a1-a2.m3u8 you will get an error.

Alexander-Kane commented 1 month ago

The master returns only the first Chinese track since it can't output more than one per language.

What is the reason for such a limitation, one track per language? It is very necessary to output several more tracks for one language, is it impossible? Is there any way to customize this?