Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-M/--mux-after-done option with ffmpeg is broken for some HLS addresses #198

Closed
aorinngoDo opened this issue Jun 17, 2023 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@aorinngoDo
Copy link

Summary

When merging with ffmpeg using the -M / --mux-after-done option, the files are not merged correctly and only audio or video files are output for some addresses.
This problem is occurring in v0.1.8-beta.
Probably related to the following commit: 2e6d10d .

1. Examples of unexpected behavior (different from previous versions)

This HLS address
Output file contains only audio.
I assume that the map is not specified correctly because video and audio are aggregated to the same address.

Commands that do NOT work correctly

$ N_m3u8DL-RE https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8 --save-name mux-test1 -M format=mkv:muxer=ffmpeg

03:39:35.561 INFO : N_m3u8DL-RE (Beta version) 20230615
03:39:35.610 INFO : Loading URL: https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8
03:39:39.407 INFO : Content Matched: HTTP Live Streaming
03:39:39.407 INFO : Parsing streams...
03:39:39.410 WARN : Master List detected, try parse all streams
03:39:39.429 WARN : Writing meta json
03:39:39.485 INFO : Extracted, there are 7 streams, with 7 basic streams, 0 audio streams, 0 subtitle streams
03:39:39.486 INFO : Vid 1680x750 | 2468 Kbps | 24 | mp4a.40.2,avc1.100.40 | SDR
03:39:39.490 INFO : Vid 1680x750 | 1727 Kbps | 24 | mp4a.40.2,avc1.100.40 | SDR
03:39:39.490 INFO : Vid 784x350 | 1197 Kbps | 24 | mp4a.40.2,avc1.77.31
03:39:39.491 INFO : Vid 448x200 | 932 Kbps | 24 | mp4a.40.2,avc1.66.30
03:39:39.491 INFO : Vid 224x100 | 493 Kbps | 24 | mp4a.40.2,avc1.66.30
03:39:39.492 INFO : Vid 136 Kbps | mp4a.40.2
03:39:39.492 INFO : Vid 68 Kbps | mp4a.40.2
Please select what you want to download:                            
                                                                    
> [ ] Basic                                                         
    [X] Vid 1680x750 | 2468 Kbps | 24 | mp4a.40.2,avc1.100.40 | SDR 
    [ ] Vid 1680x750 | 1727 Kbps | 24 | mp4a.40.2,avc1.100.40 | SDR 
    [ ] Vid 784x350 | 1197 Kbps | 24 | mp4a.40.2,avc1.77.31         
    [ ] Vid 448x200 | 932 Kbps | 24 | mp4a.40.2,avc1.66.30          
    [ ] Vid 224x100 | 493 Kbps | 24 | mp4a.40.2,avc1.66.30          
    [ ] Vid 136 Kbps | mp4a.40.2                                    
    [ ] Vid 68 Kbps | mp4a.40.2                                     
                                                                    
(Press <space> to toggle a stream, <enter> to accept)

##### omission #####

03:43:21.633 WARN : mux-test1.mp4
03:43:21.633 WARN : Muxing to mux-test1.MUX.mkv
03:43:22.044 WARN : Cleaning files...
03:43:22.081 WARN : Rename to mux-test1.mkv
03:43:22.081 INFO : Done

$ ffprobe -hide_banner mux-test1.mkv 
Input #0, matroska,webm, from 'mux-test1.mkv':
  Metadata:
    DATE            : 2023-06-18T03:43:21.6338648+09:00
    ENCODER         : Lavf60.3.100
  Duration: 00:12:13.99, start: 0.000000, bitrate: 130 kb/s
  Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Metadata:
      VENDOR_ID       : [0][0][0][0]
      HANDLER_NAME    : SoundHandler
      DURATION        : 00:12:13.994000000

2. Example of correct behavior (same as previous versions)

This HLS address
Output file contains audio and video.
I assume that the map is correctly specified because the video and audio are at separate addresses.

Commands that work correctly

$ N_m3u8DL-RE https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8 --drop-subtitle all --save-name mux-test2 -M format=mkv:muxer=ffmpeg
03:44:30.178 INFO : N_m3u8DL-RE (Beta version) 20230615
03:44:30.200 INFO : Loading URL: https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8
03:44:31.368 INFO : Content Matched: HTTP Live Streaming
03:44:31.369 INFO : Parsing streams...
03:44:31.369 WARN : Master List detected, try parse all streams
03:44:31.438 WARN : Writing meta json
03:44:31.439 INFO : Extracted, there are 15 streams, with 6 basic streams, 1 audio streams, 8 subtitle streams
03:44:31.440 INFO : Vid 1920x1080 | 1924 Kbps | mp4a.40.2
03:44:31.440 INFO : Vid 1280x720 | 1030 Kbps | mp4a.40.2
03:44:31.441 INFO : Vid 960x540 | 915 Kbps | mp4a.40.2
03:44:31.442 INFO : Vid 640x360 | 577 Kbps | mp4a.40.2
03:44:31.443 INFO : Vid 416x234 | 263 Kbps | mp4a.40.2
03:44:31.443 INFO : Vid 41 Kbps | mp4a.40.2
03:44:31.444 INFO : Aud bipbop_audio | BipBop Audio 2 | eng
03:44:31.444 INFO : Sub subs | en | English | describes-music-and-sound
03:44:31.444 INFO : Sub subs | en | English (Forced)
03:44:31.445 INFO : Sub subs | fr | Français | describes-music-and-sound
03:44:31.445 INFO : Sub subs | fr | Français (Forced)
03:44:31.446 INFO : Sub subs | es | Español | describes-music-and-sound
03:44:31.447 INFO : Sub subs | es | Español (Forced)
03:44:31.447 INFO : Sub subs | ja | 日本語 | describes-music-and-sound
03:44:31.448 INFO : Sub subs | ja | 日本語 (Forced)
Please select what you want to download:             
                                                     
> [ ] Basic                                          
    [X] Vid 1920x1080 | 1924 Kbps | mp4a.40.2        
    [ ] Vid 1280x720 | 1030 Kbps | mp4a.40.2         
    [ ] Vid 960x540 | 915 Kbps | mp4a.40.2           
    [ ] Vid 640x360 | 577 Kbps | mp4a.40.2           
    [ ] Vid 416x234 | 263 Kbps | mp4a.40.2           
    [ ] Vid 41 Kbps | mp4a.40.2                      
  [ ] Audio                                          
    [X] Aud bipbop_audio | BipBop Audio 2 | eng      
                                                     
(Press <space> to toggle a stream, <enter> to accept)

##### omission #####

03:45:23.754 WARN : mux-test2.mp4
03:45:23.754 WARN : mux-test2.eng.m4a
03:45:23.754 WARN : Muxing to mux-test2.MUX.mkv
03:45:24.871 WARN : Cleaning files...
03:45:24.943 WARN : Rename to mux-test2.mkv
03:45:24.943 INFO : Done

$ ffprobe -hide_banner mux-test2.mkv 
Input #0, matroska,webm, from 'mux-test2.mkv':
  Metadata:
    DATE            : 2023-06-18T03:28:59.4394065+09:00
    ENCODER         : Lavf60.3.100
  Duration: 00:30:00.17, start: 0.000000, bitrate: 156 kb/s
  Stream #0:0: Audio: aac (LC), 22050 Hz, stereo, fltp (default)
    Metadata:
      VENDOR_ID       : [0][0][0][0]
      HANDLER_NAME    : SoundHandler
      DURATION        : 00:30:00.010000000
  Stream #0:1(eng): Audio: aac (LC), 44100 Hz, stereo, fltp (default)
    Metadata:
      title           : BipBop Audio 2
      VENDOR_ID       : [0][0][0][0]
      HANDLER_NAME    : SoundHandler
      DURATION        : 00:30:00.173000000

3. Merged correctly with mkvmerge

Address is the same as 1.

Commands with mkvmerge

$ N_m3u8DL-RE https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel.ism/.m3u8 --save-name mux-test-mkvmerge -M format=mkv:muxer=mkvmerge

##### omission #####

$ ffprobe -hide_banner mux-test-mkvmerge.mkv 
Input #0, matroska,webm, from 'mux-test-mkvmerge.mkv':
  Metadata:
    encoder         : libebml v1.4.2 + libmatroska v1.6.3
    creation_time   : 2023-06-17T18:32:59.000000Z
  Duration: 00:12:14.04, start: 0.000000, bitrate: 2222 kb/s
  Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1680x750 [SAR 1:1 DAR 56:25], 24 fps, 24 tbr, 1k tbn (default)
    Metadata:
      BPS             : 2091969
      DURATION        : 00:12:14.000000000
      NUMBER_OF_FRAMES: 17616
      NUMBER_OF_BYTES : 191938193
      _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2023-06-17 18:32:59
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Metadata:
      BPS             : 128000
      DURATION        : 00:12:13.994000000
      NUMBER_OF_FRAMES: 34406
      NUMBER_OF_BYTES : 11743915
      _STATISTICS_WRITING_APP: mkvmerge v65.0.0 ('Too Much') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2023-06-17 18:32:59
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
@nilaoda nilaoda added the bug Something isn't working label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants