Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Using ffmpeg to transcode/transmux HLS to RTMP for nginx simulcast not working

    21 mai 2018, par Zach

    I want to take an HLS stream and transcode it to RTMP and simulcast it with the nginx RTMP module.

    It's not working, however (I have it placed in the application section of the RTMP module).

    exec ffmpeg -i -re http://.m3u8 -acodec aac -vcodec libx264 -f flv rtmp://localhost/live/test;
    

    When I try to view my RTMP stream in VLC, it is not loading. I have tried several variations of that ffmpeg directive, none have worked. Any advice? If you need to see more of my config file, I can provide that, but this server has been working previously perfectly when sending video over via a Teradek encoder. This new wrinkle is just not working.

    EDIT: Just had a thought. It’d probably help to have the codec information of the incoming HLS stream. Here it is:

    • Video Codec: H264 - MPEG-4 AVC
    • Resolution: 640x360
    • Frame rate: 24
    • Decoded format: Planar 4:2:0 YUV
    • Audio Codec: MPEG AAC Audio (mp4a)
    • Channels: Stereo
    • Sample rate:48000Hz
  • Converting an HLS (m3u8) to MP4 [on hold]

    21 mai 2018, par orcaman

    Can anyone advise on how to construct an MP4 file from an HLS stream (the reverse of what you usually want)? Say I have the m3u8 - is there a straightforward way of getting a single MP4 using FFMPEG or some other tool?

  • high CPU usage with ffmpeg and youtube live stream

    21 mai 2018, par Sergio santa

    I have a problem with high CPU usage using FFmpeg to stream my videos via youtube. my main purpose is to stream loop videos as long as possible but after 6 hours the stream stops and the CPU usage was almost 90%.

    the code I'm using

    ffmpeg -re -stream_loop -1 -i video.mp4 -vcodec libx264 -preset veryfast -maxrate 2500k -bufsize 3368k -vf "format=yuv420p" -g 60 -acodec libmp3lame -b:a 198k -ar 44100 -f flv -s 1280x720 -max_muxing_queue_size 400 rtmp://a.rtmp.youtube.com/live2/xxxxxxxxx
    

    My VPS details: 1 vCPU, 3 GB memory

  • FFmpeg extract frames from video

    21 mai 2018, par KUTG

    I am currently using FFmpeg in Android with this lib. I am trying to extract 1 frame each second from a video. My current command is:

    final String cmd[] = {"-i" + videoPath +  "-vf fps=1" +  mediaStorageDir.getAbsolutePath() + "a.png"};
    

    Now i understand if this code were right the image would keep being overlapped because every image is called a.png. This is not the problem right now this code was for testing but I cant even get the command to work.

    this is the error

    Error splitting the argument list: Option not found

    Any help is much appreciated. P.S i used this documentation to find the command

  • Two Pass encoding FFMpeg C/C++

    21 mai 2018, par Carmine Spizuoco

    From different days I'm trying to implement the two pass encoding h264 in ffmpeg without success. I understand that in the first pass I need to create a text file with the statistics that are in stats_out. This step is realized internally from ffmpeg, so I need set the first pass and have the data in stats_out and after I need go to pass 2.

    For now I'm trying to activate the pass 1 in different way adding the flag in the codecContext:

    CodecCtx->flags |= AV_CODEC_FLAG_PASS1;
    

    and/or set the option before the creation of context:

    av_opt_set(CodecCtx, "pass", "1", 0);
    

    but in any way i have the same result, stats_out is always (null).

    Also in the investigation i discovery this FF_API_STATS_BIT that seems to be deprecated:

    if FF_API_STAT_BITS

    /* statistics, used for 2-pass encoding */
    attribute_deprecated
    int mv_bits;
    attribute_deprecated
    int header_bits;
    attribute_deprecated
    int i_tex_bits;
    attribute_deprecated
    int p_tex_bits;
    attribute_deprecated
    int i_count;
    attribute_deprecated
    int p_count;
    attribute_deprecated
    int skip_count;
    attribute_deprecated
    int misc_bits;
    
    /** @deprecated this field is unused */
    attribute_deprecated
    int frame_bits;
    

    endif

    So there is i little bit of ambiguity on how to realize this process and the relative posts are too old and not very usefull.

    There is anyone that had experience on it?