Hi Kalileo,

Thank you very much for your quick reply.

Sorry for my unclear description last email. What I have done is start from 
mpeg2 TS stream, and then decoding, encoding them to H.264+AAC without 
container. Next I have put H.264+AAC data frame into AVI, MKV, MP4 container 
successfully. However, my final target is putting H.264+AAC data frame into TS 
container. And it failed. So what I passed to IMHO h264_mp4toannexb is not 
mpegts stream but H.264+AAC frame.

So I want to make sure you understand my situation correctly.

So according to my understanding, after the H.264 encoding, I should add the 
h264 Annex B header to every H264 video frame manually. Am I right?

Hope there is some experts can give us confirmation about that. Or there is any 
other suggestion please tell me, thanks.



Best regards,

Li Zhang

________________________________________
From: [email protected] [[email protected]] On Behalf 
Of Kalileo [[email protected]]
Sent: Friday, March 09, 2012 5:27 PM
To: This list is about using libavcodec, libavformat, libavutil,        
libavdevice and libavfilter.
Subject: Re: [Libav-user] Please help me about transcoding to TS stream:        
H.264 bitstream malformed, no startcode found,  use the h264_mp4toannexb 
bitstream filter (-bsf h264_mp4toannexb)

On Mar 9, 2012, at 22:20 , Li Zhang wrote:

>
> Hi everyone,
>
>
> I am a new user to ffmpeg API. I want to transcode mpeg2 video stream to 
> H.264+AAC and then put them into TS container again.
>
> I have implemented transcoding from mpeg2 TS to AVI, MKV, MP4 local files. 
> Now the problem is when I used the same code put those H.264+AAC data packet 
> into TS container, the video can not be played and only the audio can be 
> played. Actually, there was video packet data in the .ts file which was 
> derived from trandcoding.
>
> And I got the information from ffmpeg that "H.264 bitstream malformed, no 
> startcode found, use the h264_mp4toannexb bitstream filter (-bsf 
> h264_mp4toannexb)". So I initiated the h264_mp4toannexb bitstreamfilter and 
> use av_bitstream_filter_filter to process the packet before write them to 
> output file. However, av_bitstream_filter_filter returns 0 and the final 
> output file still the same situation and the warning information still happen.
>
> There is another warning information about DTS, it only happen every 29 
> frames. That is so strange.  Please help me.  I used the latest version of 
> ffmpeg.
> When I used the Elecard Stream Analyzer to check my transcoded file, I found 
> the file missed SPS and SEI information for the video stream. There is only 
> SPS and SEI information for audio stream.  I do not know why the TS container 
> can not produce these information for me.

Hi Li,

IMHO h264_mp4toannexb does not work if you convert from mpegts stream to mpegts 
stream, because as far as I have understood it h264_mp4toannexb expects mp4 as 
source and not mpegts. you need to do manually what h264_mp4toannexb would do, 
that is adding the h264 Annex B header in front of every h264 frame.

I'm sure the experts here can confirm or correct me, and explain better what to 
do.


_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to