FrameGrab Can't detect format of MP4 after being resized with ffmpeg
See original GitHub issueI’m creating a program that opens an MP4 file and returns the next frame as a BufferedImage upon request (Pretty much viewing an MP4 frame by frame).
My code is working fine on my original test MP4 but if I resize that MP4 using ffmpeg
i get a
org.jcodec.api.UnsupportedFormatException: Could not detect the format of the input video.
at org.jcodec.api.FrameGrab.createFrameGrab(FrameGrab.java:55)
Resize Command:
ffmpeg -i input.mp4 -s 1280x720 output.mp4
Code:
final FileChannelWrapper wrapper = NIOUtils.readableChannel(_FILE_);
final FrameGrab grab = FrameGrab.createFrameGrab(wrapper);
I’m pretty new to jcodec and media encoding/decoding in general so I’m not sure if this is a problem with my resize command, my code, or the library.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
How to extract 1 screenshot for a video with ffmpeg at a given ...
FFMpeg can do this by seeking to the given timestamp and extracting exactly one frame as an image, see for instance ...
Read more >ffmpeg Documentation
In particular, codec options are applied by ffmpeg after the stream ... If it cannot, ffmpeg will abort and all output files will...
Read more >How to Extract Images from a Video Using FFmpeg
In this tutorial, we will be using the FFmpeg command-line tool to extract images from the video below using several different commands. Your...
Read more >Resizing videos with ffmpeg/avconv to fit into static sized player
I'm trying to use avconv to use ffmpeg to resize (while retaining the aspect ratio) and making sure it fits into my player....
Read more >Thumbnails & Screenshots using FFmpeg - OTTVerse
Learn how to generate thumbnails and screenshots using FFmpeg's ... Let's see how! ... and store them to JPG files after resizing them?...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am not sure, doesn’t happen on my machine.
As an alternative, try importing all jcodec, jcodec-javase, jcodec-samples into your Eclipse or IntelliJ as maven projects. Then simply run the class FrameGrabDemo.
Running
mvn clean install
on my clone of the repo is giving me the below test failure.