Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Received zero bytes mp4 while Audio and Video convert

    16 juillet 2019, par Murugan

    I have a project that requires merging of a video file with audio file. We are using FFMPEG for audio(.mp3) and video(.mp4) merging. We have tried as below given ffmpeg command but we have received zero bytes mp4 file

    ffmpeg -i videofinal.mp4 -i audiofinal.mp3 -shortest -strict -2 final.mp4
    
  • ffmpeg concat and preserve metadata streams

    16 juillet 2019, par Andrew

    I'm trying to concat multiple files that are the result of a GoPro Hero6 splitting movies to avoid the FAT 4GB limit. ffmpeg works great for this purpose but I need the telemetry data that is encoded in the metadata streams, and ffmpeg by default doesn't seem to preserve this. Using the ffprobe command you can see that the source videos have:

    Stream #0:3(eng): Data: none (gpmd / 0x646D7067), 36 kb/s (default)
    Metadata:
      creation_time   : 2018-07-15T16:16:26.000000Z
      handler_name    : GoPro MET
    

    I know from research that this is the stream I need (although I'd like to be able to copy all streams). However when using ffmpeg -f concat the output is:

    [concat @ 0x7febb9800000] Could not find codec parameters for stream 2 (Unknown: none): unknown codec
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    [concat @ 0x7febb9800000] Could not find codec parameters for stream 3 (Unknown: none): unknown codec
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    [concat @ 0x7febb9800000] Could not find codec parameters for stream 4 (Unknown: none): unknown codec
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, concat, from 'tmp.txt':
      Duration: N/A, start: 0.000000, bitrate: 66194 kb/s
        Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 2704x1520 [SAR 1:1 DAR 169:95], 66005 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc
        Metadata:
          creation_time   : 2018-07-15T16:08:22.000000Z
          handler_name    : GoPro AVC
          encoder         : GoPro AVC encoder
          timecode        : 16:23:48:21
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s
        Metadata:
          creation_time   : 2018-07-15T16:08:22.000000Z
          handler_name    : GoPro AAC
          timecode        : 16:23:48:21
        Stream #0:2: Unknown: none
        Stream #0:3: Unknown: none
        Stream #0:4: Unknown: none
    Output #0, mp4, to 'GH0089.MP4':
      Metadata:
        encoder         : Lavf58.12.100
        Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 2704x1520 [SAR 1:1 DAR 169:95], q=2-31, 66005 kb/s, 0.02 fps, 59.94 tbr, 60k tbn, 60k tbc
        Metadata:
          creation_time   : 2018-07-15T16:08:22.000000Z
          handler_name    : GoPro AVC
          encoder         : GoPro AVC encoder
          timecode        : 16:23:48:21
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s
        Metadata:
          creation_time   : 2018-07-15T16:08:22.000000Z
          handler_name    : GoPro AAC
          timecode        : 16:23:48:21
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    

    The warnings Could not find codec parameters are especially interesting and Stream mapping shows that only the video and audio streams are mapped. I've played around with map_metadata to no avail. I may not have the format right but it seems more likely that the issue is related to the warning as the codecs are not recognized and I would expect all streams to be mapped by default.

    I would expect or hope for an answer that ignore the warnings and map the unrecognized streams without attempting to understand them.

    Any help is appreciated.

  • How can I simulate OpenFile in FFmpeg ?

    16 juillet 2019, par Jason117

    Most gif capture software capture screen and then save them one by one single frame picture file on disk,then read them into memory and combine them to gif,makes the whole procdure very slowly.

    I got a idea to capture screen with DirectX(so we could also capture directx window faster since it direct operate the screen d3d device)API to got the bitmap,then save them to memory(such as buffer),then passing the memory location to ffmpeg to produce a video so we don't need disk storge as a middle buffer so it could be ten more faster since the disk is now most slowly part on pc now.

    the directx capture screen part is already.But I found that ffmpeg using OpenFile to read the picture file,so here may we can simulate the OpenFile? If answer is yes,how could we do it?

  • How to find a "safe" point for -SS using FFMPEG to avoid breaking A/V sync ?

    16 juillet 2019, par user3144514

    I need to find a way to cut video using -SS without breaking the audio/video sync.

    Once in a while it works perfectly fine, but most of the time the audio falls slightly out of synch. Clearly there is something akin to a keyframe for audio, but I do not know how to find them.

    The problem happens when using -SS in conjunction with Any specification for a codec, including -c copy.

    For my purposes, I can't lose quality so those are necessary.

    ffmpeg -i src.mp4 -ss 1:00 -t 30 -c copy result.mp4
    

    tends to break the sync.

    ffmpeg -i src.mpr -ss 1:00 -t 30 result.mp4
    

    produces matching a/v but with significant quality loss from using the default compressions.

    I need a way to find the times at which a cut will result in matching a/v.

  • How to show video (no audio) from ffmpeg via RTP in VLC ?

    15 juillet 2019, par Sagi Mann

    I'm trying to stream RTP (video only) from ffmpeg to VLC:

    ffmpeg -stream_loop -1 -i video.mp4 -vcodec copy -an -f rtp rtp://0.0.0.0:1235
    

    In VLC app, I do file -> "open network" and set the url to rtp://@:1235. But I get an error:

    SDP required
    A description in SDP format is required to receive the RTP stream.
    Note that rtp:// URIs cannot work with dynamic RTP payload format (96).
    

    What am I doing wrong? I see in ffmpeg's output that SDP is being generated:

    SDP:
    v=0
    o=- 0 0 IN IP4 127.0.0.1
    s=No Name
    c=IN IP4 0.0.0.0
    t=0 0
    a=tool:libavformat 58.20.100
    m=video 1235 RTP/AVP 96
    b=AS:1205
    a=rtpmap:96 H264/90000
    a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z01AH9oBQBbsBEAAAAMAQAAADIPGDKg=,aO88gA==; profile-level-id=4D401F