Skip to content

Improve documentation, type annotation and fix 2 issues#255

Open
pmhahn wants to merge 9 commits intoozmartian:masterfrom
pmhahn:master
Open

Improve documentation, type annotation and fix 2 issues#255
pmhahn wants to merge 9 commits intoozmartian:masterfrom
pmhahn:master

Conversation

@pmhahn
Copy link
Copy Markdown

@pmhahn pmhahn commented Nov 15, 2019

I still have to fix one more issue:

2019-11-15 10:12 - vidcutter.libs.videoservice - INFO - /usr/bin/ffprobe -hide_banner -v error -show_packets -select_streams v -show_entries packet=pts_time,flags /srv/misc/Media/MythTV/13110_20140414201300.mpg
2019-11-15 10:15 - root - CRITICAL -   File "/usr/lib/python3/dist-packages/vidcutter/videocutter.py", line 1360, in saveMedia
    self.smartcutter(file, source_file, source_ext)
  File "/usr/lib/python3/dist-packages/vidcutter/videocutter.py", line 1410, in smartcutter
    allstreams=True)
  File "/usr/lib/python3/dist-packages/vidcutter/libs/videoservice.py", line 360, in smartcut
    bisections = self.getGOPbisections(source, start, end)
  File "/usr/lib/python3/dist-packages/vidcutter/libs/videoservice.py", line 657, in getGOPbisections
    keyframes = self.getKeyframes(source)
  File "/usr/lib/python3/dist-packages/vidcutter/libs/videoservice.py", line 634, in getKeyframes
    if line.split(',')[1] != 'N/A':

2019-11-15 10:15 - root - CRITICAL - <class 'IndexError'>: list index out of range

Philipp Matthias Hahn and others added 9 commits November 15, 2019 08:35
instead of string using broken shell escaping.
the decimal point is required.
it no chapter name is set, the save routine only writes the trailing tab,
but not quotes.
This fails to load as the regular expression always expects a tab
followed by quotes.

Make that optional.

Similar to <ozmartian#203>
Some streams do not have a 'codec_type', which throws the following
traceback:

> File "/usr/bin/vidcutter", line 11, in <module>
>   load_entry_point('vidcutter==6.0.0', 'gui_scripts', 'vidcutter')()
> File "/usr/lib/python3/dist-packages/vidcutter/__main__.py", line 380, in main
>   win = MainWindow()
> File "/usr/lib/python3/dist-packages/vidcutter/__main__.py", line 86, in __init__
>   self.file_opener(self.video)
> File "/usr/lib/python3/dist-packages/vidcutter/__main__.py", line 102, in file_opener
>   self.cutter.loadMedia(filename)
> File "/usr/lib/python3/dist-packages/vidcutter/videocutter.py", line 988, in loadMedia
>   self.videoService.setMedia(self.currentMedia)
> File "/usr/lib/python3/dist-packages/vidcutter/libs/videoservice.py", line 93, in setMedia
>   [stream for stream in self.media.streams if stream.codec_type == codec_type.lower()])
> File "/usr/lib/python3/dist-packages/vidcutter/libs/videoservice.py", line 93, in <listcomp>
>   [stream for stream in self.media.streams if stream.codec_type == codec_type.lower()])
> File "/usr/lib/python3/dist-packages/vidcutter/libs/munch.py", line 104, in __getattr__
>   raise AttributeError(k)

The output of
    ffprobe -hide_banner -v error -show_streams -show_format -of json $FILE.mpg
looks like this:

> {
>     "streams": [
>     ...
>         {
>             "index": 8,
>             "codec_tag_string": "[5][0][0][0]",
>             "codec_tag": "0x0005",
>             "id": "0x181a",
>             "r_frame_rate": "0/0",
>             "avg_frame_rate": "0/0",
>             "time_base": "1/90000",
>             "start_pts": 873142304,
>             "start_time": "9701.581156",
>             "duration_ts": 685844313,
>             "duration": "7620.492367",
>             "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
>             }
>         }
> ...
> ]}

This is a DVB-C recording, which consists of 1 video stream, multiple
audio- and subtext-streams, and that strange "data" stream.

Similar to <ozmartian#203>
Fixes: <ozmartian#211>
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

Successfully merging this pull request may close these issues.

1 participant