azamaulanaaa / botkaca

Bot that leech (re-upload) internet contents including torrent to telegram
GNU General Public License v3.0
134 stars 612 forks source link

video stream does not have duration and bitrate information #13

Closed FristyFlakes closed 4 years ago

FristyFlakes commented 4 years ago

Files Above 2GB Aren't Splitted & Uploaded Accordingly. It's Stucked At Download Completed

Screenshot_20201009_095459

azamaulanaaa commented 4 years ago

how large your file? can you share you torrent?

FristyFlakes commented 4 years ago

how large your file? can you share you torrent?

Literally anything more than 2gb cannot be splitted.. ..

azamaulanaaa commented 4 years ago

I can't comment much yet. In my latest test, split function for video works just fine. My guess atm is your files are too large so that your service delete them as soon as aria2 close files io. This issue is very common if you are using free service like heroku.

FristyFlakes commented 4 years ago

This is a sample link for testing..

https://winter-snowflake-a929.ek13.workers.dev/0:/Skullz/Encoders%20(Movies)/Tigole/Indiana%20Jones/01.Raiders.of.the.Lost.Ark.1981.1080p.x265.10bit.Tigole.mkv (2.2GB)

azamaulanaaa commented 4 years ago

Actually it does not anything to do with size but it does with video tag. it does not have either duration or bit_rate on streams part information. It does actually on subtitle but subtitle is not every video has.

on formation part it does have duration (I still looking for, is it truly refer to video duration?) and bit_rate. the bit_rate is not relaiable information as it is bit_rate from main stream only (usually video) not overall bit_rate.

fyi, bitrate and duration are needed for video split since size based split from ffmpeg is unpredictable.

{
    "streams": [
        {
            "index": 0,
            "codec_name": "hevc",
            "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
            "profile": "Main 10",
            "codec_type": "video",
            "codec_time_base": "1001/24000",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 1920,
            "height": 816,
            "coded_width": 1920,
            "coded_height": 816,
            "closed_captions": 0,
            "has_b_frames": 2,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "40:17",
            "pix_fmt": "yuv420p10le",
            "level": 120,
            "color_range": "tv",
            "refs": 1,
            "r_frame_rate": "24000/1001",
            "avg_frame_rate": "24000/1001",
            "time_base": "1/1000",
            "start_pts": 0,
            "start_time": "0.000000",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "BPS": "2463510",
                "BPS-eng": "2463510",
                "DURATION": "01:55:18.871000000",
                "DURATION-eng": "01:55:18.871000000",
                "NUMBER_OF_FRAMES": "165887",
                "NUMBER_OF_FRAMES-eng": "165887",
                "NUMBER_OF_BYTES": "2130588786",
                "NUMBER_OF_BYTES-eng": "2130588786",
                "_STATISTICS_WRITING_APP": "mkvmerge v9.4.0 (Knurl) 64bit",
                "_STATISTICS_WRITING_APP-eng": "mkvmerge v9.4.0 (Knurl) 64bit",
                "_STATISTICS_WRITING_DATE_UTC": "2016-09-25 22:05:26",
                "_STATISTICS_WRITING_DATE_UTC-eng": "2016-09-25 22:05:26",
                "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",
                "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES"
            }
        },
        {
            "index": 1,
            "codec_name": "aac",
            "codec_long_name": "AAC (Advanced Audio Coding)",
            "profile": "LC",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 6,
            "channel_layout": "5.1",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/1000",
            "start_pts": 20,
            "start_time": "0.020000",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "eng",
                "BPS": "335683",
                "BPS-eng": "335683",
                "DURATION": "01:55:18.869000000",
                "DURATION-eng": "01:55:18.869000000",
                "NUMBER_OF_FRAMES": "324322",
                "NUMBER_OF_FRAMES-eng": "324322",
                "NUMBER_OF_BYTES": "290318722",
                "NUMBER_OF_BYTES-eng": "290318722",
                "_STATISTICS_WRITING_APP": "mkvmerge v9.4.0 (Knurl) 64bit",
                "_STATISTICS_WRITING_APP-eng": "mkvmerge v9.4.0 (Knurl) 64bit",
                "_STATISTICS_WRITING_DATE_UTC": "2016-09-25 22:05:26",
                "_STATISTICS_WRITING_DATE_UTC-eng": "2016-09-25 22:05:26",
                "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",
                "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES"
            }
        },
        {
            "index": 2,
            "codec_name": "dvd_subtitle",
            "codec_long_name": "DVD subtitles",
            "codec_type": "subtitle",
            "codec_time_base": "0/1",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 1920,
            "height": 1080,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/1000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 6918889,
            "duration": "6918.889000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "eng",
                "BPS": "3100",
                "BPS-eng": "3100",
                "DURATION": "01: 48: 00.217000000",
                "DURATION-eng": "01: 48: 00.217000000",
                "NUMBER_OF_FRAMES": "601",
                "NUMBER_OF_FRAMES-eng": "601",
                "NUMBER_OF_BYTES": "2511407",
                "NUMBER_OF_BYTES-eng": "2511407",
                "_STATISTICS_WRITING_APP": "mkvmerge v9.4.0 (Knurl) 64bit",
                "_STATISTICS_WRITING_APP-eng": "mkvmerge v9.4.0 (Knurl) 64bit",
                "_STATISTICS_WRITING_DATE_UTC": "2016-09-25 22: 05: 26",
                "_STATISTICS_WRITING_DATE_UTC-eng": "2016-09-25 22: 05: 26",
                "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",
                "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES"
            }
        },
        {
            "index": 3,
            "codec_name": "dvd_subtitle",
            "codec_long_name": "DVD subtitles",
            "codec_type": "subtitle",
            "codec_time_base": "0/1",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 1920,
            "height": 1080,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/1000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 6918889,
            "duration": "6918.889000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "tags": {
                "language": "ger",
                "BPS": "3151",
                "BPS-eng": "3151",
                "DURATION": "01: 54: 47.828000000",
                "DURATION-eng": "01: 54: 47.828000000",
                "NUMBER_OF_FRAMES": "592",
                "NUMBER_OF_FRAMES-eng": "592",
                "NUMBER_OF_BYTES": "2713228",
                "NUMBER_OF_BYTES-eng": "2713228",
                "_STATISTICS_WRITING_APP": "mkvmerge v9.4.0 (Knurl) 64bit",
                "_STATISTICS_WRITING_APP-eng": "mkvmerge v9.4.0 (Knurl) 64bit",
                "_STATISTICS_WRITING_DATE_UTC": "2016-09-25 22: 05: 26",
                "_STATISTICS_WRITING_DATE_UTC-eng": "2016-09-25 22: 05: 26",
                "_STATISTICS_TAGS": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES",
                "_STATISTICS_TAGS-eng": "BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES"
            }
        }
    ],
    "format": {
        "filename": "/app/downloads/01.Raiders.of.the.Lost.Ark.1981.1080p.x265.10bit.Tigole.mkv",
        "nb_streams": 4,
        "nb_programs": 0,
        "format_name": "matroska,webm",
        "format_long_name": "Matroska / WebM",
        "start_time": "0.000000",
        "duration": "6918.889000",
        "size": "2428130600",
        "bit_rate": "2807538",
        "probe_score": 100,
        "tags": {
            "encoder": "libebml v1.3.4 + libmatroska v1.4.5",
            "creation_time": "2016-09-25T22: 05: 26.000000Z"
        }
    }
}
azamaulanaaa commented 4 years ago

atm the answer is either upload as document or upload as zip

azamaulanaaa commented 4 years ago

I found this https://github.com/kaegi/alass/issues/3#issuecomment-521746996, it looks like the metadata of mkv files have different formats.

FristyFlakes commented 4 years ago

Splitting as documents works. Thanks for clarifying..