Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when running MP4Box #2

Open
DxTa opened this issue May 15, 2023 · 2 comments
Open

Issue when running MP4Box #2

DxTa opened this issue May 15, 2023 · 2 comments

Comments

@DxTa
Copy link

DxTa commented May 15, 2023

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
Copy link
Member

fador commented May 15, 2023

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
Copy link
Author

DxTa commented May 15, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants