Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
how to solve issue for playing mp4 file using ffmpeg ?
10 octobre 2013, par user2841186I get the following error while running the command:
ffprobe.exe -f h264 AndrewFlintoff_Cricket.mp4
error: "Diverting av_*_packet function calls to libavcodec. Recompile to improve performance"
-
Adding picture to video using FFmpeg through android ndk
10 octobre 2013, par Papajohn000I was wondering how you would go about adding a picture to the video at a certain location in the video using ffmpeg and android ndk. I want to the picture to be visable for a couple of seconds so it will need to be added in a loop.
-
avcodec_decode_video2 always sets got_picture_ptr to 0 while using with live555
10 octobre 2013, par Richard MacwanI am trying to decode frames using libavcodec. My applications retrieves rtp packets from on rtsp stream using live555. I have searched quite a lot for reasons of avcodec_decode_video setting got_picture_ptr to 0 but haven't been able to find it.
Can anyone tell me how avcodec_decode_video2 works internally? What reasons might lead the got_picture_ptr pointer to be set to zero? PS: The function does read bytes i.e the return value is always a positive number, not -1. I'm stumped here, any help would be appreciated. I haven't quoted any code since the code to decode using avcodec_decode_video2 is fairly generic and there is nothing special in my code.(I have decoded rtsp streams earlier using libavcodec, just not along with live555) -
Decoding h264 frames from RTP stream
9 octobre 2013, par Dmitry BakhtiyarovI am using live555 and ffmpeg libraries to get and decode RTP H264 stream from server; Video stream was encoded by ffmpeg, using Baseline profile and
x264_param_default_preset(m_params, "veryfast", "zerolatency")
I read this topic and add SPS and PPS data in the every frame, which I receive from network;
void ClientSink::NewFrameHandler(unsigned frameSize, unsigned numTruncatedBytes, timeval presentationTime, unsigned durationInMicroseconds) { ... EncodedFrame tmp; tmp.m_frame = std::vector
(m_tempBuffer.data(), m_tempBuffer.data() + frameSize); tmp.m_duration = durationInMicroseconds; tmp.m_pts = presentationTime; //Add SPS and PPS data into the frame; TODO: some devices may send SPS and PPs data already into frame; tmp.m_frame.insert(tmp.m_frame.begin(), m_spsPpsData.cbegin(), m_spsPpsData.cend()); emit newEncodedFrame( SharedEncodedFrame(tmp) ); m_frameCounter++; this->continuePlaying(); } And this frames I receive in the decoder.
bool H264Decoder::decodeFrame(SharedEncodedFrame orig_frame) { ... while(m_packet.size > 0) { int got_picture; int len = avcodec_decode_video2(m_decoderContext, m_picture, &got_picture, &m_packet); if (len < 0) { emit criticalError(QString("Decoding error")); return false; } if (got_picture) { std::vector
result; this->storePicture(result); if ( m_picture->format == AVPixelFormat::AV_PIX_FMT_YUV420P ) { //QImage img = QImage(result.data(), m_picture->width, m_picture->height, QImage::Format_RGB888); Frame_t result_rgb; if (!convert_yuv420p_to_rgb32(result, m_picture->width, m_picture->height, result_rgb)) { emit criticalError( QString("Failed to convert YUV420p image into rgb32; can't create QImage!")); return false; } unsigned char* copy_img = new unsigned char[result_rgb.size()]; //this needed because QImage shared buffer, which used, and it will crash, if i use this qimage after result_rgb deleting std::copy(result_rgb.cbegin(), result_rgb.cend(), copy_img); QImage img = QImage(copy_img, m_picture->width, m_picture->height, QImage::Format_RGB32, [](void* array) { delete[] array; }, copy_img); img.save(QString("123.bmp")); emit newDecodedFrame(img); } avcodec_decode_video2 decode frames without any error message, but decoded frames, after converting it (from yuv420p into rgb32) is invalid. Example of image available on this link
Do you have any ideas what I make wrong?
-
encoding XDCAM MXF with FFMPEG
9 octobre 2013, par magingaxTrying to encode XDCAM HD422 MXF with FFMPEG But can't know specific setting for encoder/format/mux Anyone can show me sample code or give some advice for that ?