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

Use y4m as the container format for raw video #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frestr
Copy link

@frestr frestr commented Nov 2, 2019

On Linux (Ubuntu 18.04) with ffmpeg 4.1.3 I get the following error when compiling a video:

Resizing video...
ffmpeg -loglevel warning -stats -hide_banner -i video.mkv -c:v rawvideo  -vf scale=-2:144 output/
[...]
[mp4 @ 0x55eb35bdd380] Could not find tag for codec rawvideo in stream #0, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument                
Error initializing output stream 0:0 --                                                                   
[aac @ 0x55eb35b78440] 2 frames left in the queue on closing                                              
[...]                               

Apparently rawvideo is not supported for mp4. This PR uses y4m as a container format intead, which seems to work fine.

Note that I have not tested it on other platforms.

(Edit: This is in addition to #3)

@LIJI32
Copy link
Owner

LIJI32 commented Aug 5, 2020

It's a tech demo and not an actively maintained project. The codebase, in fact, did work out of the box when it was released, but was broken by an update to ffmpeg. Testing this fix and making sure it doesn't actually break users of older versions of ffmpeg was not prioritized over my other projects.

@sjr765
Copy link

sjr765 commented Jun 8, 2022

Hi @frestr, a bit of a long shot here, but I've incorporated your code which works well but when I get the gbc file it seems to be all entirely corrupted video (though I do hear the audio). The video just seems to be super unwatchable, almost like tv static. I've only tested this on the SameBoy gameboy emulator

If you have any tips, that would be great, if not, no worries! Thanks again for the fix.

@TheEssem
Copy link

Hi @frestr, a bit of a long shot here, but I've incorporated your code which works well but when I get the gbc file it seems to be all entirely corrupted video (though I do hear the audio). The video just seems to be super unwatchable, almost like tv static. I've only tested this on the SameBoy gameboy emulator

If you have any tips, that would be great, if not, no worries! Thanks again for the fix.

Seems like ffmpeg version 5.0 changed some things that caused it to break. As a workaround for now you can try downgrading to 4.4.

@sjr765
Copy link

sjr765 commented Jun 11, 2022

@TheEssem I was actually able to get this program to run by doing a combination of the following (I'm on mac):

  • using ffmpeg@4 on homebrew
  • installing rgbds v0.3.7
  • integrating the pull request from @frestr into the code

@jdriselvato
Copy link

jdriselvato commented Oct 13, 2022

@sjr765

installing rgbds v0.3.7

How did you install v0.3.7 on Mac? It seems brew doesn't find it, so I guess you had to install via source. but on source, it complains:

Package libpng was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpng.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpng' found
Package libpng was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpng.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpng' found

@Jenetrix
Copy link

Jenetrix commented Dec 20, 2022

Hi @frestr, a bit of a long shot here, but I've incorporated your code which works well but when I get the gbc file it seems to be all entirely corrupted video (though I do hear the audio). The video just seems to be super unwatchable, almost like tv static. I've only tested this on the SameBoy gameboy emulator
If you have any tips, that would be great, if not, no worries! Thanks again for the fix.

Seems like ffmpeg version 5.0 changed some things that caused it to break. As a workaround for now you can try downgrading to 4.4.

add -rle 0 as an ffmpeg argument on line 50 of the makefile to work around this issue.

@sjr765
Copy link

sjr765 commented Dec 21, 2022

Hey All,

Just a headsup, I believe if you specify the version on brew it should be able to find the proper version of the dependencies you need.

I did not use homebrew to install rgbds v0.3.7, its been a while but pretty confident I installed it manually!

@TehMiloss
Copy link

TehMiloss commented Mar 7, 2023

Hi @frestr, a bit of a long shot here, but I've incorporated your code which works well but when I get the gbc file it seems to be all entirely corrupted video (though I do hear the audio). The video just seems to be super unwatchable, almost like tv static. I've only tested this on the SameBoy gameboy emulator
If you have any tips, that would be great, if not, no worries! Thanks again for the fix.

Seems like ffmpeg version 5.0 changed some things that caused it to break. As a workaround for now you can try downgrading to 4.4.

add -rle 0 as an ffmpeg argument on line 50 of the makefile to work around this issue.

Soo... I'm using rgbds 0.3.7, ffmpeg 4.4. I've edited Makefile for changes in a commit and yet it still throws me ROM with video, like TV static.
Adding "-rle 0" to line 50 just throws this:

Codec AVOption rle (Use run-length compression) specified for input file #0 (output/niecik3/video.y4m) is not a decoding option.

I'm kinda lost and dumno how to fix it.

@Jenetrix
Copy link

Soo... I'm using rgbds 0.3.7, ffmpeg 4.4. I've edited Makefile for changes in a commit and yet it still throws me ROM with video, like TV static. Adding "-rle 0" to line 50 just throws this:

Codec AVOption rle (Use run-length compression) specified for input file #0 (output/niecik3/video.y4m) is not a decoding option.

I'm kinda lost and dumno how to fix it.

This is fix is specific to ffmpeg 5.0 and onward, you do not need to add this option for ffmpeg 4.4.

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

Successfully merging this pull request may close these issues.

8 participants