Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AP4_Track *test_videoTrack = nullptr;
- AP4_ByteStream *input = nullptr;
- AP4_Result result = AP4_FileByteStream::Create(filename, AP4_FileByteStream::STREAM_MODE_READ, input);
- AP4_File m_file (*input, true);
- //
- // Read movie tracks, and metadata, find the video track
- size_t index = 0;
- uint32_t m_width = 0, m_height = 0;
- auto item = m_file.GetMovie()->GetTracks().FirstItem();
- auto track = item->GetData();
- if (track->GetType() == AP4_Track::TYPE_VIDEO)
- {
- m_width = (uint32_t)((double)test_videoTrack->GetWidth() / double(1 << 16));
- m_height = (uint32_t)((double)test_videoTrack->GetHeight() / double(1 << 16));
- std::string codec("unknown");
- auto sd = track->GetSampleDescription(0);
- AP4_String c;
- if (AP4_SUCCEEDED(sd->GetCodecString(c)))
- {
- codec = c.GetChars();
- }
- // Find and instantiate the decoder
- AP4_Sample sample;
- AP4_DataBuffer sampleData;
- test_videoTrack->ReadSample(0, sample, sampleData);
- }
Add Comment
Please, Sign In to add comment