ultravideo / AISA-demo-API

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Issue when running MP4Box #2

Open DxTa opened 1 year ago

DxTa commented 1 year ago

Hi, I've managed to run: read_and_feed.py, queue and the API at the same time. However, I got the following issue near the end of the API /encode process: "[Importer] Unknown input file type for "/tmp/tmpjtkwmf5m".

I guess this was coming from the MP4Box command.

FYI, this was running inside docker containers and using image ultravideo/kvazaar

Logs:

ultravideo  | ffmpeg cmd: ['ffmpeg', '-ss', '8.180115', '-i', 'media/output/output_2023-05-15T14:05:15.827471.mp4', '-i', 'media/output/output_2023-05-15T14:05:25.829363.mp4', '-filter_complex', '[0:v][1:v]concat=n=2[outv]', '-map', '[outv]', '-t', '10.0', '-f', 'rawvideo', '-pix_fmt', 'yuv420p', '-']
ultravideo  | [MPEG-2 TS] TS Packet 1 is scrambled - not supported
ultravideo  | [MPEG-2 TS] TS Packet 2 is scrambled - not supported
ultravideo  | [MPEG-2 TS] TS Packet 3 does not start with sync marker
ultravideo  | [MPEG-2 TS] TS Packet 4 does not start with sync marker
ultravideo  | [MPEG-2 TS] TS Packet 5 does not start with sync marker
.....
ultravideo  | [MPEG-2 TS] TS Packet 164 does not start with sync marker
ultravideo  | [MPEG-2 TS] TS Packet 165 does not start with sync marker
ultravideo  | [MPEG-2 TS] TS Packet 166 does not start with sync marker
ultravideo  | [MPEG-2 TS] TS Packet 167 does not start with sync marker
ultravideo  | [MPEG-2 TS] TS Packet 168 does not start with sync marker
ultravideo  | [MPEG-2 TS] TS Packet 169 does not start with sync marker
ultravideo  | [Importer] Unknown input file type for "/tmp/tmpjtkwmf5m.
ultravideo  | 16:14:51 [Job a5974933-6a32-4ed8-b750-a6b35d2c0df2]: exception raised while executing (src.encoder.encode)
ultravideo  | Traceback (most recent call last):
ultravideo  |   File "/venv/lib/python3.9/site-packages/rq/worker.py", line 1111, in perform_job
ultravideo  |     rv = job.perform()
ultravideo  |   File "/venv/lib/python3.9/site-packages/rq/job.py", line 923, in perform
ultravideo  |     self._result = self._execute()
ultravideo  |   File "/venv/lib/python3.9/site-packages/rq/job.py", line 946, in _execute
ultravideo  |     result = self.func(*self.args, **self.kwargs)
ultravideo  |   File "/app/./src/encoder.py", line 114, in encode
ultravideo  |     check_call(
ultravideo  |   File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
ultravideo  |     raise CalledProcessError(retcode, cmd)
ultravideo  | subprocess.CalledProcessError: Command '['MP4Box', '-add', '/tmp/tmpjtkwmf5m', '-new', PosixPath('/event_medias/video_flow_4_event_1160.mp4')]' returned non-zero exit status 1.
fador commented 1 year ago

Hi,

the Docker hub image for ultravideo/kvazaar was already 4 years old and might have caused problems, it's updated now so if you can try again to see if it works.

DxTa commented 1 year ago

Thanks, I managed to get latest kvazaar version (2.2.0), and the gapac conversion step is still the issue, although I seems to get new error now

ultravideo  | [Importer] Unknown input file type for "/tmp/tmppa97q4js"
ultravideo  | Error importing /tmp/tmppa97q4js: Corrupted Data in file/stream

What I have tried to debug:

  1. I tried to run ffmpeg alone and output to mp4 file, which is playable
  2. I tried to simplify the kvazaar command a bit more (below) just to smoke test how kvazaar running
  3. After that, the file got input to MP4Box command and I got the above error
    encode_command = [
        "kvazaar",
        "--input-fps", "30",
        "-i", "-",
        "--input-res", resolution,
        "-o", str(out_file),
    ]

A bit more on the testing environment, I run it inside docker with python3.9, and the resolution environment is set to 480x360 for faster in running read_and_feed.py