(file_path: str)
| 38 | os.remove(tmp_v_video_input_path) |
| 39 | |
| 40 | def get_audio_codec(file_path: str) -> Optional[str]: |
| 41 | cmd = f"ffprobe -loglevel error -select_streams a:0 -show_entries stream=codec_name -of default=nw=1:nk=1" |
| 42 | cmd = cmd.split() + [file_path] |
| 43 | cmd_result = subprocess.run(cmd, stdout=subprocess.PIPE, startupinfo=os_utils.get_subprocess_startup_info()) |
| 44 | audio_codec = cmd_result.stdout.decode('utf-8').strip().lower() |
| 45 | return audio_codec if len(audio_codec) > 0 else None |
| 46 | |
| 47 | def is_output_container_compatible_with_input_audio_codec(audio_codec: str, output_path: str) -> bool: |
| 48 | file_extension = os.path.splitext(output_path)[1] |
no test coverage detected