Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. help: no audio in directshow DES

help: no audio in directshow DES

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    liur17
    wrote on last edited by
    #1

    I wrote a program to trim a segment mpeg file to avi file, the video in the avi file is ok, but I can't output the audio into it. when I try to find out the output pin of the audio group, it returns error code:"the group does not has output pin", should I exract audio from mpeg file to a new file then add it to Timeline? please give any suggestion. my code is following: //Video hr = pTL->CreateEmptyNode(&pVideoGroupObj, TIMELINE_MAJOR_TYPE_GROUP); hr = pVideoGroupObj->QueryInterface(IID_IAMTimelineGroup, (void **)&pVideoGroup); AM_MEDIA_TYPE mtVideo; ZeroMemory(&mtVideo, sizeof(AM_MEDIA_TYPE)); mtVideo.majortype = MEDIATYPE_Video; mtVideo.subtype = MEDIASUBTYPE_RGB555; mtVideo.pbFormat = (BYTE*)CoTaskMemAlloc(sizeof(VIDEOINFOHEADER)); VIDEOINFOHEADER *pVideoHeader = (VIDEOINFOHEADER*)mtVideo.pbFormat; ZeroMemory(pVideoHeader, sizeof(VIDEOINFOHEADER)); //the m_mtSrcVideo is AM_MEDIA_TYPE info. gotten from mpeg file. VIDEOINFOHEADER *pVideoHeader0 = (VIDEOINFOHEADER*)m_mtSrcVideo.pbFormat; pVideoHeader->bmiHeader.biBitCount = pVideoHeader0->bmiHeader.biBitCount; pVideoHeader->bmiHeader.biWidth = pVideoHeader0->bmiHeader.biWidth; pVideoHeader->bmiHeader.biHeight = pVideoHeader0->bmiHeader.biHeight; pVideoHeader->bmiHeader.biPlanes = pVideoHeader0->bmiHeader.biPlanes; pVideoHeader->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pVideoHeader->bmiHeader.biSizeImage = DIBSIZE(pVideoHeader->bmiHeader); mtVideo.formattype = FORMAT_VideoInfo; mtVideo.cbFormat = sizeof(VIDEOINFOHEADER); mtVideo.bFixedSizeSamples = TRUE; mtVideo.lSampleSize = DIBSIZE(pVideoHeader->bmiHeader); hr = pVideoGroup->SetMediaType(&mtVideo); hr = pTL->AddGroup(pVideoGroupObj); hr = pTL->CreateEmptyNode(&pVideoTrackObj, TIMELINE_MAJOR_TYPE_TRACK); hr = pVideoGroup->QueryInterface(IID_IAMTimelineComp, (void **)&pVideoComp); hr = pVideoComp->VTrackInsBefore(pVideoTrackObj, 0); hr = pVideoTrackObj->QueryInterface(IID_IAMTimelineTrack, (void **)&pVideoTrack); hr = pTL->CreateEmptyNode(&pVideoSourceObj, TIMELINE_MAJOR_TYPE_SOURCE); hr = pVideoSourceObj->QueryInterface(IID_IAMTimelineSrc, (void **)&pVideoSource); //Audio hr = pTL->CreateEmptyNode(&pAudioGroupObj, TIMELINE_MAJOR_TYPE_GROUP); hr = pAudioGroupObj->QueryInterface(IID_IAMTimelineGroup, (void **)&pAudioGroup); AM_MEDIA_TYPE mtAudio; ZeroMemory(&mtAudio, sizeof(AM_MEDIA_TYPE)); mtVideo.majortype = MEDIATYPE_Audio; mtAudio.subtype = MEDIASUBTYPE_PCM; mtAudio.bFixedSizeSamples = m_mtSrcAudio.bFixedSizeSamples; //the m_mtSrcAudio is AM_MEDIA_TYP

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups