ocean-data-factory-sweden / kso

Notebooks to upload/download marine footage, connect to a citizen science project, train machine learning models and publish marine biological observations.
GNU General Public License v3.0
4 stars 12 forks source link

Issue in tutorial 3 with producing sample clips (might be something we have encountered before) #328

Closed Bergylta closed 7 months ago

Bergylta commented 7 months ago

🐛 Bug

Seems like we are not finding the directory, i feel like we have been here before too

To Reproduce (REQUIRED)

Input: Movie: gp_fen_10_09_1.MP4

pp.generate_zoo_clips(
    movies_selected=pp.movies_selected,
    movies_paths=pp.movies_paths,
    is_example=True,
    use_gpu=gpu_available.result,
)

Output:

Length of clips (seconds):

10
Movie range to generate clips from (seconds):
0 – 34
INFO:root:Number of clips to generate: 3
Number of modifications:
1
Select modification: #0

Zoo_low_compression
INFO:root:Extracting clips
  0%|          | 0/3 [00:00<?, ?it/s]ffmpeg version git-2023-12-04-8c117b7 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
  configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-openssl --disable-doc --disable-ffplay --enable-libx264 --enable-gpl --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
  libavutil      58. 32.100 / 58. 32.100
  libavcodec     60. 35.100 / 60. 35.100
  libavformat    60. 18.100 / 60. 18.100
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 14.100 /  9. 14.100
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mimer/NOBACKUP/groups/snic2021-6-9/project_movies/movies_Koster/frihamnen_2023/gp_frihamnen/gp_fen_10_09_1.MP4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.27.100
  Duration: 00:00:34.86, start: 0.000000, bitrate: 9441 kb/s
  Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 9316 kb/s, 119 fps, 119 tbr, 15232 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 libx264
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[vost#0:0 @ 0x5564b7b07640] Unknown encoder 'h264_nvenc'
[vost#0:0 @ 0x5564b7b07640] Error selecting an encoder
Error opening output file /mimer/NOBACKUP/groups/snic2021-6-9/tmp_dir/gp_fen_10_09_1.MP4_zooniverseclips/gp_fen_10_09_1.MP4_clip_0_10.mp4.
Error opening output files: Encoder not found
  0%|          | 0/3 [00:00<?, ?it/s]
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
File /usr/src/app/kso-dev/kso_utils/project.py:704, in ProjectProcessor.generate_zoo_clips.<locals>.on_button_clicked(b)
    703 def on_button_clicked(b):
--> 704     self.generated_clips = t_utils.create_clips(
    705         available_movies_df=self.available_movies_df,
    706         movies_selected=movies_selected,
    707         movies_paths=movies_paths,
    708         clip_selection=clip_selection,
    709         project=self.project,
    710         modification_details={},
    711         gpu_available=use_gpu,
    712         pool_size=pool_size,
    713     )
    715     mod_clips = t_utils.create_modified_clips(
    716         project=self.project,
    717         clips_list=self.generated_clips.clip_path,
   (...)
    721         pool_size=pool_size,
    722     )
    724     # Temporary workaround to get both clip paths

File /usr/src/app/kso-dev/kso_utils/tutorials_utils.py:1403, in create_clips(available_movies_df, movies_selected, movies_paths, clip_selection, project, modification_details, gpu_available, pool_size)
   1398 # Read each movie and extract the clips
   1399 for index, row in tqdm(
   1400     potential_start_df.iterrows(), total=potential_start_df.shape[0]
   1401 ):
   1402     # Extract the videos and store them in the folder
-> 1403     extract_clips(
   1404         movies_paths,
   1405         clip_length,
   1406         row["upl_seconds"],
   1407         row["clip_path"],
   1408         modification_details,
   1409         gpu_available,
   1410     )
   1412 # Add information on the modification of the clips
   1413 potential_start_df["clip_modification_details"] = str(modification_details)

File /usr/src/app/kso-dev/kso_utils/tutorials_utils.py:406, in extract_clips(movie_path, clip_length, upl_second_i, output_clip_path, modification_details, gpu_available)
    381 if not modification_details and gpu_available:
    382     # Create clips without any modification
    383     subprocess.call(
    384         [
    385             "ffmpeg",
   (...)
    404         ]
    405     )
--> 406     os.chmod(str(output_clip_path), 0o777)
    408 elif modification_details and gpu_available:
    409     # Unnest the modification detail dict
    410     df = pd.json_normalize(modification_details, sep="_")

FileNotFoundError: [Errno 2] No such file or directory: '/mimer/NOBACKUP/groups/snic2021-6-9/tmp_dir/gp_fen_10_09_1.MP4_zooniverseclips/gp_fen_10_09_1.MP4_clip_0_10.mp4'

Expected behavior

A clear and concise description of what you expected to happen.

Environment

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Bergylta commented 7 months ago

Somewhat fixed, but if modifications chosen, then a new error shows up:

INFO:root:Extracting clips
  0%|          | 0/3 [00:00<?, ?it/s]ffmpeg version git-2023-12-04-8c117b7 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
  configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-openssl --disable-doc --disable-ffplay --enable-libx264 --enable-gpl --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
  libavutil      58. 32.100 / 58. 32.100
  libavcodec     60. 35.100 / 60. 35.100
  libavformat    60. 18.100 / 60. 18.100
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 14.100 /  9. 14.100
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mimer/NOBACKUP/groups/snic2021-6-9/project_movies/movies_Koster/frihamnen_2023/gp_frihamnen/gp_fen_10_09_1.MP4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.27.100
  Duration: 00:00:34.86, start: 0.000000, bitrate: 9441 kb/s
  Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 9316 kb/s, 119 fps, 119 tbr, 15232 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 libx264
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[out#0/mp4 @ 0x55ca95fd4080] Codec AVOption threads (set the number of threads) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Output #0, mp4, to '/mimer/NOBACKUP/groups/snic2021-6-9/tmp_dir/gp_fen_10_09_1.MP4_zooniverseclips/gp_fen_10_09_1.MP4_clip_0_10.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.18.100
  Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 9316 kb/s, 119 fps, 119 tbr, 15232 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[out#0/mp4 @ 0x55ca95fd4080] video:8245kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.068175%
size=    8251kB time=00:00:09.99 bitrate=6764.7kbits/s speed= 220x    
 33%|███▎      | 1/3 [00:00<00:00,  7.76it/s]ffmpeg version git-2023-12-04-8c117b7 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
  configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-openssl --disable-doc --disable-ffplay --enable-libx264 --enable-gpl --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
  libavutil      58. 32.100 / 58. 32.100
  libavcodec     60. 35.100 / 60. 35.100
  libavformat    60. 18.100 / 60. 18.100
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 14.100 /  9. 14.100
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mimer/NOBACKUP/groups/snic2021-6-9/project_movies/movies_Koster/frihamnen_2023/gp_frihamnen/gp_fen_10_09_1.MP4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.27.100
  Duration: 00:00:34.86, start: 0.000000, bitrate: 9441 kb/s
  Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 9316 kb/s, 119 fps, 119 tbr, 15232 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 libx264
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[out#0/mp4 @ 0x563257e02080] Codec AVOption threads (set the number of threads) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Output #0, mp4, to '/mimer/NOBACKUP/groups/snic2021-6-9/tmp_dir/gp_fen_10_09_1.MP4_zooniverseclips/gp_fen_10_09_1.MP4_clip_10_10.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.18.100
  Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 9316 kb/s, 119 fps, 119 tbr, 15232 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[out#0/mp4 @ 0x563257e02080] video:12456kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.051617%
size=   12463kB time=00:00:09.99 bitrate=10218.2kbits/s speed= 190x    
 67%|██████▋   | 2/3 [00:00<00:00,  7.55it/s]ffmpeg version git-2023-12-04-8c117b7 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
  configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-openssl --disable-doc --disable-ffplay --enable-libx264 --enable-gpl --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
  libavutil      58. 32.100 / 58. 32.100
  libavcodec     60. 35.100 / 60. 35.100
  libavformat    60. 18.100 / 60. 18.100
  libavdevice    60.  4.100 / 60.  4.100
  libavfilter     9. 14.100 /  9. 14.100
  libswscale      7.  6.100 /  7.  6.100
  libswresample   4. 13.100 /  4. 13.100
  libpostproc    57.  4.100 / 57.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mimer/NOBACKUP/groups/snic2021-6-9/project_movies/movies_Koster/frihamnen_2023/gp_frihamnen/gp_fen_10_09_1.MP4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.27.100
  Duration: 00:00:34.86, start: 0.000000, bitrate: 9441 kb/s
  Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 9316 kb/s, 119 fps, 119 tbr, 15232 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 libx264
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
[out#0/mp4 @ 0x564351789080] Codec AVOption threads (set the number of threads) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Output #0, mp4, to '/mimer/NOBACKUP/groups/snic2021-6-9/tmp_dir/gp_fen_10_09_1.MP4_zooniverseclips/gp_fen_10_09_1.MP4_clip_20_10.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.18.100
  Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 9316 kb/s, 119 fps, 119 tbr, 15232 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.37.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[out#0/mp4 @ 0x564351789080] video:16149kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.038653%
size=   16155kB time=00:00:09.99 bitrate=13245.6kbits/s speed= 162x    
100%|██████████| 3/3 [00:00<00:00,  7.32it/s]
--- Logging error ---
Traceback (most recent call last):
  File "/usr/src/app/kso-dev/kso_utils/tutorials_utils.py", line 270, in modify_clips
    eval(full_prompt).run(capture_stdout=True, capture_stderr=True)
  File "/usr/local/lib/python3.8/dist-packages/ffmpeg/_run.py", line 325, in run
    raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/__init__.py", line 1085, in emit
    msg = self.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 929, in format
    return fmt.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 668, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.8/logging/__init__.py", line 373, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/dist-packages/ipykernel_launcher.py", line 17, in <module>
    app.launch_new_instance()
  File "/usr/local/lib/python3.8/dist-packages/traitlets/config/application.py", line 1043, in launch_instance
    app.start()
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelapp.py", line 739, in start
    self.io_loop.start()
  File "/usr/local/lib/python3.8/dist-packages/tornado/platform/asyncio.py", line 205, in start
    self.asyncio_loop.run_forever()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
    handle._run()
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelbase.py", line 529, in dispatch_queue
    await self.process_one()
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelbase.py", line 518, in process_one
    await dispatch(*args)
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelbase.py", line 422, in dispatch_shell
    result = handler(self.shell_stream, idents, msg)
  File "/usr/local/lib/python3.8/dist-packages/comm/base_comm.py", line 290, in comm_msg
    comm.handle_msg(msg)
  File "/usr/local/lib/python3.8/dist-packages/comm/base_comm.py", line 185, in handle_msg
    self._msg_callback(msg)
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget.py", line 237, in m
    return(method(self, *args, **kwargs))
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget.py", line 765, in _handle_msg
    self._handle_custom_msg(data['content'], msg['buffers'])
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget.py", line 773, in _handle_custom_msg
    self._msg_callbacks(self, content, buffers)
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget.py", line 206, in __call__
    local_value = callback(*args, **kwargs)
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget_button.py", line 105, in _handle_button_msg
    self.click()
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget_button.py", line 94, in click
    self._click_handlers(self)
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget.py", line 206, in __call__
    local_value = callback(*args, **kwargs)
  File "/usr/src/app/kso-dev/kso_utils/project.py", line 715, in on_button_clicked
    mod_clips = t_utils.create_modified_clips(
  File "/usr/src/app/kso-dev/kso_utils/tutorials_utils.py", line 1473, in create_modified_clips
    modify_clips(
  File "/usr/src/app/kso-dev/kso_utils/tutorials_utils.py", line 273, in modify_clips
    logging.info("stdout: {}", e.stdout.decode("utf8"))
Message: 'stdout: {}'
Arguments: ('',)
--- Logging error ---
Traceback (most recent call last):
  File "/usr/src/app/kso-dev/kso_utils/tutorials_utils.py", line 270, in modify_clips
    eval(full_prompt).run(capture_stdout=True, capture_stderr=True)
  File "/usr/local/lib/python3.8/dist-packages/ffmpeg/_run.py", line 325, in run
    raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/__init__.py", line 1085, in emit
    msg = self.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 929, in format
    return fmt.format(record)
  File "/usr/lib/python3.8/logging/__init__.py", line 668, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.8/logging/__init__.py", line 373, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/dist-packages/ipykernel_launcher.py", line 17, in <module>
    app.launch_new_instance()
  File "/usr/local/lib/python3.8/dist-packages/traitlets/config/application.py", line 1043, in launch_instance
    app.start()
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelapp.py", line 739, in start
    self.io_loop.start()
  File "/usr/local/lib/python3.8/dist-packages/tornado/platform/asyncio.py", line 205, in start
    self.asyncio_loop.run_forever()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()
  File "/usr/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
    handle._run()
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelbase.py", line 529, in dispatch_queue
    await self.process_one()
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelbase.py", line 518, in process_one
    await dispatch(*args)
  File "/usr/local/lib/python3.8/dist-packages/ipykernel/kernelbase.py", line 422, in dispatch_shell
    result = handler(self.shell_stream, idents, msg)
  File "/usr/local/lib/python3.8/dist-packages/comm/base_comm.py", line 290, in comm_msg
    comm.handle_msg(msg)
  File "/usr/local/lib/python3.8/dist-packages/comm/base_comm.py", line 185, in handle_msg
    self._msg_callback(msg)
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget.py", line 237, in m
    return(method(self, *args, **kwargs))
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget.py", line 765, in _handle_msg
    self._handle_custom_msg(data['content'], msg['buffers'])
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget.py", line 773, in _handle_custom_msg
    self._msg_callbacks(self, content, buffers)
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget.py", line 206, in __call__
    local_value = callback(*args, **kwargs)
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget_button.py", line 105, in _handle_button_msg
    self.click()
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget_button.py", line 94, in click
    self._click_handlers(self)
  File "/cephyr/users/emilbu/Alvis/.local/lib/python3.8/site-packages/ipywidgets/widgets/widget.py", line 206, in __call__
    local_value = callback(*args, **kwargs)
  File "/usr/src/app/kso-dev/kso_utils/project.py", line 715, in on_button_clicked
    mod_clips = t_utils.create_modified_clips(
  File "/usr/src/app/kso-dev/kso_utils/tutorials_utils.py", line 1473, in create_modified_clips
    modify_clips(
  File "/usr/src/app/kso-dev/kso_utils/tutorials_utils.py", line 274, in modify_clips
    logging.info("stderr: {}", e.stderr.decode("utf8"))
Message: 'stderr: {}'
Arguments: ("ffmpeg version git-2023-12-04-8c117b7 Copyright (c) 2000-2023 the FFmpeg developers\n  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2)\n  configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-openssl --disable-doc --disable-ffplay --enable-libx264 --enable-gpl --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64\n  libavutil      58. 32.100 / 58. 32.100\n  libavcodec     60. 35.100 / 60. 35.100\n  libavformat    60. 18.100 / 60. 18.100\n  libavdevice    60.  4.100 / 60.  4.100\n  libavfilter     9. 14.100 /  9. 14.100\n  libswscale      7.  6.100 /  7.  6.100\n  libswresample   4. 13.100 /  4. 13.100\n  libpostproc    57.  4.100 / 57.  4.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mimer/NOBACKUP/groups/snic2021-6-9/tmp_dir/gp_fen_10_09_1.MP4_zooniverseclips/gp_fen_10_09_1.MP4_clip_0_10.mp4':\n  Metadata:\n    major_brand     : isom\n    minor_version   : 512\n    compatible_brands: isomiso2avc1mp41\n    encoder         : Lavf60.18.100\n  Duration: 00:00:10.00, start: 0.000000, bitrate: 6759 kb/s\n  Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 6754 kb/s, 119 fps, 119 tbr, 15232 tbn (default)\n    Metadata:\n      handler_name    : VideoHandler\n      vendor_id       : [0][0][0][0]\n      encoder         : Lavc59.37.100 libx264\n[vost#0:0 @ 0x5603cf86e480] Unknown encoder 'h264_nvenc'\n[vost#0:0 @ 0x5603cf86e480] Error selecting an encoder\nError opening output file /mimer/NOBACKUP/groups/snic2021-6-9/tmp_dir/modified_gp_fen_10_09_1.MP4_clips/modified_gp_fen_10_09_1.MP4_clip_0_10.mp4.\nError opening output files: Encoder not found\n",)
---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
File /usr/src/app/kso-dev/kso_utils/project.py:715, in ProjectProcessor.generate_zoo_clips.<locals>.on_button_clicked(b)
    703 def on_button_clicked(b):
    704     self.generated_clips = t_utils.create_clips(
    705         available_movies_df=self.available_movies_df,
    706         movies_selected=movies_selected,
   (...)
    712         pool_size=pool_size,
    713     )
--> 715     mod_clips = t_utils.create_modified_clips(
    716         project=self.project,
    717         clips_list=self.generated_clips.clip_path,
    718         movies_selected=movies_selected,
    719         modification_details=clip_modification.checks,
    720         gpu_available=use_gpu,
    721         pool_size=pool_size,
    722     )
    724     # Temporary workaround to get both clip paths
    725     self.generated_clips["modif_clip_path"] = mod_clips

File /usr/src/app/kso-dev/kso_utils/tutorials_utils.py:1473, in create_modified_clips(project, clips_list, movies_selected, modification_details, gpu_available, pool_size)
   1470         modified_clips = modified_clips + [output_clip_path]
   1472         # Modify the clips and store them in the folder
-> 1473         modify_clips(
   1474             clip_i,
   1475             modification_details,
   1476             output_clip_path,
   1477             gpu_available,
   1478         )
   1480     return modified_clips
   1481 else:

File /usr/src/app/kso-dev/kso_utils/tutorials_utils.py:275, in modify_clips(clip_i, modification_details, output_clip_path, gpu_available)
    273         logging.info("stdout: {}", e.stdout.decode("utf8"))
    274         logging.info("stderr: {}", e.stderr.decode("utf8"))
--> 275         raise e
    277 else:
    278     # Set up input prompt
    279     init_prompt = f"ffmpeg_python.input('{clip_i}')"

File /usr/src/app/kso-dev/kso_utils/tutorials_utils.py:270, in modify_clips(clip_i, modification_details, output_clip_path, gpu_available)
    268 # Run the modification
    269 try:
--> 270     eval(full_prompt).run(capture_stdout=True, capture_stderr=True)
    271     os.chmod(output_clip_path, 0o777)
    272 except ffmpeg_python.Error as e:

File /usr/local/lib/python3.8/dist-packages/ffmpeg/_run.py:325, in run(stream_spec, cmd, capture_stdout, capture_stderr, input, quiet, overwrite_output)
    323 retcode = process.poll()
    324 if retcode:
--> 325     raise Error('ffmpeg', out, err)
    326 return out, err

Error: ffmpeg error (see stderr output for detail)
jannesgg commented 7 months ago

@Bergylta This seems to be a logging issue, do the files get modified and saved?