Skip to content

AVError: [Errno 22] Invalid argument: 'xxxxxxxxxx.mp4' (16: mp4) #334

@gemfield

Description

@gemfield

I am using the latest git repo code (cloned from this repo 2 weeks ago) on Ubuntu 16.04.
I am doing the demux and remux with the following code(no decode and encode at all):

output_file = av.open(mux_file, mode='w')
output_video_stream = output_file.add_stream(template=input_video_stream)
output_audio_stream = output_file.add_stream(template=input_audio_stream)
for packet_data in mux_tmp_buffer:
    #print('before', packet_data.stream.type, packet_data.dts, packet_data.pts)
    if packet_data.stream.type == b'video':
        if packet_data.dts:
            packet_data.dts = packet_data.dts - video_dts_start
            packet_data.pts = packet_data.pts - video_dts_start
        packet_data.stream = output_video_stream
        mux_vpacket_c += 1
    else:
        if packet_data.dts:
            packet_data.dts = packet_data.dts - audio_dts_start
            packet_data.pts = packet_data.pts - audio_dts_start
        packet_data.stream = output_audio_stream
    #print('after', packet_data.stream.type, packet_data.dts, packet_data.pts)
    output_file.mux(packet_data)
output_file.close()

the mux_tmp_buffer is a packet list demuxed from input container.

But I got the following exceptions after run multiple times of above code.

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "remux.py", line 482, in mux
    mux_packet_c += muxer.extendRedisResult()
  File "remux.py", line 399, in extendRedisResult
    mux_packet_c += self.muxClip(self.ins[scene].name, l[0], l[-1], self.ins[scene].img_list)
  File "remux.py", line 462, in muxClip
    output_file.mux(packet_data)
  File "av/container/output.pyx", line 199, in av.container.output.OutputContainer.mux
    self.mux_one(packets)
  File "av/container/output.pyx", line 213, in av.container.output.OutputContainer.mux_one
    self.proxy.err_check(lib.av_interleaved_write_frame(self.proxy.ptr, &packet.struct))
  File "av/container/core.pyx", line 183, in av.container.core.ContainerProxy.err_check
    return err_check(value, filename=self.name)
  File "av/utils.pyx", line 105, in av.utils.err_check
    raise AVError(-res, message, filename, log)
AVError: [Errno 22] Invalid argument: '/home/gemfield/web/static/videos/xxxxxxxxxx.mp4' (16: mp4)

And another quesions, how to deal with the packet.dts value when doing the mux (what I am doing now is packet_data.pts = packet_data.pts - video_dts_start, which seems ugly...)?

Thanks very much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions