VideoHelp Forum



Support our site by donate $5 directly to us Thanks!!!

Try StreamFab Downloader and download streaming video from Netflix, Amazon!



+ Reply to Thread
Results 1 to 29 of 29
  1. hello,
    I'm downloading a video from an available stream using the command/application:
    Code:
    N_m3u8DL-RE -M format=mp4 --key [some_keys1:some_keys2] "http://link_to_manifest_file.mpd" --save-dir C:\Video --save-name videofilename
    or...
    Code:
    N_m3u8DL-RE -M format=mkv --key [some_keys1:some_keys2] "http://link_to_manifest_file.mpd" --save-dir C:\Video --save-name videofilename
    Which option is better: mkv or mp4 ?
    Is there any "practical" difference between these format ? ( file size is very similar), or does it not matter, I won't notice any difference? ( quality )
    for some reason the streamfab app has this option

    Regards ,
    misiek
    Image
    [Attachment 77060 - Click to enlarge]
    Quote Quote  
  2. This only has an effect on the container used (i.e. how the data is organized inside the file) and the file extension. The actual video and audio streams will be exactly the same, no quality difference.

    Other than that, MKV (matroska) is more suited to contain multiple streams than MP4.
    Quote Quote  
  3. Originally Posted by white_snake View Post
    MKV is more suited to contain multiple streams than MP4
    yep, this only is the difference between the two format
    Quote Quote  
  4. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by lomero View Post
    Originally Posted by white_snake View Post
    MKV is more suited to contain multiple streams than MP4
    yep, this only is the difference between the two format
    In my experience MKV produces a smaller file size compared with mp4. The difference might not be much, but if you store the files in a NAS, or whatever, it is an important consideration. I've moved to mkv, by choice, because of this.
    Noob Starter Pack. Just download every Widevine mpd! Not kidding!.
    https://files.videohelp.com/u/301890/hellyes6.zip
    Quote Quote  
  5. Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by lomero View Post
    Originally Posted by white_snake View Post
    MKV is more suited to contain multiple streams than MP4
    yep, this only is the difference between the two format
    In my experience MKV produces a smaller file size compared with mp4. The difference might not be much, but if you store the files in a NAS, or whatever, it is an important consideration. I've moved to mkv, by choice, because of this.
    Now that you mention it, there's another important difference that might be relevant in some cases: MP4 still has more compatibility with older or bad setups. One example of bad setups is Samsung TVs reading from a file on the network: both MKV and MP4 can be reproduced of course, but there's a weird bug that makes it impossible to seek through (e.g.: jump forward or back) MKV files (this is actually unrelated to the container used, but depends just on the extension, more info here). To make it even more weirder, this problem does not occur if the file is read from a drive plugged directly into the TV.
    Quote Quote  
  6. Anonymous84
    Guest
    --
    Last edited by Anonymous84; 8th May 2024 at 18:16. Reason: --
    Quote Quote  
  7. Thank you for all tips and answers,
    from my side the topic is fully clarified
    Quote Quote  
  8. Originally Posted by white_snake View Post
    Now that you mention it, there's another important difference that might be relevant in some cases: MP4 still has more compatibility with older or bad setups. One example of bad setups is Samsung TVs reading from a file on the network: both MKV and MP4 can be reproduced of course, but there's a weird bug that makes it impossible to seek through (e.g.: jump forward or back) MKV files (this is actually unrelated to the container used, but depends just on the extension, more info here). To make it even more weirder, this problem does not occur if the file is read from a drive plugged directly into the TV.
    Exactly!
    So, when someone says "which is better" the answer would depend on "what is the point of getting the videos in the first place, what will they be played on" etc.
    I have an LG TV that often has some weird bugs with MKV. When remuxed to MP4, no such problems. It could be also something else that ffmpeg does but...
    click click2
    If I/my posts ever helped you, and you want to give back, send me a private message!
    Quote Quote  
  9. Member
    Join Date
    Dec 2021
    Location
    Scotland
    Search Comp PM
    mp4 and mkv are just containers. They play no part in the actual quality of the contained video and audio streams (those are essentially identical).
    Now in terms of filesize, I've just done a simple conversion of two different mp4 files using the generic:
    ffmpeg -i input.mp4 -c:v copy -c:a copy output.mkv
    Both have only one audio and one video stream in them with no extra metadata.

    File#1: mp4: 790,050KB mkv: 789,839KB difference: 211KB = 0.024%
    File#2: mp4: 2,526,474KB mkv: 2,525,252KB difference: 1222KB = 0.048%

    So, mkv a tiny teensy weeny bit smaller. But not anything I would worry about.

    In terms of compatibility, mp4 wins hands down. There are still many playback devices (particularly older ones like older TVs) that cannot handle mkv. But, even that's not as clear cut. I usually mux my subs into the container (either mp4 or mkv) since I hate having a separate folder for each file just to have a separate srt file. I have found some playback devices that can handle both mp4 and mkv, but whilst they recognise the subs in mkv, they will not in mp4.

    So, there's plusses and minuses for both containers. I use both since I'm not really fussed about it.

    At the end of the day, it's what works best for you.

    Another big compatibility issue is AAC vs AC3 audio. Pretty much everything that you download from normal streaming sites is AAC. However, there are many downloads from (say) torrenting sites that use AC3. Many old playback devices cannot play AC3 codec.
    Last edited by deccavox; 18th Feb 2024 at 07:31.
    Quote Quote  
  10. Originally Posted by deccavox View Post
    Many old playback devices cannot play AC3 codec.
    You mean: "cannot play AAC codec." If you speak of older devices.
    I also prefer MKV, by the way, more robust, nice to handle, f. e. you can mux (and demux) srt-subtitles...
    Quote Quote  
  11. Member
    Join Date
    Dec 2021
    Location
    Scotland
    Search Comp PM
    Originally Posted by Quint View Post
    Originally Posted by deccavox View Post
    Many old playback devices cannot play AC3 codec.
    You mean: "cannot play AAC codec." If you speak of older devices.
    No, I mean what I said.
    X/H264 video, with AAC audio in mp4 container is good for most old devices.
    Quote Quote  
  12. Oh. New to me.
    I have at least two older devices, that cannot play aac, but ac3, and I always have to convert before watching.
    Must be the combination mp4+ac3 with your devices. And maybe my devices are "even older" devices.
    Quote Quote  
  13. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    And another point to add to MKV small file-size:- at some stage in the decryption process we need to merge audio, video and subtitles. The alternatives are ffmpeg for mp4 or mkvmerge for mkv. Not that this will mean much to you if you just take what is given in a script, but mkvmerge is miles-ahead faster in use. So coders prefer it.
    Noob Starter Pack. Just download every Widevine mpd! Not kidding!.
    https://files.videohelp.com/u/301890/hellyes6.zip
    Quote Quote  
  14. hello,
    I previously wrote that the topic had been clarified, but a new questions appeared, maybe this is a good opportunity to ask it here and now

    1) when I use :
    Code:
    N_m3u8DL-RE -M format=mp4 --key [KEY1:KEY2] "http://xxxxxxxxxxxxxxxxxxxxxxxxx/manifest.mpd" --save-dir C:\Video --save-name Movie.001
    Then I get
    Image
    [Attachment 77151 - Click to enlarge]


    then i must manually select Aud * CENC 3 with 128 and codec mp4a,
    ( ec-3 codec, may not be compatible with older devices (right?) and this video can be played on such devices,
    that's why I decided it would be this format )
    Is it possible to somehow set the default option for audio as "second" - > "CENC 3",

    2) If "yes", for question 1 , Can we run it automatically (without confirmation = < enter > to accept ?

    3) I noticed that during processing with audio CENC 4 - 160 ec-3 I have this "WARN"

    Image
    [Attachment 77152 - Click to enlarge]


    what codec "is missing" ? should I do something or can I ignore this error (video plays correctly with audio)
    there is no such error for CENC 3 - 128 - mp4a options
    Quote Quote  
  15. Originally Posted by misiek View Post
    hello,
    I previously wrote that the topic had been clarified, but a new questions appeared, maybe this is a good opportunity to ask it here and now

    1) when I use :
    Code:
    N_m3u8DL-RE -M format=mp4 --key [KEY1:KEY2] "http://xxxxxxxxxxxxxxxxxxxxxxxxx/manifest.mpd" --save-dir C:\Video --save-name Movie.001
    Then I get
    Image
    [Attachment 77151 - Click to enlarge]


    then i must manually select Aud * CENC 3 with 128 and codec mp4a,
    ( ec-3 codec, may not be compatible with older devices (right?) and this video can be played on such devices,
    that's why I decided it would be this format )
    Is it possible to somehow set the default option for audio as "second" - > "CENC 3",

    2) If "yes", for question 1 , Can we run it automatically (without confirmation = < enter > to accept ?

    3) I noticed that during processing with audio CENC 4 - 160 ec-3 I have this "WARN"

    Image
    [Attachment 77152 - Click to enlarge]


    what codec "is missing" ? should I do something or can I ignore this error (video plays correctly with audio)
    there is no such error for CENC 3 - 128 - mp4a options
    You need to use the -sv (--select-video) and -sa (--select-audio) flags to automatically select streams. Run:

    Code:
    N_m3u8DL-RE --morehelp select-video
    and
    Code:
    N_m3u8DL-RE --morehelp select-audio
    for more info. Also, it's not "[KEY1:KEY2]" but rather "[KEY_ID:KEY]".

    Yes, you can usually ignore those warnings. Muxing usually solves things.
    Quote Quote  
  16. Can I ask for a hint? Unfortunately, this doesn't tell me much about
    Code:
    Examples:
    # select all
    -sa all
    # select best eng audio
    -sa lang=en:for=best
    # select best 2, and language is ja or en
    -sa lang="ja|en":for=best2
    how to use the command to select track with 128 Kbps or "best" with "mp4a"
    Image
    [Attachment 77188 - Click to enlarge]

    ( Unfortunately, I noticed that sometimes it is CENC 3 and sometimes CENC 4 )
    Quote Quote  
  17. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by misiek View Post
    Can I ask for a hint? Unfortunately, this doesn't tell me much about
    miss out cenc and use the identifier that follows - in your case a single digit. Put it in single quotes
    Code:
    N_m3u8DL-RE -sa '4'   <mpd-url>
    But without you providing an mpd it is all theoretical isn't it?
    Noob Starter Pack. Just download every Widevine mpd! Not kidding!.
    https://files.videohelp.com/u/301890/hellyes6.zip
    Quote Quote  
  18. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by white_snake View Post

    Code:
    -sv best -sa codec=mp4a.40.2
    Should accomplish what you need.
    It doesn't. It picks the best audio ~160kbps where the codec is ec-3

    The solution -sa all:for='best2' ensures a 128 Kbps download with a changing id

    Maybe N_m3u8DL-RE isn't the best tool - have you looked at using yt-dlp that may have better selectors - I haven't looked recently.
    Last edited by A_n_g_e_l_a; 22nd Feb 2024 at 10:15.
    Noob Starter Pack. Just download every Widevine mpd! Not kidding!.
    https://files.videohelp.com/u/301890/hellyes6.zip
    Quote Quote  
  19. Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by white_snake View Post

    Code:
    -sv best -sa codec=mp4a.40.2
    Should accomplish what you need.
    It doesn't. It picks the best audio ~160kbps where the codec is ec-3

    The solution -sa all:for='best2' ensures a 128 Kbps download with a changing id

    Maybe N_m3u8DL-RE isn't the best tool - have you looked at using yt-dlp that may have better selectors - I haven't looked recently.
    You're right, there's actually a small mistake on my part, it's "codecs", not "codec":

    Code:
    -sa codecs="mp4a.40.2"
    This picks it correctly. Guess that's because it shows like this in the mpd:

    Code:
          <Representation audioSamplingRate="44100" bandwidth="128000" codecs="mp4a.40.2" id="3" mimeType="audio/mp4">
            <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
            <BaseURL>42276-audio-1871863-128kbps.mp4</BaseURL>
            <SegmentBase indexRange="2040-7267" timescale="44100">
              <Initialization range="0-2039" />
            </SegmentBase>
          </Representation>
    But yeah, yt-dlp definitely has much more powerful selectors.
    Quote Quote  
  20. ok, thank you for the tips, I will test it and let you know,
    this idea came to me now...
    We can look into the mpd file, read the 'id' for bitrate 128 and mp4a codec and then generate commands for N_m3u8DL-RE
    but I will test your suggestions first
    I didn't know what syntax to use (e.g.: 'best2' means "second best"?
    Quote Quote  
  21. Originally Posted by misiek View Post
    ok, thank you for the tips, I will test it and let you know,
    this idea came to me now...
    We can look into the mpd file, read the 'id' for bitrate 128 and mp4a codec and then generate commands for N_m3u8DL-RE
    That's what N_m3u8DL-RE already does for you.

    Originally Posted by misiek View Post
    but I will test your suggestions first
    I didn't know what syntax to use (e.g.: 'best2' means "second best"?
    Nope, it means the best two audios. If you only want to pick the 128kbps one, you should use the command I posted before.
    Quote Quote  
  22. Code:
    -sa codecs="mp4a.40.2"
    is working properly
    Thank you
    Quote Quote  
  23. and ....
    can this be done to automatically select a stream with a bitrate of 4499 (it seems to always be in second place)
    -sv '2' ( ? )

    Image
    [Attachment 77797 - Click to enlarge]
    Quote Quote  
  24. Originally Posted by misiek View Post
    and ....
    can this be done to automatically select a stream with a bitrate of 4499 (it seems to always be in second place)
    -sv '2' ( ? )

    Image
    [Attachment 77797 - Click to enlarge]
    You could try:
    Code:
    -sv res="1920*":for=worst
    since you're trying to grab the worst 1920x1080 video, but I'm not sure that works since I can't test it.
    Quote Quote  
  25. I thought this way too, but I didn't know how to use "worst"
    it works - thank you
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!