Skip to content
New issue

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

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

Already on GitHub? # to your account

ffpb not working for some extensions #8

Closed
ritiek opened this issue Sep 11, 2018 · 4 comments
Closed

ffpb not working for some extensions #8

ritiek opened this issue Sep 11, 2018 · 4 comments
Assignees

Comments

@ritiek
Copy link

ritiek commented Sep 11, 2018

Hi. ffpb results in this traceback when I try to convert from .m4a to .mp3.

$ ffpb -i test.m4a test.mp3
Exception in thread STDOUT/ERR thread for pid 8681:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ritiek/.local/lib/python3.7/site-packages/sh.py", line 1540, in wrap
    fn(*args, **kwargs)
  File "/home/ritiek/.local/lib/python3.7/site-packages/sh.py", line 2484, in output_thread
    done = f.read()
  File "/home/ritiek/.local/lib/python3.7/site-packages/sh.py", line 2943, in read
    self.write_chunk(chunk)
  File "/home/ritiek/.local/lib/python3.7/site-packages/sh.py", line 2918, in write_chunk
    self.should_quit = self.process_chunk(chunk)
  File "/home/ritiek/.local/lib/python3.7/site-packages/sh.py", line 2839, in process
    return handler(chunk)
  File "/home/ritiek/.local/lib/python3.7/site-packages/sh.py", line 1624, in fn
    return handler(chunk, *args)
  File "/home/ritiek/.local/lib/python3.7/site-packages/ffpb.py", line 89, in __call__
    self.progress(line)
  File "/home/ritiek/.local/lib/python3.7/site-packages/ffpb.py", line 129, in progress
    total=self.duration * self.fps,
TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'

and no progress bar is shown although it does invoke ffmpeg and the output file test.mp3 works as expected.

I also tried to convert from .mp4 to .mkv and the progress bar indeed gets displayed but for some reason it fails for .m4a to .mp3.

@ritiek
Copy link
Author

ritiek commented Sep 11, 2018

I noticed that ffmpeg displays this line for video conversion:

frame=  147 fps= 18 q=-1.0 Lsize=     366kB time=00:00:06.06 bitrate= 494.7kbits/s speed=0.725x

and this for audio conversion:

size=    1083kB time=00:01:09.25 bitrate= 128.1kbits/s speed=25.1x

It skips displaying some fields that have no meaning in audio. Maybe we could skip these too or something, if ffpb fails to capture the fps value?

@althonos
Copy link
Owner

Thanks for the report, I'll be patching that.

@althonos althonos added the bug label Sep 11, 2018
@althonos althonos self-assigned this Sep 11, 2018
@althonos
Copy link
Owner

Fixed in v0.1.2.

@ritiek
Copy link
Author

ritiek commented Sep 12, 2018

Thanks! v0.1.2 works great.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants