Darshan.Bhandari | 29 Jul 14:58 2015

Query regarding change bitrate and resolution while transmux

Hi,

 

I am transmuxing a H264 (mp4) video to support segments (mpegts with H264) for HLS streaming.

I am creating these segments on demand based on the input start and end time.

Before transmuxing it to mpegts format, I want to change the bitrate and resolution.

IS it possible and if yes how ?

 

Thanks,

Darshan


"Confidentiality Warning: This message and any attachments are intended only for the use of the intended recipient(s), are confidential and may be privileged. If you are not the intended recipient, you are hereby notified that any review, re-transmission, conversion to hard copy, copying, circulation or other use of this message and any attachments is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return email and delete this message and any attachments from your system.

Virus Warning: Although the company has taken reasonable precautions to ensure no viruses are present in this email. The company cannot accept responsibility for any loss or damage arising from the use of this email or attachment."

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Self User | 24 Jul 17:58 2015
Picon

c++ code example to extract the TS header info field (like PID. continuity counter)

Hi all,

I just newly subscribed to the mailing list.

I try to have an example of a code that pass on each TS packet frame (188 bytes) and extract its fields I hope to get help for that.

also an example to extract the adaption layer if exists like PCR value and other fields

the examples I saw in the ffmpeg package was of encoding & decoding the video itself.

Thank you very much

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Gonzalo Garramuno | 24 Jul 02:13 2015
Picon

Cached frames

I understand that some video (and audio) codecs cache frames to decode B 
frames for example.  In order to retrieve the last frames of such 
movies, it is needed to call av_read_frame and wait for an error of 
AVERROR_EOF which then means I need to pass packets with NULL and size 0.
This is all dandy.  However, I would like to know in advance how many 
times I will need to pass packets with NULL and size 0.  Is there a way 
to know this?

--

-- 
Gonzalo Garramuño

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Oscar Hou | 23 Jul 08:29 2015
Picon

Encoding YUV420SP (PIX_FMT_NV12) with MPEG4

Hello, 

I was wondering if there was a way to encode directly from YUV420SP (PIX_FMT_NV12) to MPEG4 without first converting the format to YUV420P? Currently the conversion takes a too long to convert 1080p (~150ms per frame) for me to stream at 30fps. I am attempting to stream the output to VLC at 30fps but the frames are being dropped.

Thanks
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Ratin | 22 Jul 21:36 2015
Picon

HWACCEL for MPEG4 broken?

Hey Folks, I am trying to decode mpeg4 (avi container) with libavcodec, integrating with libva. Saw this allocation related issue, even if the image sizes are properly populated, the linesize remains zero and throws the error messages as shown below. i made sure get buffer is called and allocation succeeds in the GPU. Was wondering if anybody saw this issue before.


Update: It seems that mpv does not use HWACCEL to decode MPEG4 either (it goes thru reinit chain). Just dumps the raw bitstream to HWACCEL for rendering.

 
Ratin


StreamInfo succeded
Input #0, avi, from 'file:///var/www/media/Blvd_640x480.avi':
  Duration: 00:09:10.53, start: 0.000000, bitrate: 1265 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 1259 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc

Calling StreamInfo

StreamInfo succeded
libva info: VA-API version 0.38.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0

2015-07-20 17:22:02:659609 | [mpeg4 <at> 0x7f8788497f50] Image too small, temporary buffers cannot function
[mpeg4 <at> 0x7f8788497f50] get_buffer() failed to allocate context scratch buffers.
[mpeg4 <at> 0x7f8788498820] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 <at> 0x7f8788498820] Image too small, temporary buffers cannot function
[mpeg4 <at> 0x7f8788498820] get_buffer() failed to allocate context scratch buffers.
[mpeg4 <at> 0x7f878849ba90] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 <at> 0x7f878849ed00] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 <at> 0x7f87884a1f70] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 <at> 0x7f87884a1f70] Image too small, temporary buffers cannot function
[mpeg4 <at> 0x7f87884a1f70] get_buffer() failed to allocate context scratch buffers.
[mpeg4 <at> 0x7f8788497f50] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 <at> 0x7f8788498820] Context scratch buffers could not be allocated due to unknown size.
[mpeg4 <at> 0x7f8788498820] Image too small, temporary buffers cannot function
[mpeg4 <at> 0x7f8788498820] get_buffer() failed to allocate context scratch buffers.


_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
HONGBO LI | 16 Jul 00:19 2015

how to change x264 parameters after opening the encoder (avcodec_open2)


I decode and re encode I frame of a movie  file.

when encode I frame, each I frame need a different qp value. 
How can qp parameter change after
avcodec_open2(CodecCtx, codec, &options) )     ? 

av_dict_set( &options, "qp"   ,  x     , 0 )  is used to set qp.

If x264 parameter can't change after avcodec_open2 function, 
Can I close this encoder and open a new x264 encoder with a new parameter for next I frame?

Thanks

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Yves Michels | 17 Jul 12:56 2015
Picon

How to feed motion vectors

Hello,

I am working on video steganography in collaboration with northumbria  
university. I am working with the H.264 standard. I made a program to  
read and store the information about the macroblock partition and the  
motion vector values, and to change the motion vectors in an AVFrame  
structure. I am now trying to encode the video (with  
"avcodec_encode_video2") with the macroblock partition and the motion  
vectors stored in the AVFrame (instead of re-estimate these  
parameters). I tryed to fix the "me_method" to ME_X1 (6) but it is not  
sufficient. How to generate the bitstream (AVPacket) without estimate  
the MB partition and the MV values?

Please find attached my program.

Nb : the function which write the video, "MV_ReadWrite", begin line  
626, the codec information are set line 687, and the encoding loop  
begin line 767.

Best regards,

Yves MICHELS.
Attachment (MV_ReadWrite.c): text/x-csrc, 26 KiB
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Alan Petrus | 16 Jul 18:35 2015
Picon

How to determine library capabilities per version

Given an FFmpeg version, (preferably older version 0.11.1), how can I determine the follow that is supported by libav:

1. Max H264 decoding (and encoding) level supported. For a table of levels see https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC

2. If hardware decoding is supported (on Windows or Linux)

3. If H265 decoding (and encoding) is supported

I am willing to look at source code to find this info (if pointed out).  

Thank you very much!
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
srinivasu g | 15 Jul 11:49 2015
Picon

DVB bitmap subtitles Decoding

Hi,
I want to understand the DVB bitmap subtitles Decoder code presented in FFMPEG and want to use DVB code into one of my appliaction. Could someone else give me the suggestion which part and from where I have to start? Is there any specific test example code presented in doc\examples?

Regards,
Srinivasu G
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Michael Toon | 15 Jul 11:09 2015

MJPEG quantization tables

Hello,

 

I am using the encoder libs to encode MJPEG video which I am packaging up to send via RTP.  The encoded bit stream that I generate only appears to have a single quantization table defined, however the RTP payload format specifies that if using custom quantization tables there should be two separate quantization tables for luma and chroma. Having separate tables seems to make sense to try and gain most encoding efficiency, especially since I need to transmit two tables regardless. Is there a reason why the MJPEG codec only generates a single table, is there an option that I can to use separate tables?

 

Cheers,

 

Mike

 

 

Digital Barriers e-Mail Confidentiality and Disclaimer

                   

This message contains confidential information and is intended only for the individual named. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

 

Digital Barriers plc is a company registered in England and Wales. Registered number: 7149547. Registered office: Cargo Works, 1-2 Hatfields, London SE1 9PG, United Kingdom. For further information about Digital Barriers, please visit www.digitalbarriers.com.

 


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Ruurd Adema | 14 Jul 20:49 2015

Encoding live audiopackets

I'm trying to write live incoming audiopackets into a mov file with AAC encoding using the FFmpeg api.

When using no encoding (AV_CODEC_ID_PCM_S16LE) it works well, when using AAC encoding (AV_CODEC_ID_AAC) it fails. The resulting audiofile plays too fast and sounds distorted.

I’m new to the FFmpeg api, (and quite a beginner in programming anyway), so big chance I forgot something or doing something wrong. Is there anyone willing to help me with this one?

audiopacket_sample_count  = audiopacket->GetSampleFrameCount();
audiopacket_channel_count = decklink_config()->audio_channel_count;
audiopacket_size          = audiopacket_sample_count * (decklink_config()->audio_sampletype/8) * audiopacket_channel_count;

audiopacket->GetBytes(&audiopacket_data);

av_init_packet(&pkt);    

if (AUDIO_TYPE == AV_CODEC_ID_PCM_S16LE)
{
    audiopacket->GetPacketTime(&audio_pts, audio_stream->time_base.den);

    pkt.pts          = audio_pts;
    pkt.dts          = pkt.pts; 
    pkt.flags       |= AV_PKT_FLAG_KEY;                 
    pkt.stream_index = audio_stream->index;
    pkt.data         = (uint8_t *)audiopacket_data;
    pkt.size         = audiopacket_size;

    av_interleaved_write_frame(output_fmt_ctx, &pkt);
else if (AUDIO_TYPE == AV_CODEC_ID_AAC)
{
    frame = av_frame_alloc();
    frame->format = audio_stream->codec->sample_fmt;
    frame->channel_layout = audio_stream->codec->channel_layout;
    frame->sample_rate = audio_stream->codec->sample_rate;
    frame->nb_samples = audiopacket_sample_count;

    audiopacket->GetPacketTime(&audio_pts, audio_stream->time_base.den);

    frame->pts = audio_pts;

    if (avcodec_fill_audio_frame(frame, audiopacket_channel_count, audio_stream->codec->sample_fmt, (const uint8_t *)audiopacket_data, audiopacket_size, 0) < 0)
    {
        fprintf(stderr, "[ERROR] Filling audioframe failed!\n");
        exit(-1);
    }

    if (avcodec_encode_audio2(audio_stream->codec, &pkt, frame, &got_packet) != 0)
    {
        fprintf(stderr, "[ERROR] Encoding audio failed\n");
    }

    if (got_packet) 
    {
        pkt.stream_index = audio_stream->index;
        pkt.flags       |= AV_PKT_FLAG_KEY; 

        av_interleaved_write_frame(output_fmt_ctx, &pkt);
    }
    av_frame_free(&frame); 
}
av_free_packet(&pkt);


_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user

Gmane