[Libav-user] Fwd: resize video stream

Сергей Икол sergbest0 at gmail.com
Mon Apr 5 15:23:08 EEST 2021


Sorry for not adding this right away
I am trying to replace this command
ffmpeg -re -i input.ts -map 0:0 -map 0:1 -vf scale=320:240 out.ts
due to the fact that the stream is written to input.ts and the usual ffmpeg
command all overtakes the end of the file and ends

that's why I want to make my own implementation of this command because I
know when the end of the input.ts file will actually come

пн, 5 квіт. 2021 о 11:13 Сергей Икол <sergbest0 at gmail.com> пише:

> Gonzalo GarramuñoThank you very much for your help.
>
> I think I'm completely confused ((
>
> I just want to read the incoming video file (it contains video and audio),
> then resize the video and save it in the same format (.ts).
>
> My plan:
> 1. Open the video and select the desired streams (line 123-126)
> 2. Prepare AVCodecContext (line 207-214)
> 3. Decode video frame
> 4. I change the size of the frame (sws_scale ())
> 5. I encode the frame (line 352)
> 6. I write the frame to a file (line 372)
>
> line 352 (avcodec_send_frame ()) constantly returns -22
>
> it seems to me that somewhere I am making a fundamental mistake ((
>
>
>
> сб, 3 квіт. 2021 о 16:29 Gonzalo Garramuño <ggarra13 at gmail.com> пише:
>
>>
>> El 3/4/21 a las 06:21, Сергей Икол escribió:
>>
>> Hello!
>>
>> I use this example
>>
>> https://github.com/leandromoreira/ffmpeg-libav-tutorial/blob/master/2_remuxing.c
>>
>> I want to change this example a little to resize the output video stream
>> Is it posible?
>> Can I use sws_scale() for this? Or do I need to use some other method for
>> this?
>>
>> I would be glad for any advice!)
>>
>> Yes it is possible and yes you can use sws_scale for this.  Just make
>> sure you are using the right pix_fmt and have the right linesizes in
>> addition to the new resolution and all should be fine.
>> _______________________________________________
>> Libav-user mailing list
>> Libav-user at ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/libav-user
>>
>> To unsubscribe, visit link above, or email
>> libav-user-request at ffmpeg.org with subject "unsubscribe".
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20210405/b3eb96bb/attachment.html>


More information about the Libav-user mailing list