Timothy Reed | 3 Sep 04:33 2014

Re: AV_CODEC_ID_SMPTE_KLV not recognized

I’m attempting to do the exact same thing and I too am stuck on the next step.  It appears to me that I will need to encode the KLV data into the packets but then how to mux them together?

Have you guys made any progress that you can share?

Thanks,
Tim





_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
PushengHe | 2 Sep 16:09 2014

how to put the two *.ts stream files multiplexed into a output.ts file?

Dear all:
     how to put the two *.ts stream files multiplexed into a output.ts 
file about ffmpeg?

     I have two files,like a.ts and b.ts, I want to multiplex the files 
to output.ts, so I can play the file of output.ts. Can ffmpeg do it?

--

-- 
Regards,
Simon Ho
Nicolas Derouineau | 1 Sep 16:04 2014

filter_mb_edge

Hello,
I would like to understand the prototype of this function:


filter_mb_edgeh(uint8_t *pix, int stride,
                                             const int16_t bS[4],
                                             unsigned int qp, int a, int b,
                                             H264Context *h, int intra)

Let's say I want to check the filtering condition on p0,1,2 and q0,1,2 . How am I supposed to read the pix buffer to get them ?

Regards,

Nicolas


_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
Parth V Shah | 1 Sep 10:43 2014

Redirecting MP4 muxed data to socket using movflags resets timestamp

I am using FFMPEG library to mux H.264 and AAC frames to MP4 file. I do that C program.
I store H.264 and AAC frame's timestamp in epoch format.

I use ffprobe to check timestamps that stored in the MP4 file, ffprobe confirms that file is in MP4 format and timestamps are stored correctly. below is the output of ffprobe.

  • ffprobe -show_packets 20140805095931.mp4
        Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '20140805095931.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf54.29.104
      Duration: 00:01:39.70, start: 1407232771.984000, bitrate: 1063 kb/s
        Stream #0.0(und): Video: h264 (High), yuv420p, 960x540, 999 kb/s, 30 fps, 59.94 tbr, 1k tbn, 60 tbc
        Stream #0.1(und): Audio: aac, 48000 Hz, mono, s16, 53 kb/s
    [PACKET]
    codec_type=video
    stream_index=0
    pts=1407232771984
    pts_time=1407232771.984000
    dts=1407232771984
    dts_time=1407232771.984000
    duration=34
    duration_time=0.034000
    size=24556.000000
    pos=48
    flags=K
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=1407232772018
    pts_time=1407232772.018000
    dts=1407232772018
    dts_time=1407232772.018000
    duration=33
    duration_time=0.033000
    size=3180.000000
    pos=24604
    flags=_
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=1407232772051
    pts_time=1407232772.051000
    dts=1407232772051
    dts_time=1407232772.051000
    duration=33
    duration_time=0.033000
    size=3209.000000
    pos=27784
    flags=_
    [/PACKET]


My goal is reading this muxed MP4 data from MP4 file and send this muxed mp4 data to the client over socket without creating any temporary file. My actual goal is to write a C program though.

I tried using protocols tcp and udp but they are not working with Mp4 format and gives error as below.

ffmpeg -i 20140805095931.mp4 -f mp4 -vcodec copy tcp://10.99.19.163:8888

[mp4 <at> 0xb1e1920] muxer does not support non seekable output   
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

So, I read somewhere about moov atom and tried it with following command

ffmpeg -i 20140805095931.mp4 -movflags isml+frag_keyframe -f mp4 -vcodec copy tcp://10.99.19.163:8888

using above commandline I am able to send mp4 file to the client using tcp protocol that ffmpeg supports.

But when I apply ffprobe on the MP4 file timestamp resets to 0 , even starttime becomes 0.0000. Below is the output of ffmpeg.

  •  ffprobe -show_packets out.mp4

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf55.48.100
      Duration: 00:01:39.71, start: 0.000000, bitrate: 1059 kb/s
        Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540, 999 kb/s, 30 fps, 30 tbr, 16k tbn, 60 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 53 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    [PACKET]
    codec_type=video
    stream_index=0
    pts=0
    pts_time=0.000000
    dts=0
    dts_time=0.000000
    duration=533
    duration_time=0.033313
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=24556
    pos=3853
    flags=K
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=544
    pts_time=0.034000
    dts=544
    dts_time=0.034000
    duration=533
    duration_time=0.033313
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=3180
    pos=28409
    flags=_
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=1072
    pts_time=0.067000
    dts=1072
    dts_time=0.067000
    duration=533
    duration_time=0.033313
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=3209
    pos=31589
    flags=_
    [/PACKET]


Any help or advice? Thank you in advance.
************************************************************************************************************************************************************* eInfochips Business Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated. Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. *************************************************************************************************************************************************************
_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
Irene & Peter Laponder | 31 Aug 11:22 2014
Picon

Not all subtitles of video.ts file available

When I record a DVB stream (.TS file) with 9 languages (for instance TV5monde Europe does this) ffmpeg seems to limit the selection to the first 4 languages. Is it possible to increase this list or make it dynamic depending on the stream?

_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
Федор | 30 Aug 11:36 2014
Picon

Symbian port

How directly use gas-preprocessor.pl? I download bundle from here - https://git.libav.org/?p=gas-preprocessor.git;a=tree ang try it like described here - https://wiki.libav.org/Tools/gas-preprocessor . I got error :
gas-preprocessor.pl gas
Unrecognized input filetype at D:\Symbian\Projects\gas-preprocessor\gas-preprocessor.pl line 95.

_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
Lyndon Hill | 29 Aug 08:35 2014

Rewind file to start

Hi,

What is the best (most universal) way to rewind a file to the start ?

Currently I am using

av_seek_frame(formatContext, videoStream, 0, AVSEEK_FLAG_ANY);

However, in an HEVC bit stream, there are no timestamps (as interpreted by x265) so this method will not work.

Thanks in advance
Atela Wu | 27 Aug 16:05 2014
Picon

reconnect after socket timeout


hi,guys, i’m trying to reconnect the rtmp live stream connection when socket receives timeout 
simply likes  
ffplay “rtmp://xxxxxx timeout=5”


but after av_read_frame receiving timeout,  no flag can specify it is eof or timeout, it returns eof all the time, but it’s fine, whatever i reconnect to it.

my code is just like this, but after i reopen the io_context,  av_read_frame will be stucked

ret = av_read_frame(format_ctx, pkt);

if (avio_feof(format_ctx->pb)) {

            avio_close(format_ctx->pb);

            avio_open(&format_ctx->pb, filename, AVIO_FLAG_READ) ;

            ic->pb->eof_reached = 0;

            av_free_packet(pkt);

            ret = av_read_frame(format_ctx, pkt);        

}


i cannot just call avformat_open_input and avformat_find_stream_info, because of the format_ctx (including AVstreams, CodecContext) had been using in other decoding threads.


any  suggestions i will appreciate it .

thanks.
_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
Krishna | 27 Aug 15:48 2014
Picon

Problem using avcodec_decode_video2 for reading HEVC stream

Hi, 

I am writing an HEVC decoder and it seems that the first several frames are not decoded by avcodec_decode_video2(). Here is my code snippet. The input is an video-only stream (no audio). This is my function, that is called each time I need a single frame (that is essentially what I want  -- one frame at a time). 

bool decode(pFormatCtx, pCodecCtx)
{
    int gotaFrame=0;
    int retVal = 0;
    while (gotaFrame==0) {

        printf("1\t");

        if ( !av_read_frame(pFormatCtx, &packet) ) { 
            if(packet.stream_index==videoStreamIndex) {

                // try decoding
                retVal = avcodec_decode_video2(pCodecCtx, pFrame, &gotaFrame, &packet);
                printf("%d\t", retVal);

                if (gotaFrame) {  // decode success.

                    printf("2\t");

                    // dump to yuv ... not shown here. 

                    // cleanup
                    av_frame_unref(pFrame);
                    av_frame_free(&pFrame);
                    av_free_packet(&packet);

                    return true;
                }
            }
        }
    }
}

Here is the output of retVal: 

retval=33149
retval=6715
retval=767
retval=264
retval=126
retval=147
retval=286
retval=140
retval=141
retval=7243
retval=568
retval=315
retval=95
retval=146
retval=328
retval=159
retval=121
retval=7010
retval=571
retval=309

After the retVal=309, gotaFrame becomes 1. Essentially, I have lost a lot of frames. Can someone help me out here?

How do I get one frame at a time?

Thank you! 
_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
diceydawg . | 26 Aug 19:42 2014
Picon

Detecting bad frames h.264 decoder

Hi, i am developing an application that decodes a mpeg-ts file that must drop any frames which may cause video artifacts (for the purpose of machine vision algorithms).  Currently I am using the log_callback within a mutex (for multi-threaded decoders) in order to receive the correct error for a given frame. (example below) 

if (level == AV_LOG_FATAL) { //print out error } else if (level == AV_LOG_ERROR) { /** handle bad frame */ } else {

Since parsing the log to detect error's is not the best way to detect frame issues, Is there a better way to handle this?  Can I retrieve the error from a frame returned from avcodec_decode_video2?


Daisuke
_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user
Hector Alonso | 26 Aug 16:45 2014
Picon

Re: HW Accelerator in Windows: DXVA2 with new API

I've changed the size and number of the slices from the source and it shows perfectly the video.
What is the relation between the slices and the DXVA2 ?




2014-08-26 10:58 GMT+02:00 Hector Alonso <hector.alonso.aparicio-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
Hi,

I've modified my initialization code: supressed flags, and enabled thread_safe_callbacks, but the result is the same, lots of "Missing reference picture, default is __" error messages and avcodec_decode_video2 returns -1094995529 "Invalid data found when processing input" half the time. 
The video is showing very very poorly with tons of compression artifacts.
I've read the extradata comment in ffmpeg code and it seems that is not really used with H264 codec. I've run my ffmpeg-not-HWaccel decoder and the extradata is not used at all indeed.

This is the new initialization:

#ifdef DXVA2_DECODER_ENABLED

// Create and populate Input Stream structure:
InputStream* ist = new InputStream();
ist->hwaccel_id = HWACCEL_AUTO;
ist->hwaccel_device = "dxva2";
ist->dec = _pCodec;
ist->dec_ctx = _pCodecCtx;

// Set Known width and height
_pCodecCtx->coded_width  = 1280;
_pCodecCtx->coded_height = 720;

// Set Input Stream structure as ancillary data into codec
_pCodecCtx->opaque = ist;
// Initialize DXV2 context
dxva2_init(_pCodecCtx);

// Set DXVA2 callbacks to codec context
_pCodecCtx->get_buffer2 = ist->hwaccel_get_buffer;
_pCodecCtx->get_format = get_format;
_pCodecCtx->thread_safe_callbacks = 1;

#endif

Remember: dxva2_init is a call to the analogue method from ffmpeg_dxva.c file modified by me into a .h and a .cpp attached in a previous mail (I don't know if that's a common practice in this mail list or you do it in another way).

Regarding the next step (using the DX surface directly as an OpenGL texture), it can be done using: WGLEW_NV_DX_interop, wglDXOpenDeviceNV, wglDXSetResourceShareHandleNV, wglDXRegisterObjectNV, make current, lock, etc.

Look at WiDiSample code -> RenderOpenGL.cpp bind texture (Intel Media SDK video decoder example), and this page:

...but for now I'm more worried about getting the DXVA2 to work properly with FFMPEG.

What am I missing?




2014-08-25 17:53 GMT+02:00 wm4 <nfxjfg <at> googlemail.com>:

On Mon, 25 Aug 2014 15:23:20 +0200
Hector Alonso <hector.alonso.aparicio-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Hi,
> I've rebuilt ffmpeg using these instructions
> https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC from the Visual Studio
> Console, installing MinGW directly from the link with the flags --enable-dxva2
> and --enable-hwaccel=h264_dxva2 and is almost working but I get a lot
> of errors:
> -1094995529 "Invalid data found when processing input"
> from avcodec_decode_video2 a lot of artifacts and a very poor and
> inconsistent image quality.
> This is my dxva initialization code:
>
> _pCodecCtx->flags|= CODEC_CAP_DR1;
> _pCodecCtx->flags|= CODEC_CAP_HWACCEL;
>
> InputStream *ist = new InputStream ();
> ist->hwaccel_id = HWACCEL_AUTO;
> ist->hwaccel_device = "dxva2";
> ist->dec = _pCodec;
> ist->dec_ctx = _pCodecCtx;
> _pCodecCtx->coded_width  = 1280;
> _pCodecCtx->coded_height = 720;
> _pCodecCtx->opaque = ist;
> dxva2_init(_pCodecCtx);
> _pCodecCtx->opaque  = ist;
> _pCodecCtx->get_buffer2 = ist->hwaccel_get_buffer;
> _pCodecCtx->get_format = get_format;
> _pCodecCtx->thread_safe_callbacks = 0;
>
> before  calling
>
>  if (avcodec_open2(_pCodecCtx , _pCodec, 0) < 0)  ...
>
> Where get_format is:
>
> static enum AVPixelFormat get_format(AVCodecContext *s, const enum
> AVPixelFormat *pix_fmts)
> {
> InputStream* ist = (InputStream*)s->opaque;
> ist->active_hwaccel_id = HWACCEL_DXVA2;
> ist->hwaccel_pix_fmt   = AV_PIX_FMT_DXVA2_VLD;
> return ist->hwaccel_pix_fmt;
> }
>
> Find attached my modified ffmpeg_dxva2.cpp and ffmpeg_dxva2.h files from
> the original ffmpeg_dxva2.c and the InputStream declaration from ffmpeg.h
>
> For getting the decoded frame I call: dxva2_retrieve_data_call, and then I
> convert it to YUV420p (I make the final conversion via pixel shader with
> OpenGL texture).
>
> Also, with my old CPU decoder I had 3-6% CPU usage and 5-10% GPU usage (as
> I said, I'm converting and painting with OpenGL) and now with the "GPU
> Accelerated" one I have 5-13% CPU and 6-12% GPU.

PS: nevcairiel mentioned:
http://developer.download.nvidia.com/opengl/specs/WGL_NV_DX_interop.txt

Unfortunately, it's marked as experimental, and other drivers probably
don't provide it.

> Any thoughts?
>
> Thank you!
>
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


_______________________________________________
Libav-user mailing list
Libav-user@...
http://ffmpeg.org/mailman/listinfo/libav-user

Gmane