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

Muxing vc1 into mkv results in video artifacts #1546

Closed
VXsz opened this issue Feb 22, 2022 · 7 comments
Closed

Muxing vc1 into mkv results in video artifacts #1546

VXsz opened this issue Feb 22, 2022 · 7 comments

Comments

@VXsz
Copy link

VXsz commented Feb 22, 2022

Describe the bug
After processing a vc1 video content (no encoding, just muxing around and removing some subs), the video when streamed has lots of glitches, sort of like datamoshing, and when played from the start, it gets all black (See screenshot below) and there is barely any actual content that you can see, until you exit the stream and start from a bit further, you still see the moshing artifacts but they go away quickly, it might be something with the I-frames but I haven't dug into it and I don't know much about it

1 - When starting a video from the start:
image

2 - When starting/forwarding somewhere further (Goes away quick after a second or 2):
image
Taken from an Android 12 device, the glitches probably effect other devices

Command or context you are trying to run
from SABnzbd's:

2022-02-22 08:46:56 - SABPostProcess - INFO - SAB post processing started.
2022-02-22 08:46:56 - resources.readsettings - INFO - /usr/bin/python3
2022-02-22 08:46:56 - resources.readsettings - INFO - Loading config file /home/vxsz/tools/sickbeard_mp4_automator/config/autoProcess.ini.
2022-02-22 08:46:56 - SABPostProcess - INFO - Performing conversion
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Initiating custom validation method.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Found a VC-1 video track, switching format to MKV.
2022-02-22 08:46:56 - SABPostProcess - INFO - Processing file /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Input Data
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - {
"format": "matroska,webm",
"format-fullname": "unknown",
"video": {
"index": 0,
"codec": "vc1",
"bitrate": 14945089,
"pix_fmt": "yuv420p",
"profile": "3",
"fps": 23.976023976023978,
"framedata": {
"pix_fmt": "yuv420p"
},
"dimensions": "1920x1080",
"level": 3.0,
"field_order": "progressive"
},
"audio": [
{
"index": 1,
"codec": "truehd",
"bitrate": 2145794,
"channels": 6,
"samplerate": 48000,
"language": "eng",
"disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
},
{
"index": 2,
"codec": "ac3",
"bitrate": 192000,
"channels": 2,
"samplerate": 48000,
"language": "eng",
"disposition": "-default-dub-original+comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
},
{
"index": 3,
"codec": "ac3",
"bitrate": 192000,
"channels": 2,
"samplerate": 48000,
"language": "eng",
"disposition": "-default-dub-original+comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
}
],
"subtitle": [
{
"index": 4,
"codec": "hdmv_pgs_subtitle",
"bitrate": 25206,
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "eng"
}
],
"attachment": []
}
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Reading video stream.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Video codec detected: vc1.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Profile: 3.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Video codec parameters None.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Creating copy video stream from source stream 0.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Reading audio streams.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Audio detected for stream 1 - truehd eng 6 channel.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Creating libfdk_aac audio stream from source stream 1.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Copying audio stream from source stream 1 format truehd [audio-copy-original].
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Audio detected for stream 2 - ac3 eng 2 channel.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Audio detected for stream 3 - ac3 eng 2 channel.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Found 0 streams that can be removed from the output file since they will dupcliates [stream-codec-combinations].
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Default audio stream set to eng libfdk_aac 6 channel stream [default-more-channels: True].
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Reading subtitle streams.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Image-based subtitle detected for stream 4 - hdmv_pgs_subtitle eng.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 0 results in your approved languages.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Output Data
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - {
"source": [
"/home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv"
],
"format": "mkv",
"video": {
"codec": "copy",
"map": 0,
"bitrate": 14243.320549999999,
"crf": -1,
"maxrate": null,
"bufsize": null,
"level": 0.0,
"profile": null,
"preset": null,
"pix_fmt": null,
"field_order": "progressive",
"width": null,
"filter": null,
"params": null,
"framedata": null,
"title": "FHD",
"debug": "video"
},
"audio": [
{
"map": 1,
"codec": "libfdk_aac",
"channels": 6,
"bitrate": 2145.794,
"profile": null,
"quality": 5,
"filter": null,
"samplerate": null,
"sampleformat": "",
"language": "eng",
"disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"bsf": null,
"title": "English (Dolby TrueHD)",
"debug": "audio"
},
{
"map": 1,
"codec": "copy",
"channels": 6,
"language": "eng",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"title": "English (Dolby TrueHD)",
"debug": "audio-copy-original"
}
],
"subtitle": [],
"attachment": []
}
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Preopts
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - []
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Postopts
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - [
"-threads",
"0",
"-metadata:g",
"encoding_tool=SMA"
]
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Starting conversion.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - FFmpeg command:
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - ======================
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - /usr/bin/ffmpeg -i /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv.original -vcodec copy -map 0:0 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -c:a:0 libfdk_aac -map 0:1 -ac:a:0 6 -metadata:s:a:0 "title=English (Dolby TrueHD)" -metadata:s:a:0 "handler_name=English (Dolby TrueHD)" -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -vbr:a:0 5 -c:a:1 copy -map 0:1 -metadata:s:a:1 "title=English (Dolby TrueHD)" -metadata:s:a:1 "handler_name=English (Dolby TrueHD)" -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f matroska -threads 0 -metadata:g encoding_tool=SMA -y /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - ======================
0%
0%
1%
1%
2%
2%
3%
3%
4%
4%
5%
6%
6%
7%
7%
8%
8%
9%
9%
10%
10%
11%
11%
12%
12%
13%
13%
14%
14%
14%
15%
15%
16%
17%
17%
18%
18%
19%
19%
20%
20%
21%
21%
22%
23%
23%
24%
24%
25%
25%
26%
26%
27%
28%
28%
29%
29%
30%
30%
31%
32%
32%
33%
33%
34%
34%
35%
35%
36%
37%
37%
38%
38%
39%
40%
40%
41%
41%
42%
43%
43%
44%
44%
45%
45%
46%
46%
47%
48%
48%
49%
50%
50%
51%
52%
52%
53%
53%
54%
55%
55%
56%
56%
57%
57%
58%
59%
59%
60%
60%
61%
61%
62%
62%
63%
64%
64%
65%
65%
66%
67%
67%
68%
68%
69%
70%
70%
71%
71%
72%
73%
73%
74%
74%
75%
75%
76%
76%
77%
78%
78%
79%
79%
80%
81%
81%
82%
82%
83%
83%
84%
85%
85%
86%
86%
87%
87%
88%
89%
89%
90%
90%
91%
91%
92%
93%
93%
94%
94%
95%
96%
96%
97%
98%
98%
99%
99%
100%
2022-02-22 08:48:24 - resources.mediaprocessor - INFO - /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv created.
2022-02-22 08:48:24 - SABPostProcess - INFO - Successfully processed /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv.
2022-02-22 08:48:24 - resources.mediaprocessor - INFO - Relocating MOOV atom to start of file.
2022-02-22 08:48:24 - qtfaststart - ERROR - moov atom not found, is this a valid MOV/MP4 file?
2022-02-22 08:48:24 - resources.mediaprocessor - WARNING - QT FastStart did not run - perhaps moov atom was at the start already or file is in the wrong format.
2022-02-22 08:48:24 - resources.postprocess - INFO - Running script '/home/vxsz/tools/sickbeard_mp4_automator/resources/../post_process/mkclean.py'.
2022-02-22 08:48:42 - resources.postprocess - INFO - Running script '/home/vxsz/tools/sickbeard_mp4_automator/resources/../post_process/runner.sh'.
2022-02-22 08:49:09 - SABPostProcess - INFO - Passing /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2 directory to Sonarr.
2022-02-22 08:49:09 - autoprocess.sonarr - INFO - Sonarr notifier started.
2022-02-22 08:49:09 - autoprocess.sonarr - INFO - Requesting Sonarr to scan directory '/home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2'.
2022-02-22 08:49:09 - autoprocess.sonarr - INFO - Sonarr response: started.

autoProcess.ini settings
Please sensor API keys/private information but include all other settings

Log files
(Basically same as above)

2022-02-22 08:46:56 - SABPostProcess - INFO - SAB post processing started.
2022-02-22 08:46:56 - resources.readsettings - INFO - /usr/bin/python3
2022-02-22 08:46:56 - resources.readsettings - INFO - Loading config file /home/vxsz/tools/sickbeard_mp4_automator/config/autoProcess.ini.
2022-02-22 08:46:56 - SABPostProcess - INFO - Performing conversion
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Initiating custom validation method.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Found a VC-1 video track, switching format to MKV.
2022-02-22 08:46:56 - SABPostProcess - INFO - Processing file /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Input Data
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - {
    "format": "matroska,webm",
    "format-fullname": "unknown",
    "video": {
        "index": 0,
        "codec": "vc1",
        "bitrate": 14945089,
        "pix_fmt": "yuv420p",
        "profile": "3",
        "fps": 23.976023976023978,
        "framedata": {
            "pix_fmt": "yuv420p"
        },
        "dimensions": "1920x1080",
        "level": 3.0,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 1,
            "codec": "truehd",
            "bitrate": 2145794,
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 2,
            "codec": "ac3",
            "bitrate": 192000,
            "channels": 2,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "-default-dub-original+comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 3,
            "codec": "ac3",
            "bitrate": 192000,
            "channels": 2,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "-default-dub-original+comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        }
    ],
    "subtitle": [
        {
            "index": 4,
            "codec": "hdmv_pgs_subtitle",
            "bitrate": 25206,
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng"
        }
    ],
    "attachment": []
}
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Reading video stream.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Video codec detected: vc1.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Profile: 3.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Video codec parameters None.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Creating copy video stream from source stream 0.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Reading audio streams.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Audio detected for stream 1 - truehd eng 6 channel.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Creating libfdk_aac audio stream from source stream 1.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Copying audio stream from source stream 1 format truehd [audio-copy-original].
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Audio detected for stream 2 - ac3 eng 2 channel.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Audio detected for stream 3 - ac3 eng 2 channel.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Found 0 streams that can be removed from the output file since they will dupcliates [stream-codec-combinations].
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Default audio stream set to eng libfdk_aac 6 channel stream [default-more-channels: True].
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Reading subtitle streams.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Image-based subtitle detected for stream 4 - hdmv_pgs_subtitle eng.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 0 results in your approved languages.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Output Data
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - {
    "source": [
        "/home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv"
    ],
    "format": "mkv",
    "video": {
        "codec": "copy",
        "map": 0,
        "bitrate": 14243.320549999999,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": null,
        "preset": null,
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "title": "FHD",
        "debug": "video"
    },
    "audio": [
        {
            "map": 1,
            "codec": "libfdk_aac",
            "channels": 6,
            "bitrate": 2145.794,
            "profile": null,
            "quality": 5,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "title": "English (Dolby TrueHD)",
            "debug": "audio"
        },
        {
            "map": 1,
            "codec": "copy",
            "channels": 6,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "title": "English (Dolby TrueHD)",
            "debug": "audio-copy-original"
        }
    ],
    "subtitle": [],
    "attachment": []
}
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Preopts
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - []
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Postopts
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - Starting conversion.
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - FFmpeg command:
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - ======================
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - /usr/bin/ffmpeg -i /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv.original -vcodec copy -map 0:0 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -c:a:0 libfdk_aac -map 0:1 -ac:a:0 6 -metadata:s:a:0 "title=English (Dolby TrueHD)" -metadata:s:a:0 "handler_name=English (Dolby TrueHD)" -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -vbr:a:0 5 -c:a:1 copy -map 0:1 -metadata:s:a:1 "title=English (Dolby TrueHD)" -metadata:s:a:1 "handler_name=English (Dolby TrueHD)" -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f matroska -threads 0 -metadata:g encoding_tool=SMA -y /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv
2022-02-22 08:46:56 - resources.mediaprocessor - INFO - ======================
2022-02-22 08:48:24 - resources.mediaprocessor - INFO - /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv created.
2022-02-22 08:48:24 - SABPostProcess - INFO - Successfully processed /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2/62a15b9427244726a65583e104b0d48a.mkv.
2022-02-22 08:48:24 - resources.mediaprocessor - INFO - Relocating MOOV atom to start of file.
2022-02-22 08:48:24 - qtfaststart - ERROR - moov atom not found, is this a valid MOV/MP4 file?
2022-02-22 08:48:24 - resources.mediaprocessor - WARNING - QT FastStart did not run - perhaps moov atom was at the start already or file is in the wrong format.
2022-02-22 08:48:24 - resources.postprocess - INFO - Running script '/home/vxsz/tools/sickbeard_mp4_automator/resources/../post_process/mkclean.py'.
2022-02-22 08:48:42 - resources.postprocess - INFO - Running script '/home/vxsz/tools/sickbeard_mp4_automator/resources/../post_process/runner.sh'.
2022-02-22 08:49:09 - SABPostProcess - INFO - Passing /home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2 directory to Sonarr.
2022-02-22 08:49:09 - autoprocess.sonarr - INFO - Sonarr notifier started.
2022-02-22 08:49:09 - autoprocess.sonarr - INFO - Requesting Sonarr to scan directory '/home/vxsz/Downloads/complete/Rick.and.Morty.S01E10.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-NoGroup-Obfuscated.2'.
2022-02-22 08:49:09 - autoprocess.sonarr - INFO - Sonarr response: started.

System Information

  • OS: Debian Buster (10)
  • Python version 3.9
  • FFMPEG version 5.0 (non-free built from source just yesterday)
  • Docker config (if relevant): None, native

Expected behavior
For videos to play normally

Additional context
I have looked around and it might be something with ffmpeg, I have downloaded the same content and muxed the data using mkvtoolnix and there was no issues with the playback, something may need to be changed or a command in ffmpeg

I have edited the SABnzbdpostporcess.py to launch Re-locate moov & make it run the custom post-processing scripts

Issues posted without any logs or autoProcess settings will be closed

@mdhiggins
Copy link
Owner

Yeah this definitely seems like more of an FFMPEG issue. I would probably try just running some basic FFMPEG remux commands and see if the issue is still present but probably not something I can fix

@mdhiggins
Copy link
Owner

If you can produce an FFMPEG that works correctly please post and I'll try and adjust the script accordingly but for now I'm gonna blame this on FFMPEG and close.

@VXsz
Copy link
Author

VXsz commented Feb 22, 2022

I have been digging a lot, looks like an issue with keyframes, I have no idea why they happen when ffmpeg writes to matroska files (they are all N/A) but when it's on an mp4 container it works perfectly fine with all keyframes seemingly fine

@VXsz
Copy link
Author

VXsz commented Feb 22, 2022

Yup, ffmpeg seems to not write timestamps data when it remuxes to matroska, I have no idea why, but mkvmerge works perfectly and does have correct timestamps for each keyframe and playback is correct

I know the tool mainly uses ffmpeg and thus mkvmerge usage won't be supported, I will try looking into it to see if timestamps can be fixed by an ffmpeg arg

@VXsz
Copy link
Author

VXsz commented Feb 22, 2022

I tried many things with ffmpeg but all seem to fail and not produce timestamps

So my option seems to be running an mkvmerge script (really just mkvmerge + filename.mp4 would fix it), is there a way to pass the v.codec (like custom.py) to the post processing scripts?

@mdhiggins
Copy link
Owner

That information isn't passed to the custom scripts directly, but you can easily import the existing libraries included in the script to read that information without reinventing the wheel and do whatever custom work you need

Untested sample (might need to tweak relative import paths)

import os
from resources.readsettings import ReadSettings
from resources.mediaprocessor import MediaProcessor

files = os.env.get("SMA_FILES")
settings = ReadSettings()
mp = MediaProcessor(settings)
info = mp.isValidSource(files[0])
print(info.video.codec)

@VXsz
Copy link
Author

VXsz commented Feb 24, 2022

Oh that's much better than my current script

I forgot to update, I have tried both mkvmerge & ffmpeg stuff, many times and in many ways, all of them have this issue

Mkvmerge usually produces crashing files, not sure why as the file seems good, and ffmpeg 4.4 (decided to build an ffmpeg 4.4 just to test it out) produces completely unplayable black-boxes-everywhere even if you resume from the middle

Best solution I found is to use ffmpeg 5.0 as it partially works, you need to resume from somewhere that's not from 0:00, you will get a few glitches but they go away in a second or 2, if you start the video from the very start you will get those annoying boxes

What I'm currently doing is just a basic custom.py to change the extension if it detects vc1 video codec

To clarify, this seems to be an issue with the bad & abysmal Android player, so it doesn't affect most other devices (they play normally), I'm changing it from mp4 since most Plex clients only support the codec if it's on an mkv container, mp4 playback is flawless but the server transcodes so it kinda defeats the purpose

Hope this helps someone out there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants