qw | 30 May 11:09 2016

how to get metadata via ffmpeg/ffprobe command line

Hi,

As I know, source file may have metadata, so does each stream. I use ffprobe to print some information of 'wynonna_earp.mp4 '. But how to printf its metadata in json format?



ffprobe wynonna_earp.mp4
ffprobe version 2.8.3 Copyright (c) 2007-2015 the FFmpeg developers
  built with icc (ICC) 14.0.2 20140120
  configuration: --cc=/opt/intel/bin/icc --enable-version3 --enable-asm --enable-yasm --enable-avfilter --enable-libvidstab --disable-static --enable-shared --enable-libx264 --enable-gpl --prefix=/usr/local/ --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --enable-libfdk_aac --enable-nonfree --enable-libass --enable-libfreetype --extra-libs=-lfreetype
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'wynonna_earp.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    creation_time   : 2016-04-03 10:10:01
  Duration: 00:43:06.30, start: 0.000000, bitrate: 1932 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x712 [SAR 1:1 DAR 160:89], 1800 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2016-04-03 09:58:39
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2016-04-03 10:10:02
      handler_name    : GPAC ISO Audio Handler

Thanks!

B.R.

Andrew




 

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Sampsa Riikonen | 30 May 09:48 2016
Picon
Picon

Finding AVCodecContext data from sps and pps packets

Hello,

I have a code in which I am receiving H264 sps, pps and frame packets 
and want to mux them into matroska, using libav*.

As instructed in the sample codes, I am doing roughly the following:

AVFormatContext *oc;
AVCodec *codec;
AVCodecContext *ctx;
AVStream *stream;
AVPacket *avpkt;

avformat_alloc_output_context2(&oc, NULL, NULL, "output.mkv");

codec  = avcodec_find_decoder(AV_CODEC_ID_H264); // AVCodec = possible 
parameters for a codec
ctx    = avcodec_alloc_context3(codec);          // reserve memory for 
codec related thingies.. AVCodecContext = defines codec parameters (as 
per AVCodec)
stream = avformat_new_stream(oc,ctx->codec);     // add new stream to 
AVFormatContext ctx->codec is "AVCodec"

avcodec_copy_context(stream->codec,ctx);         // stream.codec == 
AVCodecContext (we populate the codec parameters for stream "stream")

// THE QUESTION: How do we populate stream->codec, i.e. AVCodecContext 
instance, correctly for the stream? (***)

avio_open(&oc->pb, filename, AVIO_FLAG_WRITE);   // open the matroska 
file ..
ret = avformat_write_header(oc, NULL);

...

av_interleaved_write_frame(oc,avpkt);           // pass packets to the muxer

The problem is, that prior to opening the matroska file, stream->codec 
has no information about picture dimensions (matroska header requires 
pic dimensions).
I can solve this by passing sps, pps and an i-frame to a decoder (with 
avcodec_decode_video2), which populates an AVCodecContext with correct 
picture information, and then use that AVCodecContext.
However, this seems to be an overkill.. I do not want to decode 
anything, just to get the codec parameters from sps and pps.  Is there a 
simpler way to achieve this?

In fact, for files (AVFormatContext), there is the routine 
"avformat_find_stream_info" for such task.  At the present case, 
however, I only have raw sps, pps and frame packets.

One observation more: the sps, pps and I-frame (nal unit types 7,8 & 5), 
must the aggregated into a single packet in order for the matroska muxer 
to work.

Regards,

Sampsa

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
ULTRANj | 27 May 20:35 2016
Picon

h264 getting dct coefficients in decoder

I want to implement LSB-steganography algorithm for h264-encoded video.

According to  this paper <http://www.cs.ox.ac.uk/andrew.ker/docs/ADK54B.pdf> 
, I need to modify the quantized coefficients in encoder, and translate
video (via vlc-media player).

The quality of the encoded video went bad and some steganography artifacts
occured in destination video player.

Now I want to extract hidden information, but I can't find a place in libav
codec, where decoder gets the DCT coefficients.

I checked the function *decode_cabac_residual_internal()* in *h264_cabac.c*
and dumped *block[]* of some coefficients there, but it differs from
coefficients , I dumped in encoder. 

Where is the place in decoder, where I can get dct coefficients, that i sent
from encoder?

Thanks, Nj

--
View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-h264-getting-dct-coefficients-in-decoder-tp4662187.html
Sent from the libav-users mailing list archive at Nabble.com.
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Net | 27 May 15:37 2016
Picon

avformat_open_input on dead UDP link hangs after interrupt_callback signaled exit

Just happen today, after latest dll update, my small Win32 test program 
stopped working. It goes like this:

2 threads, avformat_open_input on first, trying to open dead udp link, 
for ex. "udp://127.0.0.1:8000"
interrupt_callback is get called and seems to working properly.
Second thread is setting exit variable that is checked in 
interrupt_callback, returning 1 (exit), and all ok.

However, avformat_open_input does not exit, blocks.
Last message is: (module: message) AVIOContext: Statistics: 0 bytes 
read, 0 seeks

I've been able to find last version that worked; using Win32 dll’s from 
Zeranoe:
Working: 
https://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-20160522-git-566be4f-win32-shared.7z
NOT working: 
https://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-20160525-git-9591ca7-win32-shared.7z

I think reproducing is trivial, so did not provide source code.

Thank you,
Marlon

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Jesper Taxbøl | 27 May 14:21 2016
Picon

When learning FFMPEG: What environment to use? - What tutorials to follow?

Hi,

Im on Ubuntu 14.04 LTS, and I have installed FFMPEG via the guide here https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

The ffmpeg version this process ends up with is: N-80079-g4c82cca

Im trying to learn how to integrate ffmpeg tools into my own application.I am therefore following the tutorial: "How to Write a Video Player in Less Than 1000 Lines" availabe at
 http://dranger.com/ffmpeg/

I spent quite a deal of time trying to compile the examples, but finally made example one and two compile using a makefile with the following lines:

"""
tut01.txt: tutorial01.a
    ./tutorial01.a _1.mp4

tutorial01.a: tutorial01.c
    /usr/bin/g++ -o $ <at> $< -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/local/include -I/usr/include/SDL  -pthread -L/usr/local/lib -lavformat -lavcodec -lswscale -lva-drm -lva-x11 -lva -lxcb-shm -lxcb-xfixes -lxcb-render -lxcb-shape -lxcb -lXau -lXdmcp -lasound -lpulse-simple -lpulse -lX11 -lXext -lcaca -lx265 -lstdc++ -lrt -lx264 -ldl -lvpx -lpthread -lvorbisenc -lvorbis -ltheoraenc -ltheoradec -logg -lopus -lmp3lame -lfdk-aac -lass -lharfbuzz -lfontconfig -lfribidi -lexpat -lfreetype -lpng12 -lz -lswresample -lavutil -lm -lSDL

"""

I have now successfully run tutorial 1 and 2, but that is as far as I have got. Example three can build, but there is an audio bug and the remaining examples are failing with undefined functions etc.

1) What is a recommended platform, environment and setup recommended to learn ffmpeg?

2) What (working) tutorials or books exist that will walk me through reading and writing video?

I hope someone can point me in a more fruitfull direction as I have found development with ffmpeg close to impossible. :(

Kind regards

Jesper
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Jesper Taxbøl | 27 May 14:05 2016
Picon

Tutorial

Hi Guys,

Im trying to follow the tutorial


--
Jesper Taxbøl
+45 61627501

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Scott | 27 May 04:11 2016
Picon
Picon

Converting from 25 to 29.97fps

I am converting a 25fps mp4 file to VCD format (ntsc). It's watchable
but I notice "flickering pixels" that occur during
playback. Parts of the image become mildly blurred then quickly flick
back. I'm assuming this is because of mismatched frame rates. Are they
ways of mitigating this "flickering" via filters? Thank you.

-s
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Venkat | 26 May 08:14 2016
Picon

merging two audio files into single playable(mp3/wma) file

Hi All,

 I am looking for example code for merging two audio file into one single
playable(mp3/wav) file.
if did any one come across can you please help me.

in search I saw one post but i didnt get more from it.
http://libav-users.943685.n4.nabble.com/Libav-user-Two-pass-encoding-example-tt4659427.html#none

I able to do with ffmpeg exe with following command:
ffmpeg -f mulaw -ar 8000 -ac 1 -i u5_rtp_25may_mux1.raw -f mulaw -ar 8000
-ac 1 -i u6_rtp_mux2.raw -filter_complex amerge -ac 2  mix_L_R.pm3

can any one help with example code.

Thanks in advance,
-Venkat. 

--
View this message in context: http://libav-users.943685.n4.nabble.com/merging-two-audio-files-into-single-playable-mp3-wma-file-tp4662181.html
Sent from the libav-users mailing list archive at Nabble.com.
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
qw | 26 May 03:32 2016

how to deal with the situation of full disk

Hi,

In some rare case, when there are huge AV transcoding tasks, disk will become full if old files are not deleted immediately. Then those running transcoding tasks may not work correctly.

In general transcoding application, av_interleaved_write_frame() and av_read_frame() are used to write out av packets and make media files, such as mp4, flv, and mkv.

Can the two functions or other ffmpeg functions detect the disk status and report error when disk is full? And how to know via ffmpeg lib whether disk is full or not?

Thanks!

B.R.

Andrew



 

_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Suprith Gowda | 25 May 13:04 2016
Picon

Re: Reg ffmpeg sampling issue Please help me

<at> venkat rao,
are you encoding to mp2 or mp3,
b'cos avcodec_encode_audio2() encodes to mp2


Thanks
suprith

On Wed, May 25, 2016 at 11:46 AM, Venkat Rao <battula97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi All,

I am facing below error can any one please reply how can I solve this issue ?

 more samples than frame size (avcodec_encode_audio2) samples 1024 frame_size 512
 nb_samples (1024) != frame_size (512) (avcodec_encode_audio2)


On Tue, May 24, 2016 at 10:59 AM, Venkat Rao <battula97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi ,

 This is Venkat, I am new bee working with this open source codec. I need help on this libav transcoding.
 I need to develop audio Transcoder which takes input as a audio raw file and and will get information externally like parameters: what type of codec, bit rate, number of channels etc. and I need to convert this raw file to mp3 or wav format.

I am using example code "transcoding.c" file. which convert same codec form. I modified this code for taking raw file and converting to mp3, then facing issue like "[libmp3lame <at> 0x620be0] more samples than frame size (avcodec_encode_audio2)".

Please help me on this, help me how can I improve my code to support raw input and convert to mp3 format. Thanks :)

Regards,
Venkatarao.




--

Regards,
Venkatarao.
Mobile Number: 9739391297.

_______________________________________________
Libav-user mailing list
Libav-user-pYd9yefT/acdnm+yROfE0A@public.gmane.org
http://ffmpeg.org/mailman/listinfo/libav-user


_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user
Venkat Rao | 25 May 08:16 2016
Picon

Re: Reg ffmpeg sampling issue Please help me

Hi All,

I am facing below error can any one please reply how can I solve this issue ?

 more samples than frame size (avcodec_encode_audio2) samples 1024 frame_size 512
 nb_samples (1024) != frame_size (512) (avcodec_encode_audio2)


On Tue, May 24, 2016 at 10:59 AM, Venkat Rao <battula97-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi ,

 This is Venkat, I am new bee working with this open source codec. I need help on this libav transcoding.
 I need to develop audio Transcoder which takes input as a audio raw file and and will get information externally like parameters: what type of codec, bit rate, number of channels etc. and I need to convert this raw file to mp3 or wav format.

I am using example code "transcoding.c" file. which convert same codec form. I modified this code for taking raw file and converting to mp3, then facing issue like "[libmp3lame <at> 0x620be0] more samples than frame size (avcodec_encode_audio2)".

Please help me on this, help me how can I improve my code to support raw input and convert to mp3 format. Thanks :)

Regards,
Venkatarao.




--

Regards,
Venkatarao.
Mobile Number: 9739391297.
_______________________________________________
Libav-user mailing list
Libav-user <at> ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user

Gmane