| 20053 | return None |
| 20054 | |
| 20055 | def _extract_rotation(stream): |
| 20056 | if not isinstance(stream, dict): |
| 20057 | return None |
| 20058 | tags = stream.get("tags") or {} |
| 20059 | if isinstance(tags, dict): |
| 20060 | for k in ("rotate", "rotation"): |
| 20061 | if k in tags: |
| 20062 | try: |
| 20063 | return float(str(tags.get(k)).replace(",", ".")) |
| 20064 | except Exception: |
| 20065 | pass |
| 20066 | side_data_list = stream.get("side_data_list") or [] |
| 20067 | if isinstance(side_data_list, list): |
| 20068 | for item in side_data_list: |
| 20069 | if not isinstance(item, dict): |
| 20070 | continue |
| 20071 | for k in ("rotation", "rotate"): |
| 20072 | if k in item: |
| 20073 | try: |
| 20074 | return float(str(item.get(k)).replace(",", ".")) |
| 20075 | except Exception: |
| 20076 | pass |
| 20077 | if str(item.get("side_data_type", "")).lower() == "display matrix": |
| 20078 | for k in ("rotation", "rotate"): |
| 20079 | if k in item: |
| 20080 | try: |
| 20081 | return float(str(item.get(k)).replace(",", ".")) |
| 20082 | except Exception: |
| 20083 | pass |
| 20084 | return None |
| 20085 | |
| 20086 | try: |
| 20087 | ffprobe_bin = _resolve_ffprobe_bin(_resolve_ffmpeg_bin()) |