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

Could not find encoder for codec id 27: Encoder not found #70

Closed
lulin60 opened this issue Sep 18, 2020 · 10 comments
Closed

Could not find encoder for codec id 27: Encoder not found #70

lulin60 opened this issue Sep 18, 2020 · 10 comments

Comments

@lulin60
Copy link

lulin60 commented Sep 18, 2020

No description provided.

@YuvalNirkin
Copy link
Owner

Please provide more details.

@Greg-Tarr
Copy link

Greg-Tarr commented Sep 30, 2020

@YuvalNirkin Came across same error on ubuntu 16.04:

(base) root@beast:~/Documents/fsgan/data/dev/projects/fsgan/inference# python swap.py ../docs/examples/shinzo_abe.mp4 -t ../docs/examples/conan_obrien.mp4 -o . --finetune --finetune_save --seg_remove_mouth
=> using GPU devices: 0
=> Loading face pose model: "hopenet_robust_alpha1.pth"...
=> Loading face landmarks model: "hr18_wflw_landmarks.pth"...
=> Loading face segmentation model: "celeba_unet_256_1_2_segmentation_v2.pth"...
=> Loading face reenactment model: "nfv_msrunet_256_1_2_reenactment_v2.1.pth"...
=> Loading face completion model: "ijbc_msrunet_256_1_2_inpainting_v2.pth"...
=> Loading face blending model: "ijbc_msrunet_256_1_2_blending_v2.pth"...
=> Cropping video sequences from video: "shinzo_abe.mp4"...
Could not find encoder for codec id 27: Encoder not found
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 600/600 [00:00<00:00, 812.04it/s]
=> Computing face poses for video: "shinzo_abe_seq00.mp4"...
Traceback (most recent call last):
File "swap.py", line 504, in
main(**vars(parser.parse_args()))
File "swap.py", line 498, in main
face_swapping(source[0], target[0], output, select_source, select_target)
File "swap.py", line 239, in call
source_cache_dir, source_seq_file_path, _ = self.cache(source_path)
File "/home/sarah/Documents/fsgan/data/dev/projects/fsgan/preprocess/preprocess_video.py", line 468, in cache
self.process_pose(input_path, output_dir, seq_file_path)
File "/home/sarah/Documents/fsgan/data/dev/projects/fsgan/preprocess/preprocess_video.py", line 246, in process_pose
in_vid = VideoInferenceDataset(curr_vid_path, transform=img_transforms)
File "/home/sarah/Documents/fsgan/data/dev/projects/fsgan/datasets/video_inference_dataset.py", line 29, in init
self.width, self.height, self.total_frames, self.fps = get_video_info(vid_path)
File "/home/sarah/Documents/fsgan/data/dev/projects/fsgan/utils/video_utils.py", line 223, in get_video_info
return get_media_info(vid_path)
File "/home/sarah/Documents/fsgan/data/dev/projects/fsgan/utils/video_utils.py", line 206, in get_media_info
probe = ffmpeg.probe(media_path)
File "/home/sarah/anaconda3/lib/python3.7/site-packages/ffmpeg/_probe.py", line 23, in probe
raise Error('ffprobe', out, err)
ffmpeg._run.Error: ffprobe error (see stderr output for detail)

@YuvalNirkin
Copy link
Owner

You're missing the avc1 encoder. You can try using a different encoder by adding the following argument:

--encoder_codec mp4v

Though this will reduce the quality of the video.

@Greg-Tarr
Copy link

I can confirm this solves the issue. Thank you and very good work!

@DrCrayRay
Copy link

You're missing the avc1 encoder. You can try using a different encoder by adding the following argument:

--encoder_codec mp4v

Though this will reduce the quality of the video.

Sorry where do I type that?

@Greg-Tarr
Copy link

@DrCrayRay add it onto the end of the command.

@MatellioAzharuddin
Copy link

@Greg-Tarr " add it onto the end of the command.", can you give one reference/example.

@Better369
Copy link

Hello, how to add, sorry, I didn't understand,Why do I show up after adding "unrecognized arguments: mp4v"

@manojjthomas
Copy link

You're missing the avc1 encoder. You can try using a different encoder by adding the following argument:

--encoder_codec mp4v

Though this will reduce the quality of the video.

Getting the same encoder error, even with alternate option:
python fsgan/inference/swap.py docs/examples/shinzo_abe.mp4 -t docs/examples/conan_obrien.mp4 -o . --seg_remove_mouth --encoder_codec mp4v

=> Cropping video sequences from video: "shinzo_abe.mp4"...
=> Computing face poses for video: "shinzo_abe_seq00.mp4"...
Traceback (most recent call last):
File "/data/dev/projects/fsgan/fsgan/inference/swap.py", line 504, in
main(**vars(parser.parse_args()))
File "/data/dev/projects/fsgan/fsgan/inference/swap.py", line 498, in main
face_swapping(source[0], target[0], output, select_source, select_target)
File "/data/dev/projects/fsgan/fsgan/inference/swap.py", line 239, in call
source_cache_dir, source_seq_file_path, _ = self.cache(source_path)
File "/data/dev/projects/fsgan/fsgan/preprocess/preprocess_video.py", line 469, in cache
self.process_pose(input_path, output_dir, seq_file_path)
File "/data/dev/projects/fsgan/fsgan/preprocess/preprocess_video.py", line 247, in process_pose
in_vid = VideoInferenceDataset(curr_vid_path, transform=img_transforms)
File "/data/dev/projects/fsgan/fsgan/datasets/video_inference_dataset.py", line 29, in init
self.width, self.height, self.total_frames, self.fps = get_video_info(vid_path)
File "/data/dev/projects/fsgan/fsgan/utils/video_utils.py", line 223, in get_video_info
return get_media_info(vid_path)
File "/data/dev/projects/fsgan/fsgan/utils/video_utils.py", line 206, in get_media_info
probe = ffmpeg.probe(media_path)
File "/home/ubuntu/anaconda3/envs/fsgan/lib/python3.9/site-packages/ffmpeg/_probe.py", line 23, in probe
raise Error('ffprobe', out, err)
ffmpeg._run.Error: ffprobe error (see stderr output for detail)

Any suggestions would help, before I try windows :)

@swerizwan
Copy link

The path is correct and the video is also not corrupted why I am getting that error? I have checked it on other videos as well, as error again and again.

Processing dataset
0%| | 0/1 [00:00<?, ?it/s]The video file '/assets/data/EMOCA_test_example_data/videos/82-25-854x480_affwild2.mp4' is corrupted. Skipping it.
100%|███████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 54.12it/s]
Traceback (most recent call last):
File "gdl_apps/EMOCA/demos/test_emoca_on_video.py", line 172, in
main()
File "gdl_apps/EMOCA/demos/test_emoca_on_video.py", line 167, in main
reconstruct_video(args)
File "gdl_apps/EMOCA/demos/test_emoca_on_video.py", line 62, in reconstruct_video
dm.prepare_data()
File "/home/abbas/anaconda3/envs/emoo36/lib/python3.8/site-packages/pytorch_lightning/core/datamodule.py", line 428, in wrapped_fn
fn(*args, **kwargs)
File "/home/abbas/emoca/gdl/datasets/FaceVideoDataModule.py", line 3191, in prepare_data
self._gather_data(exist_ok=True)
File "/home/abbas/emoca/gdl/datasets/FaceVideoDataModule.py", line 3213, in _gather_data
self._gather_video_metadata()
File "/home/abbas/emoca/gdl/datasets/FaceVideoDataModule.py", line 1569, in _gather_video_metadata
del self.annotation_list[vi]
IndexError: list assignment index out of range

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

8 participants