Hi there,
I'm exploring whether or not the Raspberry Pi would make a good image generator for testing video signals. One key aspect to this role would be the ability to change the output signal resolution (and ideally refresh rate as well) on the fly, without having to reboot. For example, I might want to output a 1920x1080 60Hz signal, then switch to a 1280x1024 75Hz signal.
Is this possible? I know that I can change the output signal characteristics by altering the config.txt file, but as I understand things, this is only applicable on boot.
I'm open to command line options or programmatic options. What I'm not interested in is the ability to create a representation of a resolution which doesn't change the actual signal (e.g. I don't want to create a 'canvas' using some graphics library which is 1024x768, if this doesn't also change the signal itself).
Thanks,
Matthew
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6332
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Changing video resolution on the fly?
Yes, it is possible.
tvservice -m CEA
tvservice -m DMT
will list the available HDMI modes.
tvservice -e "GROUP MODE" will choose a specific resolution.
Eg. for 720p60
You will lose any overlays on the screen when switching mode. You can recreate the console with:
You may also want to change the resolution to match the new screen mode (check fbset's command line options)
tvservice -m CEA
tvservice -m DMT
will list the available HDMI modes.
tvservice -e "GROUP MODE" will choose a specific resolution.
Eg. for 720p60
Code: Select all
tvservice -e "CEA 4"
Powering on HDMI with explicit settings (CEA mode 4)
tvservice -s
state 0x12001a [HDMI CEA (4) RGB lim 16:9], 1280x720 @ 60Hz, progressive
Code: Select all
fbset -depth 8 && fbset -depth 16
Re: Changing video resolution on the fly?
Thank you so much for the informative and quick reply!
Matthew
Matthew
Re: Changing video resolution on the fly?
I want my raspberry pi to automatically set the highest supported resolution. *Is there a better way than to parse commands?:
And then setting the resolution with:
Code: Select all
tvservice -m CEA
tvservice -m DMT
Code: Select all
tvservice -e "GROUP MODE"
Re: Changing video resolution on the fly?
Have you tried using
This will power on HDMI with preferred settings. If your screen if reporting its edid information correctly, then the native resolution of the screen should be the preferred mode.
Code: Select all
tvservice -p
Re: Changing video resolution on the fly?
Hello,
I tried "tvservice -e "CEA 5" (It's supposed to accept this resolution after read EDID of TV), but screen goes to black, at TV menu i can it see that it recognize 1080 timming, but i can't see any picture.
After reboot PI image appears.
Sombody has same case? or how to fix?
Thank's!
I tried "tvservice -e "CEA 5" (It's supposed to accept this resolution after read EDID of TV), but screen goes to black, at TV menu i can it see that it recognize 1080 timming, but i can't see any picture.
After reboot PI image appears.
Sombody has same case? or how to fix?
Thank's!
Re: Changing video resolution on the fly?
Did you try the
after setting the resolution?
Code: Select all
fbset -depth 8 && fbset -depth 16
Re: Changing video resolution on the fly?
I tried this but the monitor still stays black...rpdom wrote:Did you try theafter setting the resolution?Code: Select all
fbset -depth 8 && fbset -depth 16
Edit:
Maybe important: I'm connected over SSH to the Raspberry Pi
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6332
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Changing video resolution on the fly?
You may need to provoke a change, or it may be blanked.Torben wrote: I tried this but the monitor still stays black...
Edit:
Maybe important: I'm connected over SSH to the Raspberry Pi
Normally pressing a key on keyboard wake it up.
From ssh you may have to launch something that writes to fb.
Re: Changing video resolution on the fly?
I'm already running a programm that writes to the framebuffer. Even if I trigger a new video output after changing the hdmi settings, the monitor stays blank. Since the programm does not throw an exception I assume that my mapping of the framebuffer still is working.dom wrote:
You may need to provoke a change, or it may be blanked.
Normally pressing a key on keyboard wake it up.
From ssh you may have to launch something that writes to fb.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6332
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Changing video resolution on the fly?
Can you connect a keyboard and press a key to ensure the display is not blanked (due to inactivity)?Torben wrote: I'm already running a programm that writes to the framebuffer. Even if I trigger a new video output after changing the hdmi settings, the monitor stays blank. Since the programm does not throw an exception I assume that my mapping of the framebuffer still is working.
Re: Changing video resolution on the fly?
Even with the keyboard there is no change. I've also tried different DMT and CEA modes to ensure that the monitor is not a problem, but the results were always the same.dom wrote: Can you connect a keyboard and press a key to ensure the display is not blanked (due to inactivity)?
I'm currently running the latest Raspbian firmware (2015-05-15).
Re: Changing video resolution on the fly?
What happens with my HDMI mode is set to 720p and I play a 1080p video?
Do I get real 1080p?
If not, who is converting the resolution?
Do I get real 1080p?
If not, who is converting the resolution?
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 6332
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Changing video resolution on the fly?
Well that's a software choice so it may depend on the software you are running.fredfs wrote:What happens with my HDMI mode is set to 720p and I play a 1080p video?
Do I get real 1080p?
If not, who is converting the resolution?
Kodi for example will change the refresh rate, but won't change the resolution.
So 1080p video is decoded and the Hardware Video Scaler on GPU will resize it to 720p before outputting to HDMI.
Re: Changing video resolution on the fly?
Nice.. I ask this because I have set my hdmi to 720p (group 1 / mode 4).
Then I start playing a mix on 1080p (and other resolution) videos with omxplayer, they all play fine (inside the window).
But loading an overlay logo with raspidmx's pngview (https://github.com/AndrewFromMelbourne/ ... er/pngview)
The image, a full 1920x1080 pixels image, translucid, with a logo on the corner,
goes beyond borders (remember I am set HDMI to 720p)....
So I was wondering the this picture was still 1080p signal to the TV, wich does not makes sense since the HVS should limit is to 720p?
Well it has been a lot of experiments,
beyond this tipic, I have been creating a video presentation tool, with overlay logo, and some info text (using hello_font), but I am always facing a limit of layers (I cannot load 2 overlay pngs and fonts, with video, at the same time).
Guess I must generate all my overlay images and fonts by the same software, inside the same layer?
Thanks a lot!
Then I start playing a mix on 1080p (and other resolution) videos with omxplayer, they all play fine (inside the window).
But loading an overlay logo with raspidmx's pngview (https://github.com/AndrewFromMelbourne/ ... er/pngview)
The image, a full 1920x1080 pixels image, translucid, with a logo on the corner,
goes beyond borders (remember I am set HDMI to 720p)....
So I was wondering the this picture was still 1080p signal to the TV, wich does not makes sense since the HVS should limit is to 720p?
Well it has been a lot of experiments,
beyond this tipic, I have been creating a video presentation tool, with overlay logo, and some info text (using hello_font), but I am always facing a limit of layers (I cannot load 2 overlay pngs and fonts, with video, at the same time).
Guess I must generate all my overlay images and fonts by the same software, inside the same layer?
Thanks a lot!
Re: Changing video resolution on the fly?
The HVS doesn't limit layers to the physical size of the screen. You can place your layers outside the visible area. Just experiment a bit with the --win option of omxplayer. If you want to downscale a layer, you have to set its size to the physical size of the screen.So I was wondering the this picture was still 1080p signal to the TV, wich does not makes sense since the HVS should limit is to 720p?
Not necessarily, although it might make sense: The HVS can turn out to be too slow if you add too many layers in either the same program or different programs. In that case the video signal might get lost (See https://github.com/raspberrypi/firmware/issues/407). So it's probably a good idea to add as few layers as possible. One way to do this is to use an OpenGL layer and render everything except the video in there. Then your program basically ends up consisting of only 2 layers. Or you might even render the video inside OpenGL as well resulting in only a single layer for everything. That's how I do it in my tool info-beamer (https://info-beamer.com/pi).Guess I must generate all my overlay images and fonts by the same software, inside the same layer?
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted
Re: Changing video resolution on the fly?
do you have to type the word DMT or CEA and then the number for this to work?i tried tvservice -e CEA or DMT and then a number of a mode and nothing happensdom wrote:Yes, it is possible.
tvservice -m CEA
tvservice -m DMT
will list the available HDMI modes.
tvservice -e "GROUP MODE" will choose a specific resolution.
Eg. for 720p60You will lose any overlays on the screen when switching mode. You can recreate the console with:Code: Select all
tvservice -e "CEA 4" Powering on HDMI with explicit settings (CEA mode 4) tvservice -s state 0x12001a [HDMI CEA (4) RGB lim 16:9], 1280x720 @ 60Hz, progressive
You may also want to change the resolution to match the new screen mode (check fbset's command line options)Code: Select all
fbset -depth 8 && fbset -depth 16
Re: Changing video resolution on the fly?
How to change the video resolution on fly when using AV connection.