Skip to content

Invalid path issue when trying to save decoded frames #163

Description

@aviadlazar

I have a some YUV videos I want to run tests on but the test_video script fails with the following error:

FileNotFoundError: [Errno 2] No such file or directory: 'out_bin\\clic_mini\2b2883e1147e879ed7c423e0beccf3edde46d98462c26c965f1286086aba7df5_1922x1080_30fps_yuv420p_299frames_56kbps.yuv_q0.mp4/out.yuv'

What I think is happening:

  • Line 466 in test_video.py: args['curr_rec_path'] = args['curr_bin_path'].replace('.bin', '.mp4')
  • Line 291 in test_video.py: output_yuv_path = args['curr_rec_path'].replace('.yuv', f'_{total_kbps}kbps.yuv')

This two lines cause the output path to look like: out_bin\\clic_mini\2b2883e1147e879ed7c423e0beccf3edde46d98462c26c965f1286086aba7df5_1922x1080_30fps_yuv420p_299frames_56kbps.yuv_q0.mp4

However, inside YUV420Writer:

class YUV420Writer():
    def __init__(self, dst_path, width, height):
        if not dst_path.endswith('.yuv'):
            dst_path = dst_path + '/out.yuv'
        self.dst_path = dst_path
        self.width = width
        self.height = height

        self.file = open(dst_path, 'wb')

Since output_yuv_path end with .mp4, dst_path will end up as: out_bin\clic_mini\2b2883e1147e879ed7c423e0beccf3edde46d98462c26c965f1286086aba7df5_1922x1080_30fps_yuv420p_299frames_56kbps.yuv_q0.mp4/out.yuv'.

This create a path that goes through a directory that does not exist - 2b2883e1147e879ed7c423e0beccf3edde46d98462c26c965f1286086aba7df5_1922x1080_30fps_yuv420p_299frames_56kbps.yuv_q0.mp4, and as a result the line self.file = open(dst_path, 'wb') fails.

I currently don't see any mistake in the way I invoked the script, so any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions