Closed BarnOwlDown closed 3 years ago
That's odd, it seems like it's not reading the bitrate when doing the ffprobe
. Could you add a print(probe)
on line 156 and paste the output here?
[matt@rpi3bp MattHDD]$ ./fbed.py 1 TV/A-Team-Iris.mkv
Collecting input video list...
{'streams': [{'index': 0, 'codec_name': 'mpeg2video', 'codec_long_name': 'MPEG-2 video', 'profile': 'Main', 'codec_type': 'video', 'codec_time_base': '1/25', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'width': 720, 'height': 576, 'coded_width': 0, 'coded_height': 0, 'closed_captions': 0, 'has_b_frames': 1, 'sample_aspect_ratio': '64:45', 'display_aspect_ratio': '16:9', 'pix_fmt': 'yuv420p', 'level': 8, 'color_range': 'tv', 'chroma_location': 'left', 'field_order': 'tt', 'refs': 1, 'r_frame_rate': '25/1', 'avg_frame_rate': '25/1', 'time_base': '1/1000', 'start_pts': 595, 'start_time': '0.595000', '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'}, 'side_data_list': [{'side_data_type': 'CPB properties'}]}, {'index': 1, 'codec_name': 'mp2', 'codec_long_name': 'MP2 (MPEG audio layer 2)', 'codec_type': 'audio', 'codec_time_base': '1/48000', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'sample_fmt': 's16p', 'sample_rate': '48000', 'channels': 2, 'channel_layout': 'stereo', 'bits_per_sample': 0, 'r_frame_rate': '0/0', 'avg_frame_rate': '0/0', 'time_base': '1/1000', 'start_pts': 0, 'start_time': '0.000000', 'bit_rate': '128000', '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': 'ita'}}, {'index': 2, 'codec_name': 'mp2', 'codec_long_name': 'MP2 (MPEG audio layer 2)', 'codec_type': 'audio', 'codec_time_base': '1/48000', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'sample_fmt': 's16p', 'sample_rate': '48000', 'channels': 2, 'channel_layout': 'stereo', 'bits_per_sample': 0, 'r_frame_rate': '0/0', 'avg_frame_rate': '0/0', 'time_base': '1/1000', 'start_pts': 101, 'start_time': '0.101000', 'bit_rate': '128000', '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'}}, {'index': 3, 'codec_name': 'subrip', 'codec_long_name': 'SubRip subtitle', 'codec_type': 'subtitle', 'codec_time_base': '0/1', 'codec_tag_string': '[0][0][0][0]', 'codec_tag': '0x0000', 'r_frame_rate': '0/0', 'avg_frame_rate': '0/0', 'time_base': '1/1000', 'start_pts': 0, 'start_time': '0.000000', 'duration_ts': 2760195, 'duration': '2760.195000', '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': 'ita'}}], 'format': {'filename': 'TV/A-Team-Iris.mkv', 'nb_streams': 4, 'nb_programs': 0, 'format_name': 'matroska,webm', 'format_long_name': 'Matroska / WebM', 'start_time': '0.000000', 'duration': '2760.195000', 'size': '962951918', 'bit_rate': '2790967', 'probe_score': 100, 'tags': {'title': 'A-Team', 'encoder': 'Tvheadend Matroska muxer', 'DATE_BROADCASTED': '2020-12-07 06:20:00', 'ORIGINAL_MEDIA_TYPE': 'TV', 'TVCHANNEL': 'Iris', 'SUMMARY': "Il nipote di un boss della malavita e' un appassionato di corse d'auto, che vuole vincere con ogni mezzo. Alla prossima corsa partecipa il nipote di Hannibal.\n\nVISIONE ADATTA A TUTTI.", 'SUMMARY-ita': "Il nipote di un boss della malavita e' un appassionato di corse d'auto, che vuole vincere con ogni mezzo. Alla prossima corsa partecipa il nipote di Hannibal.\n\nVISIONE ADATTA A TUTTI."}}}
Traceback (most recent call last):
File "./fbed.py", line 284, in <module>
manager = EncodingManager(all_files, parallel_encodes, frame, todo_list, active_list, completed_list)
File "./fbed.py", line 158, in __init__
bitrate = float(video_stream["bitrate"]) / 1000
KeyError: 'bitrate'
Interesting, the video stream doesn't have bit_rate
field for this format for some reason. I've added some code in 667c7e0 to check for this case and use the bit_rate from the format field instead. I'm not sure if that includes the audio bitrate as well, but I think for this use case it's close enough. Let me know if that resolves the issue
It works! Thank you very much!
This is what command tells me:
Here's media information: