ffmpeg "Invalid return value 0 for stream protocol" RPi 3

This forum is for topics dealing with problems with software specifically in the ARMv7h repo.

ffmpeg "Invalid return value 0 for stream protocol" RPi 3

Postby optomus » Fri Feb 16, 2018 3:50 am

Hi All,

I just updated ffmpeg and so the package I have is ffmpeg-1:3.4.2-1

I am trying to turn a .png file into a .mp4. The command I am using to do this is:

ffmpeg loop 1 -i /path/to/my/file.png -c:v libx264 -t 7 -pix_fmt yuv420p /path/to/my/video.mp4

This command finishes sometimes and I do get a video sometimes (other times it crashes and locks the RPi up), however, for the duration of the compilation I get "Invalid return value 0 for stream protocol" The FPS is stated as 2.9 and my CPU is running at 100%. After 50 frames I then get a q=28 rather than q=0 and I get time=xx:xx:xx:xx bitrate= 0.1kbits/

The total run time here is about 1:20 minutes. I feel like there is something very wrong here.

Can anyone shed some light onto what might be happening here?

Thanks
optomus
 
Posts: 6
Joined: Wed Nov 30, 2016 10:14 pm

Re: ffmpeg "Invalid return value 0 for stream protocol" RPi

Postby naums » Fri Feb 16, 2018 10:40 pm

Here is what worked for me (on Odroid C2 (AARCH64), did not test on RPi 3).

$this->bbcode_second_pass_code('', 'ffmpeg -i bla.png -c:v libx264 -r 25 -t 100 -pix_fmt yuv420p blupp.mp4')

Set the framerate to 25 and give it a nice 4 seconds of duration. I get the same error messages, but my CPU-usage is quite okay (again, not tested on RPi 3), if needed can do that later.

If you believe the error-message is a problem in ffmpeg, please look in their bugtracker or the bugtracker of the codec (libc264 is from videolan, if I'm remembering correctly). I get the error on x86 PCs as well sometimes.
naums
 
Posts: 27
Joined: Sun Dec 31, 2017 11:11 am

Re: ffmpeg "Invalid return value 0 for stream protocol" RPi

Postby optomus » Mon Feb 19, 2018 10:22 pm

Hi and thank you for the reply.
After recompiling FFMPEG I am no longer getting the error reported here.

Unfortunately that line of code produces a video with only a single frame present. Since I am only using a single image, I think that actually makes sense since there is only a single file for input.

The only way I am able to get the video to be a set amount of time is by using the -loop 1 flag.
optomus
 
Posts: 6
Joined: Wed Nov 30, 2016 10:14 pm

Re: ffmpeg "Invalid return value 0 for stream protocol" RPi

Postby optomus » Fri Feb 23, 2018 1:43 am

In closing of this thread, what I was experiencing was an issue with interlacing.
Since I was trying to deal with .png files which are of type RGBA, there becomes the chance of interlacing conflicts between videos. This has been giving me an issue for sometime without me even realizing it.

Since I was generating the original .png using the Python Image Library, I was able to solve this issue with relative ease. I first had to flatten the image to RGB using the .convert("RGB") function and then save the image as .jpg.

Once this was done, my original ffmpeg command worked as well as can be expected(~3-4fps) and when concatenating this new video with other .mp4 videos, I experienced smooth transitions without issue.
optomus
 
Posts: 6
Joined: Wed Nov 30, 2016 10:14 pm


Return to ARMv7h

Who is online

Users browsing this forum: No registered users and 6 guests