MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / DisplayInfo

Method DisplayInfo

src/WriterBase.cpp:92–129  ·  view source on GitHub ↗

Display file information

Source from the content-addressed store, hash-verified

90
91// Display file information
92void WriterBase::DisplayInfo(std::ostream* out) {
93 *out << std::fixed << std::setprecision(2) << std::boolalpha;
94 *out << "----------------------------" << std::endl;
95 *out << "----- File Information -----" << std::endl;
96 *out << "----------------------------" << std::endl;
97 *out << "--> Has Video: " << info.has_video << std::endl;
98 *out << "--> Has Audio: " << info.has_audio << std::endl;
99 *out << "--> Has Single Image: " << info.has_single_image << std::endl;
100 *out << "--> Duration: " << info.duration << " Seconds" << std::endl;
101 *out << "--> File Size: " << double(info.file_size) / 1024 / 1024 << " MB" << std::endl;
102 *out << "----------------------------" << std::endl;
103 *out << "----- Video Attributes -----" << std::endl;
104 *out << "----------------------------" << std::endl;
105 *out << "--> Width: " << info.width << std::endl;
106 *out << "--> Height: " << info.height << std::endl;
107 *out << "--> Pixel Format: " << info.pixel_format << std::endl;
108 *out << "--> Frames Per Second: " << info.fps.ToDouble() << " (" << info.fps.num << "/" << info.fps.den << ")" << std::endl;
109 *out << "--> Video Bit Rate: " << info.video_bit_rate/1000 << " kb/s" << std::endl;
110 *out << "--> Pixel Ratio: " << info.pixel_ratio.ToDouble() << " (" << info.pixel_ratio.num << "/" << info.pixel_ratio.den << ")" << std::endl;
111 *out << "--> Display Aspect Ratio: " << info.display_ratio.ToDouble() << " (" << info.display_ratio.num << "/" << info.display_ratio.den << ")" << std::endl;
112 *out << "--> Video Codec: " << info.vcodec << std::endl;
113 *out << "--> Video Length: " << info.video_length << " Frames" << std::endl;
114 *out << "--> Video Stream Index: " << info.video_stream_index << std::endl;
115 *out << "--> Video Timebase: " << info.video_timebase.ToDouble() << " (" << info.video_timebase.num << "/" << info.video_timebase.den << ")" << std::endl;
116 *out << "--> Interlaced: " << info.interlaced_frame << std::endl;
117 *out << "--> Interlaced: Top Field First: " << info.top_field_first << std::endl;
118 *out << "----------------------------" << std::endl;
119 *out << "----- Audio Attributes -----" << std::endl;
120 *out << "----------------------------" << std::endl;
121 *out << "--> Audio Codec: " << info.acodec << std::endl;
122 *out << "--> Audio Bit Rate: " << info.audio_bit_rate/1000 << " kb/s" << std::endl;
123 *out << "--> Sample Rate: " << info.sample_rate << " Hz" << std::endl;
124 *out << "--> # of Channels: " << info.channels << std::endl;
125 *out << "--> Channel Layout: " << info.channel_layout << std::endl;
126 *out << "--> Audio Stream Index: " << info.audio_stream_index << std::endl;
127 *out << "--> Audio Timebase: " << info.audio_timebase.ToDouble() << " (" << info.audio_timebase.num << "/" << info.audio_timebase.den << ")" << std::endl;
128 *out << "----------------------------" << std::endl;
129}
130
131// Generate JSON string of this object
132std::string WriterBase::Json() const {

Callers

nothing calls this directly

Calls 1

ToDoubleMethod · 0.80

Tested by

no test coverage detected