Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • merge audio and video with ffmpeg without transcoding/encoding

    25 septembre 2019, par A Person

    Hi I hope you can help me with this query

    I have a video file with no Audio and 2 Audio files

    I am running the command

    ffmpeg -i video.mxf.m2v -i audio.mxf -i audio2.mxf -filter_complex "[1][2]amix=inputs=2[a]" -map 0:v -map "[a]" -c:v copy output.mxf
    

    Problem with this command is that for some reason the audio formatting change from the original setting.

    Original setting are:

    Video:

    Format : MPEG Video

    Format version : Version 2

    Format profile : 4:2:2@High

    Format settings : CustomMatrix / BVOP

    Format settings, BVOP : Yes

    Format settings, Matrix : Custom

    Format settings, GOP : M=3, N=12

    Format settings, picture structure : Frame

    Bit rate mode : Constant

    Maximum bit rate : 50.0 Mb/s

    Width : 1 920 pixels

    Height : 1 080 pixels

    Display aspect ratio : 16:9

    Frame rate : 25.000 FPS

    Standard : Component

    Color space : YUV

    Chroma subsampling : 4:2:2

    Bit depth : 8 bits

    Scan type : Interlaced

    Scan order : Top Field First

    Audio:

    Bits per sample = 24

    Bit Rate = 1152 kb/s

    48 Khz

    1 channel

    Audio track = 2

    The video seems to come out fine and no issues there but the audio comes out with the wrong spec.

    The output it gives is:

    Audio:

    Bits per sample = 16

    Bit Rate = 768 kb/s

    48 khz

    Audio Track = 1

    Is there a way for me to get the output and without transcoding and get back a file with the correct audio and video settings.

  • Create and insert new FFMPEG packet to live stream

    25 septembre 2019, par TUrwin

    I'm currently receiving an FFMPEG encoded livestream and saving it directly to a .ts file.

    The data has 2 encoded streams: One for video, and one for KLV metadata.

    I have another dataset streaming in which is raw KLV data.

    What I want to achieve is to encode the raw KLV packet data into FFMPEG packets and mux them into the same .ts file as the other data streams without having to decode and re-encode the existing FFMPEG packets.

    Is there a way to achieve this?

  • Streaming a video to /dev/video0 using gstreamer and v4l2 shows a black screen [on hold]

    24 septembre 2019, par Lawliet

    I've been trying to use a video as a webcam for quite a while now. The command

    gst-launch-1.0 filesrc location=newflag.webm ! decodebin ! videoconvert ! v4l2sink device=/dev/video0

    Using this command, i'm able to watch the stream using VLC but Discord and Firefox display a black screen when using /dev/video0 as a webcam.

    I got it working using ffmpeg to stream the video in yuv420p so I suspect videoconvert converts the stream to YUY2 which is I guess not supported by Discord nor Firefox.

    Any idea on how to get this to work ?

  • How to remove PES header from video stream

    24 septembre 2019, par AnkurTank

    I have captured video stream from the multimedia device which has H264 format.

    I want to remove PES header (i.e. first 14 bytes of the frame). Is it possible to do it by ffmpeg or any other tool. I tried searching online but didn't find it. I thought of scripting it out and remove it but don't know frame format completely. I know, I have to learn all format stuffs and I am going through it but I need this immediately. Any suggestion/pointers ?

  • ffmpeg - Merge back frames to a video with the same encoding

    24 septembre 2019, par Vuwox

    I have a video encoded using H264 at 23.98 fps, for a duration of 00:00:06.42.

    I extracted the frames from that video, and then I processed those images one-by-one. Now I want to put them back together as a video, but I want to be the same as the source video (same duration, same audio, etc).

    Whatever I tried gives something different. The duration is always greater (around 00:00:06.59), the audio seems to be up to the end of the video (as expected), but the frame are not encoded properly, and they seems to freeze at the end and the audio continue.

    The one that look almost the same except the freeze at the end look like this:

    ffmpeg -i input.mov \
           -pattern_type glob -i 'result_*.tif' 
           -map 1 -map 0:a \
           -map_metadata 0 \
           -map_metadata:s:v 0:s:v \
           -map_metadata:s:a 0:s:a \
           output.mov
    

    Where I use the metadata and the audio from the input video, and use the frames from my second input.

    EDIT: As suggested here the details of the source video.

    ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers
      built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-28)
      configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
      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
      libavresample   2.  1.  0 /  2.  1.  0
      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 'Transparent.mov':
      Metadata:
        major_brand     : qt
        minor_version   : 0
        compatible_brands: qt
        creation_time   : 2019-09-17 22:06:44
      Duration: 00:00:06.42, start: 0.000000, bitrate: 47798 kb/s
        Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 113 kb/s (default)
        Metadata:
          creation_time   : 2019-09-17 22:06:44
          handler_name    : Core Media Data Handler
        Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 47541 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 48k tbc (default)
        Metadata:
          creation_time   : 2019-09-17 22:06:44
          handler_name    : Core Media Data Handler
          encoder         : H.264
          timecode        : 00:00:00:00
        Stream #0:2(und): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
        Metadata:
          creation_time   : 2019-09-17 22:06:44
          handler_name    : Core Media Data Handler
          timecode        : 00:00:00:00
    At least one output file must be specified