-
Notifications
You must be signed in to change notification settings - Fork 756
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
Add support for reading videos with ffmpeg/libav? #55
Comments
Hi Cosmin,
This should be already supported in the latest master branch. I haven't
advertised it since it may confuse beginners. But since you asked, I will
put up an instruction in the README file.
Here is what you need to do:
Before you run, you will need to specify the path to your ffmpeg executable
under [root]/python/externals.py (create the file and add a line like
FFMPEG_PATH = [path to ffmpeg]/ffmpeg. The file will be ignored by
gitignore).
Then, in places where you previously specify a .yuv file, just replace with
a file that can be decoded by ffmpeg. Ffmpeg should automatically recognize
the file format, and the decoded stream is piped to VMAF. Everything should
work then.
Let me know if you have any problem using it.
Zhi
…On Mon, Jan 2, 2017 at 3:32 PM Cosmin Stejerean ***@***.***> wrote:
At the moment videos have to be read in raw YUV format, which requires
creating huge intermediary files when attempting to compare the output of
different encodes. It would be extremely more useful to be able to read
encoded H264/VP9/H265,etc. video directly, without having to decode to disk
for every video file to compare.
This can be done withffmpeg or libav, but doing so at the moment would
involve changing both the Python code as well as the C code in several
places. So perhaps this needs to wait for a refactoring in issue #42
<#42>. It would be nice if as part
of that refactoring an interface was developed that made it possible to
swap in an alternate way of reading frames.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#55>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQVakDMHurUFqMxBf4b6-78lZ6u4ThEDks5rOJn9gaJpZM4LY2uM>
.
|
I think I mistook ffmpeg decoding with something else (scaling, cropping).
At this moment, to make the interface of VMAF simple, the best way is to
pipe ffmpeg with VMAF externally.
I will provide an example how this can be done.
…On Mon, Jan 2, 2017 at 8:26 PM Zhi Li ***@***.***> wrote:
Hi Cosmin,
This should be already supported in the latest master branch. I haven't
advertised it since it may confuse beginners. But since you asked, I will
put up an instruction in the README file.
Here is what you need to do:
Before you run, you will need to specify the path to your ffmpeg
executable under [root]/python/externals.py (create the file and add a line
like FFMPEG_PATH = [path to ffmpeg]/ffmpeg. The file will be ignored by
gitignore).
Then, in places where you previously specify a .yuv file, just replace
with a file that can be decoded by ffmpeg. Ffmpeg should automatically
recognize the file format, and the decoded stream is piped to VMAF.
Everything should work then.
Let me know if you have any problem using it.
Zhi
On Mon, Jan 2, 2017 at 3:32 PM Cosmin Stejerean ***@***.***>
wrote:
At the moment videos have to be read in raw YUV format, which requires
creating huge intermediary files when attempting to compare the output of
different encodes. It would be extremely more useful to be able to read
encoded H264/VP9/H265,etc. video directly, without having to decode to disk
for every video file to compare.
This can be done withffmpeg or libav, but doing so at the moment would
involve changing both the Python code as well as the C code in several
places. So perhaps this needs to wait for a refactoring in issue #42
<#42>. It would be nice if as part
of that refactoring an interface was developed that made it possible to
swap in an alternate way of reading frames.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#55>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQVakDMHurUFqMxBf4b6-78lZ6u4ThEDks5rOJn9gaJpZM4LY2uM>
.
|
Yes, I looked through the code and saw the references for using ffmpeg for crop/scale but nothing for decoding/demuxing. Any examples of how to accomplish this would be greatly appreciated. |
@cosmin: I've added a shell script to pipe ffmpeg with vmaf at: Try if this one works for you. Note that the width and height in the command line arguments are NOT the width and height of the input video, but the width and height to scale the input video to, such that the VMAF calculation is done at that scale. Refer to the first question at: |
@li-zhi thanks, this is a good starting point. I'll close this issue and open up a new issue with some improvements to the script. The current one must be run from within the VMAF checkout, and it uses hardcoded paths for the named pipes which prevents it from being used concurrently for multiple comparisons. Thanks again, this will make it much easier for me to use VMAF. |
Right. There is some logic to create the pipe names dynamically in python.
Here unfortunately you will have to redo it in shell script.
…On Wed, Jan 11, 2017 at 8:49 PM Cosmin Stejerean ***@***.***> wrote:
@li-zhi <https://github.com/li-zhi> thanks, this is a good starting
point. I'll close this issue and open up a new issue with some improvements
to the script. The current one must be run from within the VMAF checkout,
and it uses hardcoded paths for the named pipes which prevents it from
being used concurrently for multiple comparisons. Thanks again, this will
make it much easier for me to use VMAF.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#55 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQVakOpxlhh-ThUA4golrQpnpwidBByHks5rRbDlgaJpZM4LY2uM>
.
|
If you could, please create a PR to update the same file. Thanks!
…On Thu, Jan 12, 2017 at 8:20 AM Zhi Li ***@***.***> wrote:
Right. There is some logic to create the pipe names dynamically in python.
Here unfortunately you will have to redo it in shell script.
On Wed, Jan 11, 2017 at 8:49 PM Cosmin Stejerean ***@***.***>
wrote:
@li-zhi <https://github.com/li-zhi> thanks, this is a good starting
point. I'll close this issue and open up a new issue with some improvements
to the script. The current one must be run from within the VMAF checkout,
and it uses hardcoded paths for the named pipes which prevents it from
being used concurrently for multiple comparisons. Thanks again, this will
make it much easier for me to use VMAF.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#55 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQVakOpxlhh-ThUA4golrQpnpwidBByHks5rRbDlgaJpZM4LY2uM>
.
|
@cosmin I updated the ffmpeg2vmaf script to using python. It now supports dynamically generated working directories, and thus is thread-safe. |
Merge in MCE/vmaf-private-lts from feature/fix-v102-name-christosb to master * commit '38c0664dac5313a70e837aa0123faad41f1aaf8a': Fix naming for 4.5H v102 models.
At the moment videos have to be read in raw YUV format, which requires creating huge intermediary files when attempting to compare the output of different encodes. It would be extremely more useful to be able to read encoded H264/VP9/H265,etc. video directly, without having to decode to disk for every video file to compare.
This can be done with
ffmpeg
orlibav
, but doing so at the moment would involve changing both the Python code as well as the C code in several places. So perhaps this needs to wait for a refactoring in issue #42. It would be nice if as part of that refactoring an interface was developed that made it possible to swap in an alternate way of reading frames.The text was updated successfully, but these errors were encountered: